Skip to content

Commit

Permalink
Cosmetic
Browse files Browse the repository at this point in the history
In HTML5 <tt> is deprecated, so use <code> instead.
  • Loading branch information
julianhyde committed Oct 28, 2018
1 parent 0d31de7 commit 4b51b5a
Show file tree
Hide file tree
Showing 16 changed files with 128 additions and 132 deletions.
11 changes: 6 additions & 5 deletions core/src/main/java/org/apache/calcite/rex/RexSimplify.java
Original file line number Diff line number Diff line change
Expand Up @@ -927,12 +927,13 @@ static class SafeRexVisitor implements RexVisitor<Boolean> {

}

/** Analyzes a given {@link RexNode} and decides whenever its safe to unwind.
/** Analyzes a given {@link RexNode} and decides whenever it is safe to
* unwind.
*
* CaseSafe means that it only contains a combination of known good operators.
* <p>"Safe" means that it only contains a combination of known good operators.
*
* The division is an unsafe operator, consider:
* <pre>case when a &gt; 0 then 1/a else null end</pre>
* <p>Division is an unsafe operator; consider the following:
* <pre>case when a &gt; 0 then 1 / a else null end</pre>
*/
static boolean isSafeExpression(RexNode r) {
return r.accept(new SafeRexVisitor());
Expand Down Expand Up @@ -972,7 +973,7 @@ private static RexNode simplifyBooleanCase(RexBuilder rexBuilder,
/**
* Generic boolean case simplification.
*
* Rewrites:
* <p>Rewrites:
* <pre>
* CASE
* WHEN p1 THEN x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2394,10 +2394,11 @@ public static int subtractMonths(long t0, long t1) {
}

/**
* Implements the {@code .} (field access) operator on an object whose type is not known until
* runtime.
* Implements the {@code .} (field access) operator on an object
* whose type is not known until runtime.
*
* A struct object can be represented in various ways by the runtime and depends on the
* <p>A struct object can be represented in various ways by the
* runtime and depends on the
* {@link org.apache.calcite.adapter.enumerable.JavaRowFormat}.
*/
@Experimental
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1947,10 +1947,12 @@ public boolean argumentMustBeScalar(int ordinal) {
};

/**
* The internal {@code $STRUCT_ACCESS} operator is used to access a field of a record.
* The internal {@code $STRUCT_ACCESS} operator is used to access a
* field of a record.
*
* In contrast with {@link #DOT} operator it never appears in an {@link SqlNode} tree and allows
* to access fields by position and not by name.
* <p>In contrast with {@link #DOT} operator, it never appears in an
* {@link SqlNode} tree and allows to access fields by position and
* not by name.
*/
public static final SqlInternalOperator STRUCT_ACCESS =
new SqlInternalOperator("$STRUCT_ACCESS", SqlKind.OTHER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ protected static <T> List<T> plus(List<T>... lists) {
assertSimplify(sql, "SELECT ax _suggest_ FROM ( SELECT * FROM dummy a )");
}

@Test public void testSimlifySubqueryStar() {
@Test public void testSimlifySubQueryStar() {
String sql;
sql = "select ax^ from (select (select * from dummy) axc from dummy a)";
assertSimplify(sql,
Expand All @@ -691,7 +691,7 @@ protected static <T> List<T> plus(List<T>... lists) {
assertSimplify(sql, "SELECT _suggest_ FROM ( SELECT a.x + b.y FROM dummy a , dummy b )");
}

@Test public void testSimlifySubqueryMultipleFrom() {
@Test public void testSimlifySubQueryMultipleFrom() {
String sql;
// "dummy b" should be removed
sql = "select axc from (select (select ^ from dummy) axc from dummy a), dummy b";
Expand Down
41 changes: 18 additions & 23 deletions core/src/test/java/org/apache/calcite/test/BookstoreSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,56 +24,51 @@
/**
* A Schema representing a bookstore.
*
* It contains a single table with various levels/types of nesting, and is used mainly for testing
* parts of code that rely on nested structures.
* <p>It contains a single table with various levels/types of nesting,
* and is used mainly for testing parts of code that rely on nested
* structures.
*
* New authors can be added but attention should be made to update appropriately tests that might
* fail.
* <p>New authors can be added but attention should be made to update
* appropriately tests that might fail.
*
* The Schema is meant to be used with {@link org.apache.calcite.adapter.java.ReflectiveSchema} thus
* all fields, and methods, should be public.
* <p>The Schema is meant to be used with
* {@link org.apache.calcite.adapter.java.ReflectiveSchema} thus all
* fields, and methods, should be public.
*/
public final class BookstoreSchema {

public final Author[] authors = {
new Author(
1,
new Author(1,
"Victor Hugo",
new Place(
new Coordinate(BigDecimal.valueOf(47.24), BigDecimal.valueOf(6.02)),
"Besançon",
"France"),
Collections.singletonList(
new Book(
"Les Misérables",
new Book("Les Misérables",
1862,
Collections.singletonList(new Page(1, "Contents"))))),
new Author(
2,
new Author(2,
"Nikos Kazantzakis",
new Place(new Coordinate(BigDecimal.valueOf(35.3387), BigDecimal.valueOf(25.1442)),
new Place(
new Coordinate(BigDecimal.valueOf(35.3387), BigDecimal.valueOf(25.1442)),
"Heraklion",
"Greece"),
Arrays.asList(
new Book(
"Zorba the Greek",
new Book("Zorba the Greek",
1946,
Arrays.asList(
new Page(1, "Contents"),
Arrays.asList(new Page(1, "Contents"),
new Page(2, "Acknowledgements"))),
new Book(
"The Last Temptation of Christ",
new Book("The Last Temptation of Christ",
1955,
Collections.singletonList(new Page(1, "Contents")))
)),
new Author(
3,
new Author(3,
"Homer",
new Place(null,
"Ionia",
"Greece"),
Collections.emptyList()
)
Collections.emptyList())
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1541,8 +1541,7 @@ private void checkExponentialCnf(int n) {
not(vBool(2)), not(vBool())),
"AND(?0.bool3, null, IS NULL(?0.bool1),"
+ " IS NULL(?0.bool2), NOT(?0.bool0))",
"false"
);
"false");
}

@Test public void testSimplifyOrTerms() {
Expand Down Expand Up @@ -1617,8 +1616,7 @@ private void checkExponentialCnf(int n) {
checkSimplifyFilter(
or(isNull(bRef),
isNotFalse(bRef)),
"OR(IS NULL(?0.b), IS NOT FALSE(?0.b))"
);
"OR(IS NULL(?0.b), IS NOT FALSE(?0.b))");

// multiple predicates are handled correctly
checkSimplifyFilter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* Registers dynamic tables.
*
* Non thread-safe.
* <p>Not thread-safe.
*/
public class MockCatalogReaderDynamic extends MockCatalogReader {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ enum ElasticsearchMethod {
List.class, // groupBy
List.class, // aggregations
Long.class, // offset
Long.class // fetch
);
Long.class); // fetch

public final Method method;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ protected Enumerable<Object> find(List<String> ops,
ArrayNode sortNode = query.withArray("sort");
sort.forEach(e ->
sortNode.add(
mapper.createObjectNode().put(e.getKey(), e.getValue().isDescending() ? "desc" : "asc"))
);
mapper.createObjectNode().put(e.getKey(),
e.getValue().isDescending() ? "desc" : "asc")));
}

if (offset != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.calcite.adapter.geode.rel;

import org.junit.ClassRule;

/**
* Base class which allows sharing same geode instance across all tests. Also due to legacy
* reasons there can't be more than one Geode instance (running in parallel) for a single JVM.
* Base class that allows sharing same geode instance across all tests.
*
* <p>Also, due to legacy reasons, there can't be more than one Geode
* instance (running in parallel) for a single JVM.
*/
public abstract class AbstractGeodeTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ public Expression append(String name, BlockStatement block,
ParameterExpression pe = Expressions.parameter(
declaration.parameter.type, newName);
DeclarationStatement newDeclaration = Expressions.declare(
declaration.modifiers, pe, declaration.initializer
);
declaration.modifiers, pe, declaration.initializer);
x = pe;
add(newDeclaration);
}
Expand Down
2 changes: 1 addition & 1 deletion site/_data/contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
- name: Andrei Sereda
apacheId: sereda
githubId: asereda-gs
org:
org:
role: Committer
- name: Ashutosh Chauhan
apacheId: hashutosh
Expand Down
Loading

0 comments on commit 4b51b5a

Please sign in to comment.