diff --git a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlBegin.java b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlBegin.java index bfd275c3ef1f..0036920ac84c 100644 --- a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlBegin.java +++ b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlBegin.java @@ -36,6 +36,7 @@ /** * Parse tree node representing a {@code BEGIN} clause. + * * @see BEGIN specification */ public class SqlBegin extends SqlCall { diff --git a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlCommit.java b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlCommit.java index 8b9491803f63..63d0396feba2 100644 --- a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlCommit.java +++ b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlCommit.java @@ -34,6 +34,7 @@ /** * Parse tree node representing a {@code COMMIT} clause. + * * @see COMMIT specification */ public class SqlCommit extends SqlCall { diff --git a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlDiscard.java b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlDiscard.java index 78adbd8574f9..1dac9a450dbd 100644 --- a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlDiscard.java +++ b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlDiscard.java @@ -35,6 +35,7 @@ /** * Parse tree node representing a {@code DISCARD} clause. + * * @see DISCARD specification */ public class SqlDiscard extends SqlCall { diff --git a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlRollback.java b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlRollback.java index c400f0c8432a..74ec7b8258c6 100644 --- a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlRollback.java +++ b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlRollback.java @@ -34,6 +34,7 @@ /** * Parse tree node representing a {@code ROLLBACK} clause. + * * @see ROLLBACK specification */ public class SqlRollback extends SqlCall { diff --git a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlShow.java b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlShow.java index 6e81b01cb234..5587aa31e9ef 100644 --- a/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlShow.java +++ b/babel/src/main/java/org/apache/calcite/sql/babel/postgresql/SqlShow.java @@ -35,6 +35,7 @@ /** * Parse tree node representing a {@code SHOW} clause. + * * @see SHOW specification */ public class SqlShow extends SqlCall { diff --git a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraRules.java b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraRules.java index 6fc1f47432af..db5d83960d0c 100644 --- a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraRules.java +++ b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraRules.java @@ -228,7 +228,7 @@ private static boolean isEqualityOnKey(RexNode node, List fieldNames, scan.cassandraTable.getClusteringOrder()); } - /** Deprecated in favor of {@link CassandraFilterRuleConfig}. **/ + /** Deprecated in favor of {@link CassandraFilterRuleConfig}. */ @Deprecated public interface Config extends CassandraFilterRuleConfig { } @@ -362,7 +362,7 @@ private static boolean collationsCompatible(RelCollation sortCollation, call.transformTo(convert(sort, filter)); } - /** Deprecated in favor of CassandraSortRuleConfig. **/ + /** Deprecated in favor of CassandraSortRuleConfig. */ @Deprecated public interface Config extends CassandraSortRuleConfig { } @@ -417,7 +417,7 @@ public RelNode convert(EnumerableLimit limit) { call.transformTo(convert(limit)); } - /** Deprecated in favor of CassandraLimitRuleConfig. **/ + /** Deprecated in favor of CassandraLimitRuleConfig. */ @Deprecated public interface Config extends CassandraLimitRuleConfig { } diff --git a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/package-info.java b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/package-info.java index 82ed9fde0995..c9bc16403e90 100644 --- a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/package-info.java +++ b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/package-info.java @@ -18,6 +18,6 @@ /** * Cassandra query provider. * - *

There is one table for each Cassandra column family.

+ *

There is one table for each Cassandra column family. */ package org.apache.calcite.adapter.cassandra; diff --git a/cassandra/src/test/java/org/apache/calcite/test/CassandraExtension.java b/cassandra/src/test/java/org/apache/calcite/test/CassandraExtension.java index e332d329d9a1..73f19b49cc4e 100644 --- a/cassandra/src/test/java/org/apache/calcite/test/CassandraExtension.java +++ b/cassandra/src/test/java/org/apache/calcite/test/CassandraExtension.java @@ -51,13 +51,13 @@ import java.util.concurrent.ExecutionException; /** - * JUnit5 extension to start and stop embedded cassandra server. + * JUnit5 extension to start and stop embedded Cassandra server. * *

Note that tests will be skipped if running on JDK11+ or Eclipse OpenJ9 JVM * (not supported by cassandra-unit and Cassandra, respectively) see - * cassandra-unit issue #294 - * and CASSANDRA-14883, - * respectively. + * cassandra-unit issue #294 + * and CASSANDRA-14883, + * respectively. */ class CassandraExtension implements ParameterResolver, ExecutionCondition { @@ -102,6 +102,7 @@ private static CassandraResource getOrCreate(ExtensionContext context) { /** * Whether to run this test. + * *

Enabled by default, unless explicitly disabled * from command line ({@code -Dcalcite.test.cassandra=false}) or running on incompatible JDK * version or JVM (see below). diff --git a/core/src/main/java/org/apache/calcite/DataContext.java b/core/src/main/java/org/apache/calcite/DataContext.java index 9632b3617381..ed784094bc7a 100644 --- a/core/src/main/java/org/apache/calcite/DataContext.java +++ b/core/src/main/java/org/apache/calcite/DataContext.java @@ -63,7 +63,7 @@ public interface DataContext { * Returns a context variable. * *

Supported variables include: "sparkContext", "currentTimestamp", - * "localTimestamp".

+ * "localTimestamp". * * @param name Name of variable */ diff --git a/core/src/main/java/org/apache/calcite/adapter/clone/ArrayTable.java b/core/src/main/java/org/apache/calcite/adapter/clone/ArrayTable.java index 9c5581e636fe..1ac4612fa048 100644 --- a/core/src/main/java/org/apache/calcite/adapter/clone/ArrayTable.java +++ b/core/src/main/java/org/apache/calcite/adapter/clone/ArrayTable.java @@ -112,7 +112,7 @@ enum RepresentationType { /** Constant. Contains only one value. * *

We can't store 0-bit values in - * an array: we'd have no way of knowing how many there were.

+ * an array: we'd have no way of knowing how many there were. * * @see Constant */ @@ -156,7 +156,7 @@ enum RepresentationType { * values with many duplicates is a win; a column of mostly distinct * {@code short} values is likely a loss. The other win is if there are * null values; otherwise the best option would be an - * {@link #OBJECT_ARRAY}.

+ * {@link #OBJECT_ARRAY}. * * @see PrimitiveDictionary */ @@ -180,7 +180,7 @@ enum RepresentationType { * occur very commonly are held in an 'exceptions' array and are * recognized by their high offsets. Other strings are created on demand * (this reduces the number of objects that need to be created during - * deserialization from cache.

+ * deserialization from cache. * * @see StringDictionary */ diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/AggAddContext.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/AggAddContext.java index bdb3a706fbec..68d1e1be47fc 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/AggAddContext.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/AggAddContext.java @@ -35,6 +35,7 @@ public interface AggAddContext extends AggResultContext { * Returns {@link org.apache.calcite.rex.RexNode} representation of arguments. * This can be useful for manual translation of required arguments with * different {@link NullPolicy}. + * * @return {@link org.apache.calcite.rex.RexNode} representation of arguments */ List rexArguments(); @@ -50,6 +51,7 @@ public interface AggAddContext extends AggResultContext { * The resulting value is equivalent to * {@code rowTranslator().translateList(rexArguments())}. * This is handy if you need just operate on argument. + * * @return Linq4j form of arguments. */ List arguments(); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/AggContext.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/AggContext.java index c5f5ca1f8b02..e6897094d95f 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/AggContext.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/AggContext.java @@ -31,6 +31,7 @@ public interface AggContext { /** * Returns the aggregation being implemented. + * * @return aggregation being implemented. */ SqlAggFunction aggregation(); @@ -47,6 +48,7 @@ public interface AggContext { /** * Returns the return type of the aggregate as {@link java.lang.reflect.Type}. + * * @return return type of the aggregate as {@link java.lang.reflect.Type} */ Type returnType(); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java index a92cc9820228..70e99deeb8ef 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumUtils.java @@ -733,7 +733,7 @@ public static MethodCallExpression call(@Nullable Expression targetExpression, return null; } - /** Transforms a JoinRelType to Linq4j JoinType. **/ + /** Transforms a JoinRelType to Linq4j JoinType. */ static JoinType toLinq4jJoinType(JoinRelType joinRelType) { switch (joinRelType) { case INNER: @@ -755,7 +755,7 @@ static JoinType toLinq4jJoinType(JoinRelType joinRelType) { "Unable to convert " + joinRelType + " to Linq4j JoinType"); } - /** Returns a predicate expression based on a join condition. **/ + /** Returns a predicate expression based on a join condition. */ static Expression generatePredicate( EnumerableRelImplementor implementor, RexBuilder rexBuilder, diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRules.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRules.java index d12a31e7176e..a59710896481 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRules.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRules.java @@ -66,7 +66,7 @@ private EnumerableRules() { EnumerableBatchNestedLoopJoinRule.Config.DEFAULT.toRule(); /** Rule that converts a - * {@link org.apache.calcite.rel.logical.LogicalProject} to an + * {@link org.apache.calcite.rel.logical.LogicalProject} to an * {@link EnumerableProject}. */ public static final EnumerableProjectRule ENUMERABLE_PROJECT_RULE = EnumerableProjectRule.DEFAULT_CONFIG.toRule(EnumerableProjectRule.class); @@ -166,7 +166,7 @@ private EnumerableRules() { EnumerableProjectToCalcRule.Config.DEFAULT.toRule(); /** Rule that converts a - * {@link org.apache.calcite.rel.logical.LogicalTableScan} to + * {@link org.apache.calcite.rel.logical.LogicalTableScan} to * {@link EnumerableConvention enumerable calling convention}. */ public static final EnumerableTableScanRule ENUMERABLE_TABLE_SCAN_RULE = EnumerableTableScanRule.DEFAULT_CONFIG @@ -180,7 +180,7 @@ private EnumerableRules() { .toRule(EnumerableTableFunctionScanRule.class); /** Rule that converts a {@link LogicalMatch} to an - * {@link EnumerableMatch}. */ + * {@link EnumerableMatch}. */ public static final EnumerableMatchRule ENUMERABLE_MATCH_RULE = EnumerableMatchRule.DEFAULT_CONFIG.toRule(EnumerableMatchRule.class); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableScan.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableScan.java index 9df232f59d17..ace76188b135 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableScan.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableScan.java @@ -119,8 +119,9 @@ public static EnumerableTableScan create(RelOptCluster cluster, /** Returns whether EnumerableTableScan can generate code to handle a * particular variant of the Table SPI. + * * @deprecated remove before Calcite 2.0 - **/ + */ @Deprecated public static boolean canHandle(Table table) { if (table instanceof TransientTable) { @@ -135,8 +136,7 @@ public static boolean canHandle(Table table) { } /** Returns whether EnumerableTableScan can generate code to handle a - * particular variant of the Table SPI. - **/ + * particular variant of the Table SPI. */ public static boolean canHandle(RelOptTable relOptTable) { Table table = relOptTable.unwrap(Table.class); if (table != null && !canHandle(table)) { diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/MatchUtils.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/MatchUtils.java index 52c917b570a1..254ffc289aa6 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/MatchUtils.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/MatchUtils.java @@ -28,6 +28,7 @@ private MatchUtils() { /** * Returns the row with the highest index whose corresponding symbol matches, null otherwise. + * * @param symbol Target Symbol * @param rows List of passed rows * @param symbols Corresponding symbols to rows diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilder.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilder.java index d319251a0040..8dcfec45ce6f 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilder.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilder.java @@ -27,6 +27,7 @@ public interface NestedBlockBuilder { /** * Starts nested code block. The resulting block can optimize expressions * and reuse already calculated values from the parent blocks. + * * @return new code block that can optimize expressions and reuse already * calculated values from the parent blocks. */ @@ -35,6 +36,7 @@ public interface NestedBlockBuilder { /** * Uses given block as the new code context. * The current block will be restored after {@link #exitBlock()} call. + * * @param block new code block * @see #exitBlock() */ @@ -47,6 +49,7 @@ public interface NestedBlockBuilder { /** * Leaves the current code block. + * * @see #nestBlock() */ void exitBlock(); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilderImpl.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilderImpl.java index 581f84049606..9b6bbd41614e 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilderImpl.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/NestedBlockBuilderImpl.java @@ -31,6 +31,7 @@ public class NestedBlockBuilderImpl implements NestedBlockBuilder { /** * Constructs nested block builders starting of a given code block. + * * @param block root code block */ @SuppressWarnings("method.invocation.invalid") @@ -41,6 +42,7 @@ public NestedBlockBuilderImpl(BlockBuilder block) { /** * Starts nested code block. The resulting block can optimize expressions * and reuse already calculated values from the parent blocks. + * * @return new code block that can optimize expressions and reuse already * calculated values from the parent blocks. */ @@ -53,6 +55,7 @@ public NestedBlockBuilderImpl(BlockBuilder block) { /** * Uses given block as the new code context. * The current block will be restored after {@link #exitBlock()} call. + * * @param block new code block * @see #exitBlock() */ @@ -69,6 +72,7 @@ public NestedBlockBuilderImpl(BlockBuilder block) { /** * Leaves the current code block. + * * @see #nestBlock() */ @Override public final void exitBlock() { diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/NullPolicy.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/NullPolicy.java index 8a9c78bfc3a4..1d426ea43b1c 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/NullPolicy.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/NullPolicy.java @@ -22,7 +22,7 @@ *

STRICT and ANY are similar. STRICT says f(a0, a1) will NEVER return * null if a0 and a1 are not null. This means that we can check whether f * returns null just by checking its arguments. Use STRICT in preference to - * ANY whenever possible.

+ * ANY whenever possible. */ public enum NullPolicy { /** Returns null if and only if all of the arguments are null; diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysType.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysType.java index 4ee08361cdfb..4447e91dfe3c 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysType.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysType.java @@ -36,7 +36,7 @@ * type of the row (returned by {@link #getJavaRowType()}), and methods to * generate expressions to access fields, generate records, and so forth. * Together, the records encapsulate how the logical type maps onto the physical - * type.

+ * type. */ public interface PhysType { /** Returns the Java type (often a Class) that represents a row. For @@ -48,7 +48,7 @@ public interface PhysType { * ordinal. * *

For instance, when the java row type is {@code Object[]}, the java - * field type is {@code Object} even if the field is not nullable.

*/ + * field type is {@code Object} even if the field is not nullable. */ Type getJavaFieldType(int field); /** Returns the type factory. */ diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java index 2eba9bf112ae..24c1d02748d6 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java @@ -940,6 +940,7 @@ public static Expression translateCondition(RexProgram program, } /** Returns whether an expression is nullable. + * * @param e Expression * @return Whether expression is nullable */ diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictAggImplementor.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictAggImplementor.java index 105c8ac9c608..54569acc57c7 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictAggImplementor.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictAggImplementor.java @@ -32,6 +32,7 @@ /** * The base implementation of strict aggregate function. + * * @see org.apache.calcite.adapter.enumerable.RexImpTable.CountImplementor * @see org.apache.calcite.adapter.enumerable.RexImpTable.SumImplementor */ diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictWinAggImplementor.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictWinAggImplementor.java index cd27b9da2db8..2c7ba0a7d883 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictWinAggImplementor.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/StrictWinAggImplementor.java @@ -23,6 +23,7 @@ /** * The base implementation of strict window aggregate function. + * * @see org.apache.calcite.adapter.enumerable.RexImpTable.FirstLastValueImplementor * @see org.apache.calcite.adapter.enumerable.RexImpTable.RankImplementor * @see org.apache.calcite.adapter.enumerable.RexImpTable.RowNumberImplementor diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggAddContext.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggAddContext.java index dd1e92f7ad79..d62b2efba69e 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggAddContext.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggAddContext.java @@ -25,6 +25,7 @@ *

{@link WinAggAddContext} is used when implementing windowed aggregate. * Typically, the aggregation implementation will use {@link #arguments()} * or {@link #rexArguments()} to update aggregate value. + * * @see AggAddContext */ public interface WinAggAddContext extends AggAddContext, WinAggResultContext { @@ -34,6 +35,7 @@ public interface WinAggAddContext extends AggAddContext, WinAggResultContext { * This is NOT current row as in "rows between current row". * If you need to know the relative index of the current row in the partition, * use {@link WinAggFrameContext#index()}. + * * @return current position inside for-loop of window aggregate. * @see WinAggFrameContext#index() * @see WinAggFrameContext#startIndex() diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameContext.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameContext.java index 397ff2c4e06f..1b3e9c6dfc13 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameContext.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameContext.java @@ -31,18 +31,21 @@ public interface WinAggFrameContext { * Returns the index of the current row in the partition. * In other words, it is close to ~ROWS BETWEEN CURRENT ROW. * Note to use {@link #startIndex()} when you need zero-based row position. + * * @return the index of the very first row in partition */ Expression index(); /** * Returns the index of the very first row in partition. + * * @return index of the very first row in partition */ Expression startIndex(); /** * Returns the index of the very last row in partition. + * * @return index of the very last row in partition */ Expression endIndex(); @@ -51,6 +54,7 @@ public interface WinAggFrameContext { * Returns the boolean expression that tells if the partition has rows. * The partition might lack rows in cases like ROWS BETWEEN 1000 PRECEDING * AND 900 PRECEDING. + * * @return boolean expression that tells if the partition has rows */ Expression hasRows(); @@ -58,6 +62,7 @@ public interface WinAggFrameContext { /** * Returns the number of rows in the current frame (subject to framing * clause). + * * @return number of rows in the current partition or 0 if the partition * is empty */ @@ -66,6 +71,7 @@ public interface WinAggFrameContext { /** * Returns the number of rows in the current partition (as determined by * PARTITION BY clause). + * * @return number of rows in the current partition or 0 if the partition * is empty */ diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameResultContext.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameResultContext.java index ef4423d2e36d..900c346bbdfb 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameResultContext.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggFrameResultContext.java @@ -25,6 +25,7 @@ public interface WinAggFrameResultContext extends WinAggFrameContext { /** * Converts absolute index position of the given relative position. + * * @param offset offset of the requested row * @param seekType the type of offset (start of window, end of window, etc) * @return absolute position of the requested row @@ -35,6 +36,7 @@ Expression computeIndex(Expression offset, /** * Returns boolean the expression that checks if the given index is in * the frame bounds. + * * @param rowIndex index if the row to check * @return expression that validates frame bounds for the given index */ @@ -43,6 +45,7 @@ Expression computeIndex(Expression offset, /** * Returns boolean the expression that checks if the given index is in * the partition bounds. + * * @param rowIndex index if the row to check * @return expression that validates partition bounds for the given index */ @@ -50,6 +53,7 @@ Expression computeIndex(Expression offset, /** * Returns row translator for given absolute row position. + * * @param rowIndex absolute index of the row. * @return translator for the requested row */ @@ -58,6 +62,7 @@ Expression computeIndex(Expression offset, /** * Compares two rows given by absolute positions according to the order * collation of the current window. + * * @param a absolute index of the first row * @param b absolute index of the second row * @return result of comparison as as in {@link Comparable#compareTo} diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggImplementor.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggImplementor.java index 8a09a7e570bf..ced082733bd7 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggImplementor.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggImplementor.java @@ -22,6 +22,7 @@ * Windowed aggregate is more powerful than regular aggregate since it can * access rows in the current partition by row indices. * Regular aggregate can be used to implement windowed aggregate. + * *

This interface does not define new methods: window-specific * sub-interfaces are passed when implementing window aggregate. * @@ -38,22 +39,26 @@ public interface WinAggImplementor extends AggImplementor { enum SeekType { /** * Start of window. + * * @see WinAggFrameContext#startIndex() */ START, /** * Row position in the frame. + * * @see WinAggFrameContext#index() */ SET, /** * The index of row that is aggregated. * Valid only in {@link WinAggAddContext}. + * * @see WinAggAddContext#currentPosition() */ AGG_INDEX, /** * End of window. + * * @see WinAggFrameContext#endIndex() */ END diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggResultContext.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggResultContext.java index 26818f0490a2..4357c0fd6e60 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggResultContext.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/WinAggResultContext.java @@ -35,6 +35,7 @@ public interface WinAggResultContext extends AggResultContext, * Returns {@link org.apache.calcite.rex.RexNode} representation of arguments. * This can be useful for manual translation of required arguments with * different {@link NullPolicy}. + * * @return {@link org.apache.calcite.rex.RexNode} representation of arguments */ List rexArguments(); @@ -44,6 +45,7 @@ public interface WinAggResultContext extends AggResultContext, * The resulting value is equivalent to * {@code rowTranslator().translateList(rexArguments())}. * This is handy if you need just operate on argument. + * * @param rowIndex index of the requested row. The index must be in range * of partition's startIndex and endIndex. * @return Linq4j form of arguments of the particular row diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggResetContextImpl.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggResetContextImpl.java index f1e83cda163c..793b6a7fd6a0 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggResetContextImpl.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggResetContextImpl.java @@ -37,6 +37,7 @@ public class WinAggResetContextImpl extends AggResetContextImpl /** * Creates window aggregate reset context. + * * @param block code block that will contain the added initialization * @param accumulator accumulator variables that store the intermediate * aggregate state diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcConvention.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcConvention.java index aba34409ffed..2e1f7449e8d2 100644 --- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcConvention.java +++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcConvention.java @@ -29,17 +29,17 @@ * *

The convention is a slight misnomer. The operations occur in whatever * data-flow architecture the database uses internally. Nevertheless, the result - * pops out in JDBC.

+ * pops out in JDBC. * *

This is the only convention, thus far, that is not a singleton. Each * instance contains a JDBC schema (and therefore a data source). If Calcite is * working with two different databases, it would even make sense to convert * from "JDBC#A" convention to "JDBC#B", even though we don't do it currently. * (That would involve asking database B to open a database link to database - * A.)

+ * A.) * *

As a result, converter rules from and to this convention need to be - * instantiated, at the start of planning, for each JDBC database in play.

+ * instantiated, at the start of planning, for each JDBC database in play. */ public class JdbcConvention extends Convention.Impl { /** Cost of a JDBC node versus implementing an equivalent node in a "typical" diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java index 2f3e4e302ad0..006390e3871b 100644 --- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java +++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java @@ -73,7 +73,7 @@ * *

The tables in the JDBC data source appear to be tables in this schema; * queries against this schema are executed against those tables, pushing down - * as much as possible of the query logic to SQL.

+ * as much as possible of the query logic to SQL. */ public class JdbcSchema implements Schema { private static final Logger LOGGER = LoggerFactory.getLogger(JdbcSchema.class); diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcTable.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcTable.java index f021df5badd4..8e9593b632be 100644 --- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcTable.java +++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcTable.java @@ -74,7 +74,7 @@ * such as * {@link org.apache.calcite.linq4j.Queryable#where(org.apache.calcite.linq4j.function.Predicate2)}. * The resulting queryable can then be converted to a SQL query, which can be - * executed efficiently on the JDBC server.

+ * executed efficiently on the JDBC server. */ public class JdbcTable extends AbstractQueryableTable implements TranslatableTable, ScannableTable, ModifiableTable { diff --git a/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java b/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java index d195c15f8d74..7117787c4a72 100644 --- a/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java +++ b/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java @@ -85,19 +85,19 @@ public enum CalciteConnectionProperty implements ConnectionProperty { FUN("fun", Type.STRING, "standard", true), /** How identifiers are quoted. - * If not specified, value from {@link #LEX} is used. */ + * If not specified, value from {@link #LEX} is used. */ QUOTING("quoting", Type.ENUM, null, false, Quoting.class), /** How identifiers are stored if they are quoted. - * If not specified, value from {@link #LEX} is used. */ + * If not specified, value from {@link #LEX} is used. */ QUOTED_CASING("quotedCasing", Type.ENUM, null, false, Casing.class), /** How identifiers are stored if they are not quoted. - * If not specified, value from {@link #LEX} is used. */ + * If not specified, value from {@link #LEX} is used. */ UNQUOTED_CASING("unquotedCasing", Type.ENUM, null, false, Casing.class), /** Whether identifiers are matched case-sensitively. - * If not specified, value from {@link #LEX} is used. */ + * If not specified, value from {@link #LEX} is used. */ CASE_SENSITIVE("caseSensitive", Type.BOOLEAN, null, false), /** Parser factory. diff --git a/core/src/main/java/org/apache/calcite/config/CalciteSystemProperty.java b/core/src/main/java/org/apache/calcite/config/CalciteSystemProperty.java index 29140dab4bc1..964d0cc0818d 100644 --- a/core/src/main/java/org/apache/calcite/config/CalciteSystemProperty.java +++ b/core/src/main/java/org/apache/calcite/config/CalciteSystemProperty.java @@ -36,7 +36,7 @@ /** * A Calcite specific system property that is used to configure various aspects of the framework. * - *

Calcite system properties must always be in the "calcite" root namespace.

+ *

Calcite system properties must always be in the "calcite" root namespace. * * @param the type of the property value */ @@ -45,7 +45,7 @@ public final class CalciteSystemProperty { * Holds all system properties related with the Calcite. * *

Deprecated "saffron.properties" (in namespaces"saffron" and "net.sf.saffron") - * are also kept here but under "calcite" namespace.

+ * are also kept here but under "calcite" namespace. */ private static final Properties PROPERTIES = loadProperties(); @@ -55,7 +55,7 @@ public final class CalciteSystemProperty { *

When debug mode is activated significantly more information is gathered and printed to * STDOUT. It is most commonly used to print and identify problems in generated java code. Debug * mode is also used to perform more verifications at runtime, which are not performed during - * normal execution.

+ * normal execution. */ public static final CalciteSystemProperty DEBUG = booleanProperty("calcite.debug", false); @@ -98,28 +98,29 @@ public final class CalciteSystemProperty { public static final CalciteSystemProperty ENABLE_STREAM = booleanProperty("calcite.enable.stream", true); - /** - * Whether RexNode digest should be normalized (e.g. call operands ordered). - *

Normalization helps to treat $0=$1 and $1=$0 expressions equal, thus it saves efforts - * on planning.

*/ + /** Whether RexNode digest should be normalized (e.g. call operands ordered). + * + *

Normalization helps to treat $0=$1 and $1=$0 expressions equal, thus it + * saves efforts on planning. */ public static final CalciteSystemProperty ENABLE_REX_DIGEST_NORMALIZE = booleanProperty("calcite.enable.rexnode.digest.normalize", true); /** - * Whether to follow the SQL standard strictly. + * Whether to follow the SQL standard strictly. */ public static final CalciteSystemProperty STRICT = booleanProperty("calcite.strict.sql", false); /** - * Whether to include a GraphViz representation when dumping the state of the Volcano planner. + * Whether to include a GraphViz representation when dumping the state of the + * Volcano planner. */ public static final CalciteSystemProperty DUMP_GRAPHVIZ = booleanProperty("calcite.volcano.dump.graphviz", true); /** - * Whether to include RelSet information when dumping the state of the Volcano - * planner. + * Whether to include RelSet information when dumping the state + * of the Volcano planner. */ public static final CalciteSystemProperty DUMP_SETS = booleanProperty("calcite.volcano.dump.sets", true); @@ -129,7 +130,7 @@ public final class CalciteSystemProperty { * by {@link CalciteConnectionProperty#TOPDOWN_OPT}. * *

Note: Enabling top-down optimization will automatically disable - * the use of AbstractConverter and related rules.

+ * the use of AbstractConverter and related rules. */ public static final CalciteSystemProperty TOPDOWN_OPT = booleanProperty("calcite.planner.topdown.opt", false); @@ -323,7 +324,7 @@ public final class CalciteSystemProperty { * tertiary, identical. * *

It is used in {@link org.apache.calcite.sql.SqlCollation} and - * {@link org.apache.calcite.sql.SqlLiteral#SqlLiteral}.

+ * {@link org.apache.calcite.sql.SqlLiteral#SqlLiteral}. */ // TODO review zabetak: // What happens if a wrong value is specified? @@ -333,43 +334,46 @@ public final class CalciteSystemProperty { /** * The maximum size of the cache of metadata handlers. * - *

A typical value is the number of queries being concurrently prepared multiplied by the - * number of types of metadata.

+ *

A typical value is the number of queries being concurrently prepared + * multiplied by the number of types of metadata. * - *

If the value is less than 0, there is no limit.

+ *

If the value is less than 0, there is no limit. */ public static final CalciteSystemProperty METADATA_HANDLER_CACHE_MAXIMUM_SIZE = intProperty("calcite.metadata.handler.cache.maximum.size", 1000); /** - * The maximum size of the cache used for storing Bindable objects, instantiated via - * dynamically generated Java classes. + * The maximum size of the cache used for storing Bindable objects, + * instantiated via dynamically generated Java classes. * - *

The default value is 0.

+ *

The default value is 0. * - *

The property can take any value between [0, {@link Integer#MAX_VALUE}] inclusive. If the - * value is not valid (or not specified) then the default value is used.

+ *

The property can take any value between [0, {@link Integer#MAX_VALUE}] + * inclusive. If the value is not valid (or not specified) then the default + * value is used. * - *

The cached objects may be quite big so it is suggested to use a rather small cache size - * (e.g., 1000). For the most common use cases a number close to 1000 should be enough to - * alleviate the performance penalty of compiling and loading classes.

+ *

The cached objects may be quite big so it is suggested to use a rather + * small cache size (e.g., 1000). For the most common use cases a number close + * to 1000 should be enough to alleviate the performance penalty of compiling + * and loading classes. * - *

Setting this property to 0 disables the cache.

+ *

Setting this property to 0 disables the cache. */ public static final CalciteSystemProperty BINDABLE_CACHE_MAX_SIZE = intProperty("calcite.bindable.cache.maxSize", 0, v -> v >= 0 && v <= Integer.MAX_VALUE); /** - * The concurrency level of the cache used for storing Bindable objects, instantiated via - * dynamically generated Java classes. + * The concurrency level of the cache used for storing Bindable objects, + * instantiated via dynamically generated Java classes. * - *

The default value is 1.

+ *

The default value is 1. * - *

The property can take any value between [1, {@link Integer#MAX_VALUE}] inclusive. If the - * value is not valid (or not specified) then the default value is used.

+ *

The property can take any value between [1, {@link Integer#MAX_VALUE}] + * inclusive. If the value is not valid (or not specified) then the default + * value is used. * - *

This property has no effect if the cache is disabled (i.e., {@link #BINDABLE_CACHE_MAX_SIZE} - * set to 0.

+ *

This property has no effect if the cache is disabled (i.e., + * {@link #BINDABLE_CACHE_MAX_SIZE} set to 0. */ public static final CalciteSystemProperty BINDABLE_CACHE_CONCURRENCY_LEVEL = intProperty("calcite.bindable.cache.concurrencyLevel", 1, diff --git a/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java b/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java index f1aea7082351..9f9db72dccc4 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java +++ b/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java @@ -527,6 +527,7 @@ public BigDecimal result(BigDecimal accumulator) { /** Common implementation of comparison aggregate methods over numeric * values as a user-defined aggregate. + * * @param The numeric type */ public static class NumericComparison { diff --git a/core/src/main/java/org/apache/calcite/jdbc/CalciteConnection.java b/core/src/main/java/org/apache/calcite/jdbc/CalciteConnection.java index 7706cae4b9bd..d350d46aa2ba 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/CalciteConnection.java +++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteConnection.java @@ -32,18 +32,18 @@ * dynamically. * *

You can start off with an empty connection (no schemas), define one - * or two schemas, and start querying them.

+ * or two schemas, and start querying them. * *

Since a {@code CalciteConnection} implements the linq4j * {@link QueryProvider} interface, you can use a connection to execute - * expression trees as queries.

+ * expression trees as queries. */ public interface CalciteConnection extends Connection, QueryProvider { /** * Returns the root schema. * *

You can define objects (such as relations) in this schema, and - * also nested schemas.

+ * also nested schemas. * * @return Root schema */ @@ -64,7 +64,7 @@ public interface CalciteConnection extends Connection, QueryProvider { * collection is undefined. Some implementations might, for example, see * a modified property, but only if you set it before you create a * statement. We will remove this method when there are better - * implementations of stateful connections and configuration.

+ * implementations of stateful connections and configuration. * * @return properties */ diff --git a/core/src/main/java/org/apache/calcite/jdbc/CalciteSchema.java b/core/src/main/java/org/apache/calcite/jdbc/CalciteSchema.java index 05eee7f33388..b1218c1e4f77 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/CalciteSchema.java +++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteSchema.java @@ -56,7 +56,7 @@ /** * Schema. * - *

Wrapper around user-defined schema used internally.

+ *

Wrapper around user-defined schema used internally. */ public abstract class CalciteSchema { @@ -64,7 +64,7 @@ public abstract class CalciteSchema { public final Schema schema; public final String name; /** Tables explicitly defined in this schema. Does not include tables in - * {@link #schema}. */ + * {@link #schema}. */ protected final NameMap tableMap; protected final NameMultimap functionMap; protected final NameMap typeMap; @@ -447,7 +447,7 @@ public final NavigableMap getTablesBasedOnNullaryFunctions() { * *

Currently, to accommodate the requirement of creating tables on the fly * for materializations, the snapshot will still use the same table map and - * lattice map as in the original CalciteSchema instead of making copies.

+ * lattice map as in the original CalciteSchema instead of making copies. * * @param version The current schema version * @@ -460,6 +460,7 @@ public CalciteSchema createSnapshot(SchemaVersion version) { /** Returns a subset of a map whose keys match the given string * case-insensitively. + * * @deprecated use NameMap */ @Deprecated // to be removed before 2.0 @@ -470,6 +471,7 @@ protected static NavigableMap find(NavigableMap map, /** Returns a subset of a set whose values match the given string * case-insensitively. + * * @deprecated use NameSet */ @Deprecated // to be removed before 2.0 @@ -559,7 +561,7 @@ public boolean removeType(String name) { *

Each object's name is a property of its membership in a schema; * therefore in principle it could belong to several schemas, or * even the same schema several times, with different names. In this - * respect, it is like an inode in a Unix file system.

+ * respect, it is like an inode in a Unix file system. * *

The members of a schema must have unique names. */ diff --git a/core/src/main/java/org/apache/calcite/jdbc/ContextSqlValidator.java b/core/src/main/java/org/apache/calcite/jdbc/ContextSqlValidator.java index 352ce012f47b..df5ebc447568 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/ContextSqlValidator.java +++ b/core/src/main/java/org/apache/calcite/jdbc/ContextSqlValidator.java @@ -40,6 +40,7 @@ public class ContextSqlValidator extends SqlValidatorImpl { /** * Create a {@code ContextSqlValidator}. + * * @param context Prepare context. * @param mutable Whether to get the mutable schema. */ diff --git a/core/src/main/java/org/apache/calcite/jdbc/JavaRecordType.java b/core/src/main/java/org/apache/calcite/jdbc/JavaRecordType.java index 7fbce8696ba3..da86efa81987 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/JavaRecordType.java +++ b/core/src/main/java/org/apache/calcite/jdbc/JavaRecordType.java @@ -29,7 +29,7 @@ * of the class. * *

NOTE: This class is experimental and subject to - * change/removal without notice.

+ * change/removal without notice. */ public class JavaRecordType extends RelRecordType { final Class clazz; diff --git a/core/src/main/java/org/apache/calcite/jdbc/JavaTypeFactoryImpl.java b/core/src/main/java/org/apache/calcite/jdbc/JavaTypeFactoryImpl.java index d689759c75ea..00d256dbf123 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/JavaTypeFactoryImpl.java +++ b/core/src/main/java/org/apache/calcite/jdbc/JavaTypeFactoryImpl.java @@ -57,7 +57,7 @@ * Implementation of {@link JavaTypeFactory}. * *

NOTE: This class is experimental and subject to - * change/removal without notice.

+ * change/removal without notice. */ public class JavaTypeFactoryImpl extends SqlTypeFactoryImpl diff --git a/core/src/main/java/org/apache/calcite/materialize/MaterializationActor.java b/core/src/main/java/org/apache/calcite/materialize/MaterializationActor.java index b01cd7b6cd24..e61bee85978a 100644 --- a/core/src/main/java/org/apache/calcite/materialize/MaterializationActor.java +++ b/core/src/main/java/org/apache/calcite/materialize/MaterializationActor.java @@ -44,8 +44,8 @@ class MaterializationActor { final Map keyByTile = new HashMap<>(); /** Tiles grouped by dimensionality. We use a - * {@link TileKey} with no measures to represent a - * dimensionality. */ + * {@link TileKey} with no measures to represent a + * dimensionality. */ final Multimap tilesByDimensionality = HashMultimap.create(); diff --git a/core/src/main/java/org/apache/calcite/materialize/MaterializationKey.java b/core/src/main/java/org/apache/calcite/materialize/MaterializationKey.java index 3aa39d0007ab..3661a7f45f49 100644 --- a/core/src/main/java/org/apache/calcite/materialize/MaterializationKey.java +++ b/core/src/main/java/org/apache/calcite/materialize/MaterializationKey.java @@ -25,7 +25,7 @@ * Unique identifier for a materialization. * *

It is immutable and can only be created by the - * {@link MaterializationService}. For communicating with the service.

+ * {@link MaterializationService}. For communicating with the service. */ public class MaterializationKey implements Serializable { private final UUID uuid = UUID.randomUUID(); diff --git a/core/src/main/java/org/apache/calcite/materialize/SqlStatisticProvider.java b/core/src/main/java/org/apache/calcite/materialize/SqlStatisticProvider.java index a9baeff7d9e3..f1fc33e5fb0c 100644 --- a/core/src/main/java/org/apache/calcite/materialize/SqlStatisticProvider.java +++ b/core/src/main/java/org/apache/calcite/materialize/SqlStatisticProvider.java @@ -56,6 +56,6 @@ boolean isForeignKey(RelOptTable fromTable, List fromColumns, /** Returns whether a collection of columns is a unique (or primary) key. * *

For example, {@code isKey(EMP, [DEPTNO]} returns true; - *

For example, {@code isKey(DEPT, [DEPTNO]} returns false. */ + * {@code isKey(DEPT, [DEPTNO]} returns false. */ boolean isKey(RelOptTable table, List columns); } diff --git a/core/src/main/java/org/apache/calcite/materialize/package-info.java b/core/src/main/java/org/apache/calcite/materialize/package-info.java index 3a91d9618be3..4939c315ce97 100644 --- a/core/src/main/java/org/apache/calcite/materialize/package-info.java +++ b/core/src/main/java/org/apache/calcite/materialize/package-info.java @@ -22,7 +22,7 @@ * maintains the state of all * materializations in the system and is wrapped in a service * ({@link org.apache.calcite.materialize.MaterializationService}) - * for access from other parts of the system.

+ * for access from other parts of the system. * *

Optimizer rules allow Calcite to rewrite queries using materializations, * if they are valid (that is, contain the same result as executing their diff --git a/core/src/main/java/org/apache/calcite/model/JsonRoot.java b/core/src/main/java/org/apache/calcite/model/JsonRoot.java index 5d6115cebe9f..0ca140e9cca6 100644 --- a/core/src/main/java/org/apache/calcite/model/JsonRoot.java +++ b/core/src/main/java/org/apache/calcite/model/JsonRoot.java @@ -31,9 +31,9 @@ * *

A POJO with fields of {@link Boolean}, {@link String}, {@link ArrayList}, * {@link java.util.LinkedHashMap LinkedHashMap}, per Jackson simple data - * binding.

+ * binding. * - *

Schema structure is as follows:

+ *

Schema structure is as follows: * * *

{@code Root}
diff --git a/core/src/main/java/org/apache/calcite/model/JsonSchema.java b/core/src/main/java/org/apache/calcite/model/JsonSchema.java
index 9b1a7c0396dc..bb820ebf43b7 100644
--- a/core/src/main/java/org/apache/calcite/model/JsonSchema.java
+++ b/core/src/main/java/org/apache/calcite/model/JsonSchema.java
@@ -77,16 +77,16 @@ public abstract class JsonSchema {
    *
    * 

If {@code false}, Calcite will go back to the schema each time it needs * metadata, for example, each time it needs a list of tables in order to - * validate a query against the schema.

+ * validate a query against the schema. * *

If {@code true}, Calcite will cache the metadata the first time it reads * it. This can lead to better performance, especially if name-matching is * case-insensitive - * (see {@link org.apache.calcite.config.Lex#caseSensitive}).

+ * (see {@link org.apache.calcite.config.Lex#caseSensitive}). * *

Tables, functions and sub-schemas explicitly created in a schema are * not affected by this caching mechanism. They always appear in the schema - * immediately, and are never flushed.

+ * immediately, and are never flushed. */ public final @Nullable Boolean cache; diff --git a/core/src/main/java/org/apache/calcite/model/package-info.java b/core/src/main/java/org/apache/calcite/model/package-info.java index 02081d2d3168..fdedb4c3ab8a 100644 --- a/core/src/main/java/org/apache/calcite/model/package-info.java +++ b/core/src/main/java/org/apache/calcite/model/package-info.java @@ -22,13 +22,13 @@ * the JDBC connect string. Calcite loads the model while initializing the * connection. It first parses the JSON, then uses a * {@link org.apache.calcite.model.ModelHandler} as visitor over the parse - * tree.

+ * tree. * *

There are standard implementations of schema and table, but the user can * provide their own by implementing the * {@link org.apache.calcite.schema.SchemaFactory} * or {@link org.apache.calcite.schema.TableFactory} - * interfaces and including a custom schema in the model.

+ * interfaces and including a custom schema in the model. * *

There are several examples of schemas in the * tutorial. diff --git a/core/src/main/java/org/apache/calcite/plan/Convention.java b/core/src/main/java/org/apache/calcite/plan/Convention.java index 797ef063757a..059726b4ed77 100644 --- a/core/src/main/java/org/apache/calcite/plan/Convention.java +++ b/core/src/main/java/org/apache/calcite/plan/Convention.java @@ -30,9 +30,9 @@ public interface Convention extends RelTrait { * convention. It is not implementable, and has to be transformed to * something else in order to be implemented. * - *

Relational expressions generally start off in this form.

+ *

Relational expressions generally start off in this form. * - *

Such expressions always have infinite cost.

+ *

Such expressions always have infinite cost. */ Convention NONE = new Impl("NONE", RelNode.class); diff --git a/core/src/main/java/org/apache/calcite/plan/RelDigest.java b/core/src/main/java/org/apache/calcite/plan/RelDigest.java index 510a91e88145..20dcaddd6b19 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelDigest.java +++ b/core/src/main/java/org/apache/calcite/plan/RelDigest.java @@ -26,7 +26,7 @@ * {@code #equals} and {@code #hashCode}, which are prohibited to override * for RelNode, for legacy reasons. * - *

INTERNAL USE ONLY.

+ *

INTERNAL USE ONLY. */ @API(since = "1.24", status = API.Status.INTERNAL) public interface RelDigest { diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptConnection.java b/core/src/main/java/org/apache/calcite/plan/RelOptConnection.java index 0f64f507974e..4149a8f67ee9 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptConnection.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptConnection.java @@ -20,7 +20,7 @@ * The planner's view of a connection to a database. * *

A connection contains a {@link RelOptSchema}, via which the query planner - * can access {@link RelOptTable} objects.

+ * can access {@link RelOptTable} objects. */ public interface RelOptConnection { /** diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptMaterializations.java b/core/src/main/java/org/apache/calcite/plan/RelOptMaterializations.java index 71246f860d2f..9feb6507d079 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptMaterializations.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptMaterializations.java @@ -54,6 +54,7 @@ public abstract class RelOptMaterializations { * Returns a list of RelNode transformed from all possible combination of * materialized view uses. Big queries will likely have more than one * transformed RelNode, e.g., (t1 group by c1) join (t2 group by c2). + * * @param rel the original RelNode * @param materializations the materialized view list * @return the list of transformed RelNode together with their corresponding @@ -69,6 +70,7 @@ public static List>> useMaterializedVi * materialized view uses. Big queries will likely have more than one * transformed RelNode, e.g., (t1 group by c1) join (t2 group by c2). * In addition, you can add custom materialized view recognition rules. + * * @param rel the original RelNode * @param materializations the materialized view list * @param materializationRules the materialized view recognition rules @@ -106,6 +108,7 @@ public static List>> useMaterializedVi /** * Returns a list of RelNode transformed from all possible lattice uses. + * * @param rel the original RelNode * @param lattices the lattice list * @return the list of transformed RelNode together with their corresponding diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptPlanner.java b/core/src/main/java/org/apache/calcite/plan/RelOptPlanner.java index 1ef793393238..3f1fe01fef1a 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptPlanner.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptPlanner.java @@ -168,7 +168,7 @@ public interface RelOptPlanner { * {@code tableRel} is cheaper to evaluate and therefore if the query being * optimized uses (or can be rewritten to use) {@code queryRel} as a * sub-expression then it can be optimized by using {@code tableRel} - * instead.

+ * instead. */ void addMaterialization(RelOptMaterialization materialization); @@ -280,7 +280,7 @@ RelNode register( * *

Planners which use their own relational expressions internally * to represent concepts such as equivalence classes will generally need to - * supply corresponding metadata providers.

+ * supply corresponding metadata providers. * * @param list receives planner's custom providers, if any */ @@ -303,7 +303,8 @@ RelNode register( * *

When a node is pruned, the related pending rule * calls are cancelled, and future rules will not fire. - * This can be used to reduce the search space.

+ * This can be used to reduce the search space. + * * @param rel the node to prune. */ void prune(RelNode rel); @@ -321,7 +322,7 @@ RelNode register( * default values of any traits that have them. * *

The empty trait set acts as the prototype (a kind of factory) for all - * subsequently created trait sets.

+ * subsequently created trait sets. * * @return Empty trait set */ diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptPredicateList.java b/core/src/main/java/org/apache/calcite/plan/RelOptPredicateList.java index d6f1de5ce184..9045bb589a88 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptPredicateList.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptPredicateList.java @@ -125,6 +125,7 @@ public static RelOptPredicateList of(RexBuilder rexBuilder, /** * Returns true if given predicate list is empty. + * * @param value input predicate list * @return true if all the predicates are empty or if the argument is null */ diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptRule.java b/core/src/main/java/org/apache/calcite/plan/RelOptRule.java index dadf7f4f9535..c9a7280b082a 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptRule.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptRule.java @@ -40,7 +40,7 @@ * applied to a particular section of the tree. * *

The optimizer figures out which rules are applicable, then calls - * {@link #onMatch} on each of them.

+ * {@link #onMatch} on each of them. */ public abstract class RelOptRule { //~ Static fields/initializers --------------------------------------------- @@ -237,10 +237,10 @@ public static RelOptRuleOperand operand( *

Shorthand for operand(clazz, some(...)). * *

If you wish to match a relational expression that has no children - * (that is, a leaf node), write operand(clazz, none())

. + * (that is, a leaf node), write operand(clazz, none()). * *

If you wish to match a relational expression that has any number of - * children, write operand(clazz, any())

. + * children, write operand(clazz, any()). * * @param clazz Class of relational expression to match (must not be null) * @param first First operand @@ -312,20 +312,20 @@ public static RelOptRuleOperandChildren some( * *

This is useful when matching a relational expression which * can have a variable number of children. For example, the rule to - * eliminate empty children of a Union would have operands

+ * eliminate empty children of a Union would have operands * *
Operand(Union, true, Operand(Empty))
* - *

and given the relational expressions

+ *

and given the relational expressions * *

Union(LogicalFilter, Empty, LogicalProject)
* - *

would fire the rule with arguments

+ *

would fire the rule with arguments * *

{Union, Empty}
* *

It is up to the rule to deduce the other children, or indeed the - * position of the matched child.

+ * position of the matched child. * * @param first First child operand * @param rest Remaining child operands (may be empty) @@ -540,7 +540,7 @@ public boolean matches(RelOptRuleCall call) { * *

Typically a rule would check that the nodes are valid matches, creates * a new expression, then calls back {@link RelOptRuleCall#transformTo} to - * register the expression.

+ * register the expression. * * @param call Rule call * @see #matches(RelOptRuleCall) diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperand.java b/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperand.java index 796901236a9c..65d74c60f74c 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperand.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperand.java @@ -34,11 +34,11 @@ * can be applied to a particular expression. * *

For example, the rule to pull a filter up from the left side of a join - * takes operands: Join(Filter, Any).

+ * takes operands: Join(Filter, Any). * *

Note that children means different things if it is empty or * it is null: Join(Filter (), Any) means - * that, to match the rule, Filter must have no operands.

+ * that, to match the rule, Filter must have no operands. */ public class RelOptRuleOperand { //~ Instance fields -------------------------------------------------------- @@ -197,10 +197,10 @@ public void setRule(@UnknownInitialization RelOptRule rule) { * *

To facilitate IDE shows the operand description in the debugger, * returns the root operand description, but highlight current - * operand's matched class with '*' in the description.

+ * operand's matched class with '*' in the description. * *

e.g. The following are examples of rule operand description for - * the operands that match with {@code LogicalFilter}.

+ * the operands that match with {@code LogicalFilter}. * *
    *
  • SemiJoinRule:project: Project(Join(*RelNode*, Aggregate))
  • diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperandChildPolicy.java b/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperandChildPolicy.java index dabba0921362..47ba10b1d130 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperandChildPolicy.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperandChildPolicy.java @@ -32,7 +32,7 @@ public enum RelOptRuleOperandChildPolicy { * *

    {@code RelOptRuleOperand(Foo.class, NONE)} is equivalent to * {@code RelOptRuleOperand(Foo.class)} but we prefer the former because - * it is more explicit.

    + * it is more explicit. */ LEAF, diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptSchema.java b/core/src/main/java/org/apache/calcite/plan/RelOptSchema.java index c130d6854fd5..77527c2e7bd6 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptSchema.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptSchema.java @@ -33,10 +33,10 @@ public interface RelOptSchema { * *

    For example, the Saffron expression salesSchema.emps * would be resolved using a call to salesSchema.getTableForMember(new - * String[]{"emps" }).

    + * String[]{"emps" }). * *

    Note that name.length is only greater than 1 for queries originating - * from JDBC.

    + * from JDBC. * * @param names Qualified name */ diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptTable.java b/core/src/main/java/org/apache/calcite/plan/RelOptTable.java index 1e9929973e75..7fb90677c85a 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptTable.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptTable.java @@ -73,7 +73,7 @@ public interface RelOptTable extends Wrapper { * {@link org.apache.calcite.rel.logical.LogicalTableScan}, * then optimizes this expression by * applying {@link org.apache.calcite.plan.RelOptRule rules} to transform it - * into more efficient access methods for this table.

    + * into more efficient access methods for this table. */ RelNode toRel(ToRelContext context); @@ -132,7 +132,7 @@ public interface RelOptTable extends Wrapper { RelOptTable extend(List extendedFields); /** Returns a list describing how each column is populated. The list has the - * same number of entries as there are fields, and is immutable. */ + * same number of entries as there are fields, and is immutable. */ List getColumnStrategies(); /** Can expand a view into relational expressions. */ diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java b/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java index 1e1df16a2910..fc1d016dd7a2 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java @@ -1461,6 +1461,7 @@ public static RexNode createEquiJoinCondition( /** * Returns {@link SqlOperator} for given {@link SqlKind} or returns {@code operator} * when {@link SqlKind} is not known. + * * @param kind input kind * @param operator default operator value * @return SqlOperator for the given kind @@ -2461,14 +2462,14 @@ public static void decomposeConjunction( * together, and a list of expressions that are preceded by NOT. * *

    For example, {@code a AND NOT b AND NOT (c and d) AND TRUE AND NOT - * FALSE} returns {@code rexList = [a], notList = [b, c AND d]}.

    + * FALSE} returns {@code rexList = [a], notList = [b, c AND d]}. * *

    TRUE and NOT FALSE expressions are ignored. FALSE and NOT TRUE * expressions are placed on {@code rexList} and {@code notList} as other - * expressions.

    + * expressions. * *

    For example, {@code a AND TRUE AND NOT TRUE} returns - * {@code rexList = [a], notList = [TRUE]}.

    + * {@code rexList = [a], notList = [TRUE]}. * * @param rexPredicate predicate to be analyzed * @param rexList list of decomposed RexNodes (except those with NOT) @@ -2548,7 +2549,7 @@ public static void decomposeDisjunction( * Returns a condition decomposed by AND. * *

    For example, {@code conjunctions(TRUE)} returns the empty list; - * {@code conjunctions(FALSE)} returns list {@code {FALSE}}.

    + * {@code conjunctions(FALSE)} returns list {@code {FALSE}}. */ public static List conjunctions(@Nullable RexNode rexPredicate) { final List list = new ArrayList<>(); @@ -2559,7 +2560,7 @@ public static List conjunctions(@Nullable RexNode rexPredicate) { /** * Returns a condition decomposed by OR. * - *

    For example, {@code disjunctions(FALSE)} returns the empty list.

    + *

    For example, {@code disjunctions(FALSE)} returns the empty list. */ public static List disjunctions(RexNode rexPredicate) { final List list = new ArrayList<>(); @@ -3424,7 +3425,7 @@ public static RelNode createProject( * Creates a relational expression that projects the given fields of the * input. * - *

    Optimizes if the fields are the identity projection.

    + *

    Optimizes if the fields are the identity projection. * * @param child Input relational expression * @param posList Source of each projected field @@ -3491,7 +3492,7 @@ public static RelNode createRename( * Creates a relational expression which permutes the output fields of a * relational expression according to a permutation. * - *

    Optimizations:

    + *

    Optimizations: * *

      *
    • If the relational expression is a diff --git a/core/src/main/java/org/apache/calcite/plan/RelTrait.java b/core/src/main/java/org/apache/calcite/plan/RelTrait.java index c410a96d677a..c0e29793e309 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelTrait.java +++ b/core/src/main/java/org/apache/calcite/plan/RelTrait.java @@ -35,7 +35,7 @@ * new RelTrait instances are generated at runtime (e.g. based on state external * to the planner), you must implement {@link #hashCode()} and * {@link #equals(Object)} for proper {@link RelTraitDef#canonize canonization} - * of your RelTrait objects.

      + * of your RelTrait objects. */ public interface RelTrait { //~ Methods ---------------------------------------------------------------- @@ -86,7 +86,7 @@ public interface RelTrait { * Registers a trait instance with the planner. * *

      This is an opportunity to add rules that relate to that trait. However, - * typical implementations will do nothing.

      + * typical implementations will do nothing. * * @param planner Planner */ @@ -96,16 +96,16 @@ public interface RelTrait { * Applies a mapping to this trait. * *

      Some traits may be changed if the columns order is changed by a mapping - * of the {@link Project} operator.

      + * of the {@link Project} operator. * *

      For example, if relation {@code SELECT a, b ORDER BY a, b} is sorted by * columns [0, 1], then the project {@code SELECT b, a} over this relation * will be sorted by columns [1, 0]. In the same time project {@code SELECT b} * will not be sorted at all because it doesn't contain the collation - * prefix and this method will return an empty collation.

      + * prefix and this method will return an empty collation. * *

      Other traits are independent from the columns remapping. For example - * {@link Convention} or {@link RelDistributions#SINGLETON}.

      + * {@link Convention} or {@link RelDistributions#SINGLETON}. * * @param mapping Mapping * @return trait with mapping applied diff --git a/core/src/main/java/org/apache/calcite/plan/RelTraitDef.java b/core/src/main/java/org/apache/calcite/plan/RelTraitDef.java index 74d46e9c1da6..fca993bdb99c 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelTraitDef.java +++ b/core/src/main/java/org/apache/calcite/plan/RelTraitDef.java @@ -47,7 +47,7 @@ * * *

      Otherwise, a new instance of RelTraitDef must be constructed and - * registered with each new planner instantiated.

      + * registered with each new planner instantiated. * * @param Trait that this trait definition is based upon */ @@ -73,7 +73,7 @@ protected RelTraitDef() { * Whether a relational expression may possess more than one instance of * this trait simultaneously. * - *

      A subset has only one instance of a trait.

      + *

      A subset has only one instance of a trait. */ public boolean multiple() { return false; diff --git a/core/src/main/java/org/apache/calcite/plan/Strong.java b/core/src/main/java/org/apache/calcite/plan/Strong.java index e2b67f076222..c0d5cece4c66 100644 --- a/core/src/main/java/org/apache/calcite/plan/Strong.java +++ b/core/src/main/java/org/apache/calcite/plan/Strong.java @@ -39,11 +39,11 @@ /** Utilities for strong predicates. * *

      A predicate is strong (or null-rejecting) with regards to selected subset of inputs - * if it is UNKNOWN if all inputs in selected subset are UNKNOWN.

      + * if it is UNKNOWN if all inputs in selected subset are UNKNOWN. * - *

      By the way, UNKNOWN is just the boolean form of NULL.

      + *

      By the way, UNKNOWN is just the boolean form of NULL. * - *

      Examples:

      + *

      Examples: *

        *
      • {@code UNKNOWN} is strong in [] (definitely null) *
      • {@code c = 1} is strong in [c] (definitely null if and only if c is @@ -133,7 +133,7 @@ public static Policy policy(SqlOperator operator) { /** * Returns whether a given expression is strong. * - *

        Examples:

        + *

        Examples: *

          *
        • Returns true for {@code c = 1} since it returns null if and only if * c is null diff --git a/core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java b/core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java index f631cce3f1e1..9668f4462512 100644 --- a/core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java +++ b/core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java @@ -96,10 +96,10 @@ * *

          The call {@code new SubstitutionVisitor(target, query).go(replacement))} * will return {@code query} with every occurrence of {@code target} replaced - * by {@code replacement}.

          + * by {@code replacement}. * *

          The following example shows how {@code SubstitutionVisitor} can be used - * for materialized view recognition.

          + * for materialized view recognition. * *
            *
          • query = SELECT a, c FROM t WHERE x = 5 AND b = 4
          • @@ -109,10 +109,10 @@ *
          * *

          Note that {@code result} uses the materialized view table {@code mv} and a - * simplified condition {@code b = 4}.

          + * simplified condition {@code b = 4}. * *

          Uses a bottom-up matching algorithm. Nodes do not need to be identical. - * At each level, returns the residue.

          + * At each level, returns the residue. * *

          The inputs must only include the core relational operators: * {@link org.apache.calcite.rel.core.TableScan}, @@ -122,7 +122,7 @@ * {@link org.apache.calcite.rel.core.Join}, * {@link org.apache.calcite.rel.core.Union}, * {@link org.apache.calcite.rel.core.Intersect}, - * {@link org.apache.calcite.rel.core.Aggregate}.

          + * {@link org.apache.calcite.rel.core.Aggregate}. */ public class SubstitutionVisitor { private static final boolean DEBUG = CalciteSystemProperty.DEBUG.value(); @@ -233,17 +233,17 @@ void register(MutableRel result, MutableRel query) { *

          If condition is stronger than target, returns the residue. * If it is equal to target, returns the expression that evaluates to * the constant {@code true}. If it is weaker than target, returns - * {@code null}.

          + * {@code null}. * - *

          The terms satisfy the relation

          + *

          The terms satisfy the relation * *

          *
          {@code condition = target AND residue}
          *
          * - *

          and {@code residue} must be as weak as possible.

          + *

          and {@code residue} must be as weak as possible. * - *

          Example #1: condition stronger than target

          + *

          Example #1: condition stronger than target *

            *
          • condition: x = 1 AND y = 2
          • *
          • target: x = 1
          • @@ -252,24 +252,24 @@ void register(MutableRel result, MutableRel query) { * *

            Note that residue {@code x > 0 AND y = 2} would also satisfy the * relation {@code condition = target AND residue} but is stronger than - * necessary, so we prefer {@code y = 2}.

            + * necessary, so we prefer {@code y = 2}. * *

            Example #2: target weaker than condition (valid, but not currently - * implemented)

            + * implemented) *
              *
            • condition: x = 1
            • *
            • target: x = 1 OR z = 3
            • *
            • residue: x = 1
            • *
            * - *

            Example #3: condition and target are equivalent

            + *

            Example #3: condition and target are equivalent *

              *
            • condition: x = 1 AND y = 2
            • *
            • target: y = 2 AND x = 1
            • *
            • residue: TRUE
            • *
            * - *

            Example #4: condition weaker than target

            + *

            Example #4: condition weaker than target *

              *
            • condition: x = 1
            • *
            • target: x = 1 AND y = 2
            • @@ -280,7 +280,7 @@ void register(MutableRel result, MutableRel query) { * whether {@code condition AND NOT target} can ever evaluate to * true, and therefore is a form of the NP-complete * Satisfiability - * problem.

              + * problem. */ @VisibleForTesting public static @Nullable RexNode splitFilter(final RexSimplify simplify, @@ -426,7 +426,7 @@ private static boolean isEquivalent(RexNode condition, RexNode target) { * *

              This method may give false positives. For instance, it will say * that {@code x = 5 AND x > 10} is satisfiable, because at present it - * cannot prove that it is not.

              + * cannot prove that it is not. */ public static boolean mayBeSatisfiable(RexNode e) { // Example: @@ -862,7 +862,7 @@ protected static class MatchFailed extends ControlFlowException { * against a target relational expression. * *

              The rule declares the query and target types; this allows the - * engine to fire only a few rules in a given context.

              + * engine to fire only a few rules in a given context. */ public abstract static class UnifyRule { protected final int slotCount; @@ -882,7 +882,7 @@ protected UnifyRule(int slotCount, Operand queryOperand, * invoked, Calcite has made sure that query's children are equivalent * to target's children. * - *

              There are 3 possible outcomes:

              + *

              There are 3 possible outcomes: * *

                * @@ -898,7 +898,7 @@ protected UnifyRule(int slotCount, Operand queryOperand, *
              * *

              REVIEW: Is possible that we match query PLUS one or more of its - * ancestors?

              + * ancestors? * * @param call Input parameters */ @@ -1050,7 +1050,7 @@ protected static Operand target(int ordinal) { * *

              Matches scans to the same table, because these will be * {@link MutableScan}s with the same - * {@link org.apache.calcite.rel.core.TableScan} instance.

              + * {@link org.apache.calcite.rel.core.TableScan} instance. */ private static class TrivialRule extends AbstractUnifyRule { private static final TrivialRule INSTANCE = new TrivialRule(); diff --git a/core/src/main/java/org/apache/calcite/plan/visualizer/RuleMatchVisualizer.java b/core/src/main/java/org/apache/calcite/plan/visualizer/RuleMatchVisualizer.java index 4b2c1828b59d..d9e795996dcc 100644 --- a/core/src/main/java/org/apache/calcite/plan/visualizer/RuleMatchVisualizer.java +++ b/core/src/main/java/org/apache/calcite/plan/visualizer/RuleMatchVisualizer.java @@ -373,8 +373,8 @@ public String getJsonStringResult() { /** * Writes the HTML and JS files of the rule match visualization. - *

              - * The old files with the same name will be replaced. + * + *

              The old files with the same name will be replaced. */ public void writeToFile() { if (outputDirectory == null || outputSuffix == null) { diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/AbstractConverter.java b/core/src/main/java/org/apache/calcite/plan/volcano/AbstractConverter.java index 3192f0986b81..23f85c888ec9 100644 --- a/core/src/main/java/org/apache/calcite/plan/volcano/AbstractConverter.java +++ b/core/src/main/java/org/apache/calcite/plan/volcano/AbstractConverter.java @@ -46,7 +46,7 @@ * *

              If an abstract converter cannot be satisfied immediately (because the * source subset is abstract), the set is flagged, so this converter will be - * expanded as soon as a non-abstract relexp is added to the set.

              + * expanded as soon as a non-abstract relexp is added to the set. */ @Value.Enclosing public class AbstractConverter extends ConverterImpl { diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/Dumpers.java b/core/src/main/java/org/apache/calcite/plan/volcano/Dumpers.java index 4664a1943466..44560dde7ec8 100644 --- a/core/src/main/java/org/apache/calcite/plan/volcano/Dumpers.java +++ b/core/src/main/java/org/apache/calcite/plan/volcano/Dumpers.java @@ -57,7 +57,7 @@ private Dumpers() {} * *

              Thus, every relational expression and rule invocation that affected * the final outcome is described in the provenance. This can be useful - * when finding the root cause of "mistakes" in a query plan.

              + * when finding the root cause of "mistakes" in a query plan. * * @param provenanceMap The provenance map * @param root Root relational expression in a tree diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/IterativeRuleQueue.java b/core/src/main/java/org/apache/calcite/plan/volcano/IterativeRuleQueue.java index 81976b4877a9..711f92e31931 100644 --- a/core/src/main/java/org/apache/calcite/plan/volcano/IterativeRuleQueue.java +++ b/core/src/main/java/org/apache/calcite/plan/volcano/IterativeRuleQueue.java @@ -95,7 +95,7 @@ class IterativeRuleQueue extends RuleQueue { /** * Removes the rule match from the head of match list, and returns it. * - *

              Returns {@code null} if there are no more matches.

              + *

              Returns {@code null} if there are no more matches. * *

              Note that the VolcanoPlanner may still decide to reject rule matches * which have become invalid, say if one of their operands belongs to an diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/RelSet.java b/core/src/main/java/org/apache/calcite/plan/volcano/RelSet.java index 1fd6ed9229a2..6d0890e869e8 100644 --- a/core/src/main/java/org/apache/calcite/plan/volcano/RelSet.java +++ b/core/src/main/java/org/apache/calcite/plan/volcano/RelSet.java @@ -52,7 +52,7 @@ * using the expression which has the lowest cost. * *

              All of the expressions in an RelSet have the same calling - * convention.

              + * convention. */ class RelSet { //~ Static fields/initializers --------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/RelSubset.java b/core/src/main/java/org/apache/calcite/plan/volcano/RelSubset.java index 2cb01a390f27..29b26adb366e 100644 --- a/core/src/main/java/org/apache/calcite/plan/volcano/RelSubset.java +++ b/core/src/main/java/org/apache/calcite/plan/volcano/RelSubset.java @@ -160,7 +160,7 @@ public class RelSubset extends AbstractRelNode { * Computes the best {@link RelNode} in this subset. * *

              Only necessary when a subset is created in a set that has subsets that - * subsume it. Rationale:

              + * subsume it. Rationale: * *
                *
              1. If the are no subsuming subsets, the subset is initially empty.
              2. diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/RuleQueue.java b/core/src/main/java/org/apache/calcite/plan/volcano/RuleQueue.java index c608e6966de7..3efe2ec2896d 100644 --- a/core/src/main/java/org/apache/calcite/plan/volcano/RuleQueue.java +++ b/core/src/main/java/org/apache/calcite/plan/volcano/RuleQueue.java @@ -38,6 +38,7 @@ protected RuleQueue(VolcanoPlanner planner) { /** * Add a RuleMatch into the queue. + * * @param match rule match to add */ public abstract void addMatch(VolcanoRuleMatch match); @@ -45,6 +46,7 @@ protected RuleQueue(VolcanoPlanner planner) { /** * clear this rule queue. * The return value indicates whether the rule queue was empty before clear. + * * @return true if the rule queue was not empty */ public abstract boolean clear(); diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleDriver.java b/core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleDriver.java index 02a3a8d9fc0c..821c7e5335ac 100644 --- a/core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleDriver.java +++ b/core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleDriver.java @@ -45,7 +45,7 @@ * *

                This implementation uses tasks to manage rule matches. * A Task is a piece of work to be executed, it may apply some rules - * or schedule other tasks.

                + * or schedule other tasks. */ @SuppressWarnings("JdkObsolete") class TopDownRuleDriver implements RuleDriver { @@ -541,9 +541,7 @@ private class ApplyRule implements GeneratorTask { } } - /** - * Decides how to optimize a physical node. - */ + /** Decides how to optimize a physical node. */ private @Nullable Task getOptimizeInputTask(RelNode rel, RelSubset group) { // If the physical does not in current optimizing RelSubset, it firstly tries to // convert the physical node either by converter rule or traits pass though. diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoCost.java b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoCost.java index f5390282decd..1c0fb6e974ad 100644 --- a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoCost.java +++ b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoCost.java @@ -28,7 +28,7 @@ * VolcanoCost represents the cost of a plan node. * *

                This class is immutable: none of the methods modify any member - * variables.

                + * variables. */ class VolcanoCost implements RelOptCost { //~ Static fields/initializers --------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java index ad57236c476d..4e43d13fa052 100644 --- a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java +++ b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java @@ -103,7 +103,7 @@ public class VolcanoPlanner extends AbstractRelOptPlanner { * *

                Any operand can be an 'entry point' to a rule call, when a RelNode is * registered which matches the operand. This map allows us to narrow down - * operands based on the class of the RelNode.

                + * operands based on the class of the RelNode. */ private final Multimap, RelOptRuleOperand> classOperands = LinkedListMultimap.create(); @@ -128,7 +128,7 @@ public class VolcanoPlanner extends AbstractRelOptPlanner { * {@link RelSet} objects. Most {@link RelNode} objects are identified by * their digest, which involves the set that their child relational * expressions belong to. If those children belong to the same set, we have - * to be careful, otherwise it gets incestuous.

                + * to be careful, otherwise it gets incestuous. */ private final IdentityHashMap mapRel2Subset = new IdentityHashMap<>(); @@ -254,7 +254,7 @@ private void initRuleQueue() { * Enable or disable top-down optimization. * *

                Note: Enabling top-down optimization will automatically enable - * top-down trait propagation.

                + * top-down trait propagation. */ public void setTopDownOpt(boolean value) { if (topDownOpt == value) { @@ -697,6 +697,7 @@ public void registerAbstractRelationalRules() { /** * Sets whether this planner should consider rel nodes with Convention.NONE * to have infinite cost or not. + * * @param infinite Whether to make none convention rel nodes infinite cost */ public void setNoneConventionHasInfiniteCost(boolean infinite) { @@ -705,6 +706,7 @@ public void setNoneConventionHasInfiniteCost(boolean infinite) { /** * Returns cost of a relation or infinite cost if the cost is not known. + * * @param rel relation t * @param mq metadata query * @return cost of the relation or infinite cost if the cost is not known @@ -1514,6 +1516,7 @@ public void setLocked(boolean locked) { /** * Decide whether a rule is logical or not. + * * @param rel The specific rel node * @return True if the relnode is a logical node */ diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/package-info.java b/core/src/main/java/org/apache/calcite/plan/volcano/package-info.java index 15ac0f28f431..24232dc9c9f1 100644 --- a/core/src/main/java/org/apache/calcite/plan/volcano/package-info.java +++ b/core/src/main/java/org/apache/calcite/plan/volcano/package-info.java @@ -16,28 +16,28 @@ */ /** - * Optimizes relational expressions.

                 

                + * Optimizes relational expressions. * *

                Overview

                * *

                A planner (also known as an optimizer) finds the * most efficient implementation of a - * {@link org.apache.calcite.rel.RelNode relational expression}.

                + * {@link org.apache.calcite.rel.RelNode relational expression}. * *

                Interface {@link org.apache.calcite.plan.RelOptPlanner} defines a planner, * and class {@link org.apache.calcite.plan.volcano.VolcanoPlanner} is an * implementation which uses a dynamic programming technique. It is based upon - * the Volcano optimizer [1].

                + * the Volcano optimizer [1]. * *

                Interface {@link org.apache.calcite.plan.RelOptCost} defines a cost * model; class {@link org.apache.calcite.plan.volcano.VolcanoCost} is - * the implementation for a VolcanoPlanner.

                + * the implementation for a VolcanoPlanner. * *

                A {@link org.apache.calcite.plan.volcano.RelSet} is a set of equivalent * relational expressions. They are equivalent because they will produce the * same result for any set of input data. It is an equivalence class: two * expressions are in the same set if and only if they are in the same - * RelSet.

                + * RelSet. * *

                One of the unique features of the optimizer is that expressions can take * on a variety of physical traits. Each relational expression has a set of @@ -48,7 +48,7 @@ * data. {@link org.apache.calcite.plan.ConventionTraitDef} defines the trait * and {@link org.apache.calcite.plan.Convention} enumerates the * protocols. Every relational expression has a single calling convention by - * which it returns its results. Some examples:

                + * which it returns its results. Some examples: * *
                  *
                • {@link org.apache.calcite.adapter.jdbc.JdbcConvention} is a fairly @@ -78,7 +78,7 @@ *
                • *
                * - *

                New traits are added to the planner in one of two ways:

                + *

                New traits are added to the planner in one of two ways: *

                  *
                1. If the new trait is integral to Calcite, then each and every * implementation of {@link org.apache.calcite.rel.RelNode} should include @@ -102,12 +102,12 @@ * type and quantity of traits in their trait set. In either case, the new * RelTraitDef implementation must be * {@link org.apache.calcite.plan.volcano.VolcanoPlanner#addRelTraitDef(org.apache.calcite.plan.RelTraitDef)} - * registered with the planner.

                  + * registered with the planner. * *

                  A {@link org.apache.calcite.plan.volcano.RelSubset} is a subset of a * RelSet containing expressions which are equivalent and which * have the same Convention. Like RelSet, it is an - * equivalence class.

                  + * equivalence class. * *

                  Related packages

                  *
                    @@ -118,13 +118,11 @@ * *

                    Details

                    * - *

                    ...

                    - * *

                    Sets merge when the result of a rule already exists in another set. This * implies that all of the expressions are equivalent. The RelSets are - * merged, and so are the contained RelSubsets.

                    + * merged, and so are the contained RelSubsets. * - *

                    Expression registration.

                    + *

                    Expression registration. *

                      *
                    • Expression is added to a set. We may find that an equivalent * expression already exists. Otherwise, this is the moment when an @@ -139,31 +137,31 @@ * expression is registered
                    • *
                    * - *

                    Algorithm

                    + *

                    Algorithm * - *

                    To optimize a relational expression R:

                    + *

                    To optimize a relational expression R: * - *

                    1. Register R.

                    + *

                    1. Register R. * - *

                    2. Create rule-calls for all applicable rules.

                    + *

                    2. Create rule-calls for all applicable rules. * - *

                    3. Rank the rule calls by importance.

                    + *

                    3. Rank the rule calls by importance. * - *

                    4. Call the most important rule

                    + *

                    4. Call the most important rule * - *

                    5. Repeat.

                    + *

                    5. Repeat. * *

                    Importance. A rule-call is important if it is likely to produce * better implementation of a relexp on the plan's critical path. Hence (a) * it produces a member of an important RelSubset, (b) its children are - * cheap.

                    + * cheap. * *

                    Conversion. Conversions are difficult because we have to work backwards - * from the goal.

                    + * from the goal. * - *

                    Rule triggering

                    + *

                    Rule triggering * - *

                    The rules are:

                    + *

                    The rules are: *

                      *
                    1. PushFilterThroughProjectRule. Operands: *
                      @@ -182,7 +180,7 @@ *

                      A rule can be triggered by a change to any of its operands. Consider the * rule to combine two filters into one. It would have operands [Filter * [Filter]]. If I register a new Filter, it will trigger the rule in 2 - * places. Consider:

                      + * places. Consider: * *
                      *
                      Project (deptno)                              [exp 1, subset A]
                      @@ -191,7 +189,9 @@
                        *       Project (deptno, gender, empno, salary) [exp 4, subset D]
                        *         TableScan (emp)                       [exp 0, subset X]
                      *
                      - *

                      Apply PushFilterThroughProjectRule to [exp 2, exp 3]:

                      + * + *

                      Apply PushFilterThroughProjectRule to [exp 2, exp 3]: + * *

                      *
                      Project (deptno)                              [exp 1, subset A]
                        *   Project (deptno, gender, empno)             [exp 5, subset B]
                      @@ -202,11 +202,11 @@
                        *
                        * 

                      Two new expressions are created. Expression 5 is in subset B (because it * is equivalent to expression 2), and expression 6 is in a new equivalence - * class, subset E.

                      + * class, subset E. * *

                      The products of a applying a rule can trigger a cascade of rules. Even in * this simple system (2 rules and 4 initial expressions), two more rules - * are triggered:

                      + * are triggered: * *
                        * @@ -239,16 +239,17 @@ * non-singleton subsets are now A {1, 7}, B {2, 5} and E {6, 8}, and new * combinations are possible. For example, * CombineProjectsRule(exp 7, exp 8) further reduces the depth - * of the tree to:

                        + * of the tree to: * *
                        *
                        Project (deptno)                          [exp 10, subset A]
                          *   Filter (gender='F')                     [exp 9, subset F]
                          *     TableScan (emp)                       [exp 0, subset X]
                        *
                        - *

                        Todo: show how rules can cause subsets to merge.

                        * - *

                        Conclusion:

                        + *

                        Todo: show how rules can cause subsets to merge. + * + *

                        Conclusion: *

                          *
                        1. A rule can be triggered by any of its operands.
                        2. *
                        3. If a subset is a child of more than one parent, it can trigger rule @@ -266,6 +267,6 @@ * Volcano Optimizer * Generator: Extensibility and Efficient Search - Goetz Graefe, William J. * McKenna - * (1993).

                          + * (1993). */ package org.apache.calcite.plan.volcano; diff --git a/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java b/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java index d9655a7f7a6e..2323029f19c3 100644 --- a/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java +++ b/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java @@ -141,7 +141,7 @@ * *

                          This class is public so that projects that create their own JDBC driver * and server can fine-tune preferences. However, this class and its methods are - * subject to change without notice.

                          + * subject to change without notice. */ public class CalcitePrepareImpl implements CalcitePrepare { @@ -413,14 +413,14 @@ protected RelOptCluster createCluster(RelOptPlanner planner, * *

                          The collection must have at least one factory, and each factory must * create a planner. If the collection has more than one planner, Calcite will - * try each planner in turn.

                          + * try each planner in turn. * *

                          One of the things you can do with this mechanism is to try a simpler, * faster, planner with a smaller rule set first, then fall back to a more - * complex planner for complex and costly queries.

                          + * complex planner for complex and costly queries. * *

                          The default implementation returns a factory that calls - * {@link #createPlanner(org.apache.calcite.jdbc.CalcitePrepare.Context)}.

                          + * {@link #createPlanner(org.apache.calcite.jdbc.CalcitePrepare.Context)}. */ protected List> createPlannerFactories() { return Collections.singletonList( @@ -952,8 +952,8 @@ public R perform(CalciteServerStatement statement, /** Holds state for the process of preparing a SQL statement. * - *

                          Overload this class and {@link #createSqlValidator} to provide desired SqlValidator - * and custom validation logic.

                          + *

                          Overload this class and {@link #createSqlValidator} to provide desired + * SqlValidator and custom validation logic. */ public static class CalcitePreparingStmt extends Prepare implements RelOptTable.ViewExpander { @@ -973,8 +973,8 @@ public static class CalcitePreparingStmt extends Prepare /** Constructor. * - *

                          Overload this constructor and {@link #createSqlValidator} to provide desired - * SqlValidaor and custom validation logic.

                          + *

                          Overload this constructor and {@link #createSqlValidator} to provide + * desired SqlValidator and custom validation logic. */ public CalcitePreparingStmt(CalcitePrepareImpl prepare, Context context, diff --git a/core/src/main/java/org/apache/calcite/prepare/QueryableRelBuilder.java b/core/src/main/java/org/apache/calcite/prepare/QueryableRelBuilder.java index 4731e029ddcb..1835555c7156 100644 --- a/core/src/main/java/org/apache/calcite/prepare/QueryableRelBuilder.java +++ b/core/src/main/java/org/apache/calcite/prepare/QueryableRelBuilder.java @@ -70,17 +70,17 @@ *

                          Each of the methods that implements a {@code Replayer} method creates * a tree of {@code RelNode}s equivalent to the arguments, and calls * {@link #setRel} to assign the root of that tree to the {@link #rel} member - * variable.

                          + * variable. * *

                          To comply with the {@link org.apache.calcite.linq4j.QueryableFactory} * interface, which is after all a factory, each method returns a dummy result * such as {@code null} or {@code 0}. * The caller will not use the result. * The real effect of the method is to - * call {@link #setRel} with a {@code RelNode}.

                          + * call {@link #setRel} with a {@code RelNode}. * *

                          NOTE: Many methods currently throw {@link UnsupportedOperationException}. - * These method need to be implemented.

                          + * These method need to be implemented. * * @param Element type */ diff --git a/core/src/main/java/org/apache/calcite/rel/AbstractRelNode.java b/core/src/main/java/org/apache/calcite/rel/AbstractRelNode.java index 53e6d95911b3..37d12c0528a0 100644 --- a/core/src/main/java/org/apache/calcite/rel/AbstractRelNode.java +++ b/core/src/main/java/org/apache/calcite/rel/AbstractRelNode.java @@ -349,7 +349,7 @@ public RelWriter explainTerms(RelWriter pw) { * This should work well for most cases. If this method is a performance * bottleneck for your project, or the default behavior can't handle * your scenario properly, you can choose to override this method and - * {@link #deepHashCode()}. See {@code LogicalJoin} as an example.

                          + * {@link #deepHashCode()}. See {@code LogicalJoin} as an example. * * @return Whether the 2 RelNodes are equivalent or have the same digest. * @see #deepHashCode() @@ -460,10 +460,10 @@ private class InnerRelDigest implements RelDigest { /** * A writer object used exclusively for computing the digest of a RelNode. * - *

                          The writer is meant to be used only for computing a single digest and then thrown away. - * After calling {@link #done(RelNode)} the writer should be used only to obtain the computed - * {@link #digest}. Any other action is prohibited.

                          - * + *

                          The writer is meant to be used only for computing a single digest and + * then thrown away. After calling {@link #done(RelNode)} the writer should + * be used only to obtain the computed {@link #digest}. Any other action is + * prohibited. */ private static final class RelDigestWriter implements RelWriter { diff --git a/core/src/main/java/org/apache/calcite/rel/InvalidRelException.java b/core/src/main/java/org/apache/calcite/rel/InvalidRelException.java index 36bf29bed04c..f71e0a5e1389 100644 --- a/core/src/main/java/org/apache/calcite/rel/InvalidRelException.java +++ b/core/src/main/java/org/apache/calcite/rel/InvalidRelException.java @@ -24,7 +24,7 @@ * {@link RelNode} when given parameters it cannot accept. For example, * {@code EnumerableJoinRel} can only implement equi-joins, so its constructor * throws {@code InvalidRelException} when given the condition - * {@code input0.x - input1.y = 2}.

                          + * {@code input0.x - input1.y = 2}. * *

                          Because the exception is checked (i.e. extends {@link Exception} but not * {@link RuntimeException}), constructors that throw this exception will @@ -32,11 +32,11 @@ * those relational expressions will need to handle it. Usually a rule will * not take the exception personally, and will fail to match. The burden of * checking is removed from the rule, which means less code for the author of - * the rule to maintain.

                          + * the rule to maintain. * *

                          The caller that receives an {@code InvalidRelException} (typically a rule * attempting to create a relational expression) should log it at - * the DEBUG level.

                          + * the DEBUG level. */ public class InvalidRelException extends Exception { /** diff --git a/core/src/main/java/org/apache/calcite/rel/PhysicalNode.java b/core/src/main/java/org/apache/calcite/rel/PhysicalNode.java index 8e32b9509e34..e90cffb04fb6 100644 --- a/core/src/main/java/org/apache/calcite/rel/PhysicalNode.java +++ b/core/src/main/java/org/apache/calcite/rel/PhysicalNode.java @@ -32,7 +32,7 @@ * Physical node in a planner that is capable of doing * physical trait propagation and derivation. * - *

                          How to use?

                          + *

                          How to use? * *

                            *
                          1. Enable top-down optimization by setting @@ -94,8 +94,8 @@ public interface PhysicalNode extends RelNode { * Pass required traitset from parent node to child nodes, * returns a pair of traits after traits is passed down. * - *

                            Pair.left: the new traitset - *

                            Pair.right: the list of required traitsets for child nodes + *

                            Pair.left: the new traitset; + * Pair.right: the list of required traitsets for child nodes. */ default @Nullable Pair> passThroughTraits( RelTraitSet required) { @@ -127,8 +127,8 @@ public interface PhysicalNode extends RelNode { * Derive traitset from child node, returns a pair of traits after * traits derivation. * - *

                            Pair.left: the new traitset - *

                            Pair.right: the list of required traitsets for child nodes + *

                            Pair.left: the new traitset; + * Pair.right: the list of required traitsets for child nodes. */ default @Nullable Pair> deriveTraits( RelTraitSet childTraits, int childId) { diff --git a/core/src/main/java/org/apache/calcite/rel/RelCollationTraitDef.java b/core/src/main/java/org/apache/calcite/rel/RelCollationTraitDef.java index 7dce4d7c3288..d60864362bc2 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelCollationTraitDef.java +++ b/core/src/main/java/org/apache/calcite/rel/RelCollationTraitDef.java @@ -36,7 +36,7 @@ * LogicalTableScan(table=TIME_BY_DAY) might be sorted by * {the_year, the_month, the_date} and also by * {time_id}. We have to allow a RelNode to belong to more than - * one RelSubset (these RelSubsets are always in the same set).

                            + * one RelSubset (these RelSubsets are always in the same set). */ public class RelCollationTraitDef extends RelTraitDef { public static final RelCollationTraitDef INSTANCE = diff --git a/core/src/main/java/org/apache/calcite/rel/RelDistribution.java b/core/src/main/java/org/apache/calcite/rel/RelDistribution.java index 2c9320ffc72a..5708571cc78c 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelDistribution.java +++ b/core/src/main/java/org/apache/calcite/rel/RelDistribution.java @@ -24,7 +24,7 @@ /** * Description of the physical distribution of a relational expression. * - *

                            TBD:

                            + *

                            TBD: *

                              *
                            • Can we shorten {@link Type#HASH_DISTRIBUTED} to HASH, etc.
                            • *
                            • Do we need {@link RelDistributions}.DEFAULT?
                            • diff --git a/core/src/main/java/org/apache/calcite/rel/RelNode.java b/core/src/main/java/org/apache/calcite/rel/RelNode.java index a97b283977e0..bee62a8a316b 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelNode.java +++ b/core/src/main/java/org/apache/calcite/rel/RelNode.java @@ -47,11 +47,11 @@ * Sort, Join, Project, Filter, Scan, Sample. * *

                              A relational expression is not a scalar expression; see - * {@link org.apache.calcite.sql.SqlNode} and {@link RexNode}.

                              + * {@link org.apache.calcite.sql.SqlNode} and {@link RexNode}. * *

                              If this type of relational expression has some particular planner rules, * it should implement the public static method - * {@link AbstractRelNode#register}.

                              + * {@link AbstractRelNode#register}. * *

                              When a relational expression comes to be implemented, the system allocates * a {@link org.apache.calcite.plan.RelImplementor} to manage the process. Every @@ -61,7 +61,7 @@ * relational expression, but may contain other traits, including some applied * externally. Because traits can be applied externally, implementations of * RelNode should never assume the size or contents of their trait set (beyond - * those traits configured by the RelNode itself).

                              + * those traits configured by the RelNode itself). * *

                              For each calling-convention, there is a corresponding sub-interface of * RelNode. For example, @@ -69,17 +69,17 @@ * has operations to manage the conversion to a graph of * {@code org.apache.calcite.adapter.enumerable.EnumerableConvention} * calling-convention, and it interacts with a - * {@code EnumerableRelImplementor}.

                              + * {@code EnumerableRelImplementor}. * *

                              A relational expression is only required to implement its * calling-convention's interface when it is actually implemented, that is, * converted into a plan/program. This means that relational expressions which * cannot be implemented, such as converters, are not required to implement - * their convention's interface.

                              + * their convention's interface. * *

                              Every relational expression must derive from {@link AbstractRelNode}. (Why * have the RelNode interface, then? We need a root interface, - * because an interface can only derive from an interface.)

                              + * because an interface can only derive from an interface.) */ public interface RelNode extends RelOptNode, Cloneable { //~ Methods ---------------------------------------------------------------- @@ -292,7 +292,7 @@ default String explain() { * Deep equality check for RelNode digest. * *

                              By default this method collects digest attributes from - * explain terms, then compares each attribute pair.

                              + * explain terms, then compares each attribute pair. * * @return Whether the 2 RelNodes are equivalent or have the same digest. * @see #deepHashCode() @@ -382,7 +382,7 @@ RelNode copy( *

                              The planner calls this method this first time that it sees a * relational expression of this class. The derived class should call * {@link org.apache.calcite.plan.RelOptPlanner#addRule} for each rule, and - * then call {@code super.register}.

                              + * then call {@code super.register}. * * @param planner Planner to be used to register additional relational * expressions diff --git a/core/src/main/java/org/apache/calcite/rel/RelWriter.java b/core/src/main/java/org/apache/calcite/rel/RelWriter.java index 8caf38c4d46b..17b44227f0ea 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelWriter.java +++ b/core/src/main/java/org/apache/calcite/rel/RelWriter.java @@ -27,7 +27,7 @@ * Callback for an expression to dump itself to. * *

                              It is used for generating EXPLAIN PLAN output, and also for serializing - * a tree of relational expressions to JSON.

                              + * a tree of relational expressions to JSON. */ public interface RelWriter { /** @@ -37,7 +37,7 @@ public interface RelWriter { * {@link org.apache.calcite.rel.RelNode#explain(RelWriter)}. * Each sub-class of {@link org.apache.calcite.rel.RelNode} * calls {@link #input(String, org.apache.calcite.rel.RelNode)} - * and {@link #item(String, Object)} to declare term-value pairs.

                              + * and {@link #item(String, Object)} to declare term-value pairs. * * @param rel Relational expression * @param valueList List of term-value pairs diff --git a/core/src/main/java/org/apache/calcite/rel/convert/Converter.java b/core/src/main/java/org/apache/calcite/rel/convert/Converter.java index 19b1c61bce0e..cc0eaa8ee72d 100644 --- a/core/src/main/java/org/apache/calcite/rel/convert/Converter.java +++ b/core/src/main/java/org/apache/calcite/rel/convert/Converter.java @@ -30,7 +30,7 @@ * *

                              Sometimes this conversion is expensive; for example, to convert a * non-distinct to a distinct object stream, we have to clone every object in - * the input.

                              + * the input. * *

                              A converter does not change the logical expression being evaluated; after * conversion, the number of rows and the values of those rows will still be the @@ -44,7 +44,7 @@ * relational expression). In which case, the method {@link #getInputTraits()} * would return a {@link org.apache.calcite.plan.RelTraitSet}. But for * simplicity, this class only allows one trait to be converted at a - * time; all other traits are assumed to be preserved.

                              + * time; all other traits are assumed to be preserved. */ public interface Converter extends RelNode { //~ Methods ---------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/rel/convert/ConverterRule.java b/core/src/main/java/org/apache/calcite/rel/convert/ConverterRule.java index c512e2973341..240d143d99c8 100644 --- a/core/src/main/java/org/apache/calcite/rel/convert/ConverterRule.java +++ b/core/src/main/java/org/apache/calcite/rel/convert/ConverterRule.java @@ -157,7 +157,7 @@ private static String createDescription(String descriptionPrefix, * of the input convention. * *

                              The union-to-java converter, for example, is not guaranteed, because - * it only works on unions.

                              + * it only works on unions. * * @return {@code true} if this rule can convert any relational * expression diff --git a/core/src/main/java/org/apache/calcite/rel/core/Collect.java b/core/src/main/java/org/apache/calcite/rel/core/Collect.java index d5b1e4588db3..6d5d06a2cf14 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/Collect.java +++ b/core/src/main/java/org/apache/calcite/rel/core/Collect.java @@ -38,7 +38,7 @@ /** * A relational expression that collapses multiple rows into one. * - *

                              Rules:

                              + *

                              Rules: * *

                                *
                              • {@link org.apache.calcite.rel.rules.SubQueryRemoveRule} diff --git a/core/src/main/java/org/apache/calcite/rel/core/Filter.java b/core/src/main/java/org/apache/calcite/rel/core/Filter.java index dbe44e4df05e..14b4b2fcc27f 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/Filter.java +++ b/core/src/main/java/org/apache/calcite/rel/core/Filter.java @@ -53,7 +53,7 @@ * true. * *

                                If the condition allows nulls, then a null value is treated the same as - * false.

                                + * false. * * @see org.apache.calcite.rel.logical.LogicalFilter */ diff --git a/core/src/main/java/org/apache/calcite/rel/core/Join.java b/core/src/main/java/org/apache/calcite/rel/core/Join.java index 0e461cd7839c..dc99bfbfe049 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/Join.java +++ b/core/src/main/java/org/apache/calcite/rel/core/Join.java @@ -259,7 +259,7 @@ protected int deepHashCode0() { * {@code SemiJoin} via * {@link org.apache.calcite.rel.rules.JoinAddRedundantSemiJoinRule}. * - *

                                The base implementation returns false.

                                + *

                                The base implementation returns false. * * @return whether this join has already spawned a semi join */ diff --git a/core/src/main/java/org/apache/calcite/rel/core/JoinInfo.java b/core/src/main/java/org/apache/calcite/rel/core/JoinInfo.java index 7b17978df794..e8f20f009a97 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/JoinInfo.java +++ b/core/src/main/java/org/apache/calcite/rel/core/JoinInfo.java @@ -39,7 +39,7 @@ * *

                                You can create one using {@link #of}, or call * {@link Join#analyzeCondition()}; many kinds of join cache their - * join info, especially those that are equi-joins.

                                + * join info, especially those that are equi-joins. * * @see Join#analyzeCondition() */ public class JoinInfo { diff --git a/core/src/main/java/org/apache/calcite/rel/core/Sort.java b/core/src/main/java/org/apache/calcite/rel/core/Sort.java index 6297def22382..750d27753ab2 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/Sort.java +++ b/core/src/main/java/org/apache/calcite/rel/core/Sort.java @@ -244,7 +244,7 @@ public abstract Sort copy(RelTraitSet traitSet, RelNode newInput, * the_year, the_month because of a known monotonicity * constraint among the columns. {@code getCollation} would return * [time_id] and {@code collations} would return - * [ [time_id], [the_year, the_month] ].

                                + * [ [time_id], [the_year, the_month] ]. */ public RelCollation getCollation() { return collation; diff --git a/core/src/main/java/org/apache/calcite/rel/core/SortExchange.java b/core/src/main/java/org/apache/calcite/rel/core/SortExchange.java index 0c005e13119a..9b1653e8659e 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/SortExchange.java +++ b/core/src/main/java/org/apache/calcite/rel/core/SortExchange.java @@ -97,7 +97,7 @@ public abstract SortExchange copy(RelTraitSet traitSet, RelNode newInput, * the_year, the_month because of a known monotonicity * constraint among the columns. {@code getCollation} would return * [time_id] and {@code collations} would return - * [ [time_id], [the_year, the_month] ].

                                + * [ [time_id], [the_year, the_month] ]. */ public RelCollation getCollation() { return collation; diff --git a/core/src/main/java/org/apache/calcite/rel/core/TableScan.java b/core/src/main/java/org/apache/calcite/rel/core/TableScan.java index 423cb2023066..2a1c498a441e 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/TableScan.java +++ b/core/src/main/java/org/apache/calcite/rel/core/TableScan.java @@ -137,7 +137,7 @@ public ImmutableIntList identity() { * {@link RelBuilder#project(Iterable)} method. * *

                                Sub-classes, representing table types that have these capabilities, - * should override.

                                + * should override. * * @param fieldsUsed Bitmap of the fields desired by the consumer * @param extraFields Extra fields, not advertised in the table's row-type, diff --git a/core/src/main/java/org/apache/calcite/rel/core/Window.java b/core/src/main/java/org/apache/calcite/rel/core/Window.java index 437944f0c593..8cdaa90fff4b 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/Window.java +++ b/core/src/main/java/org/apache/calcite/rel/core/Window.java @@ -189,6 +189,7 @@ public static RelCollation getCollation( /** * Returns constants that are additional inputs of current relation. + * * @return constants that are additional inputs of current relation */ public List getConstants() { @@ -340,6 +341,7 @@ public RelCollation collation() { * Returns if the window is guaranteed to have rows. * This is useful to refine data type of window aggregates. * For instance sum(non-nullable) over (empty window) is NULL. + * * @return true when the window is non-empty * @see org.apache.calcite.sql.SqlWindow#isAlwaysNonEmpty() * @see org.apache.calcite.sql.SqlOperatorBinding#getGroupCount() diff --git a/core/src/main/java/org/apache/calcite/rel/externalize/RelDotWriter.java b/core/src/main/java/org/apache/calcite/rel/externalize/RelDotWriter.java index 74d82d78ed42..07bd57b796de 100644 --- a/core/src/main/java/org/apache/calcite/rel/externalize/RelDotWriter.java +++ b/core/src/main/java/org/apache/calcite/rel/externalize/RelDotWriter.java @@ -212,6 +212,7 @@ private void explainInputs(List inputs) { /** * Format the label into multiple lines according to the options. + * * @param label the original label. * @param limit the maximal length of the formatted label. * -1 means no limit. diff --git a/core/src/main/java/org/apache/calcite/rel/hint/CompositeHintPredicate.java b/core/src/main/java/org/apache/calcite/rel/hint/CompositeHintPredicate.java index 1015ef710312..143e4a7fd1e0 100644 --- a/core/src/main/java/org/apache/calcite/rel/hint/CompositeHintPredicate.java +++ b/core/src/main/java/org/apache/calcite/rel/hint/CompositeHintPredicate.java @@ -44,7 +44,7 @@ public enum Composition { * *

                                Make this constructor package-protected intentionally. * Use utility methods in {@link HintPredicates} - * to create a {@link CompositeHintPredicate}.

                                + * to create a {@link CompositeHintPredicate}. */ CompositeHintPredicate(Composition composition, HintPredicate... predicates) { assert predicates != null; diff --git a/core/src/main/java/org/apache/calcite/rel/logical/LogicalCalc.java b/core/src/main/java/org/apache/calcite/rel/logical/LogicalCalc.java index 2ab47e5c2fcb..7d3bccf7fc9a 100644 --- a/core/src/main/java/org/apache/calcite/rel/logical/LogicalCalc.java +++ b/core/src/main/java/org/apache/calcite/rel/logical/LogicalCalc.java @@ -51,7 +51,7 @@ * stages of optimization, by merging consecutive {@link LogicalProject} and * {@link LogicalFilter} nodes together. * - *

                                The following rules relate to LogicalCalc:

                                + *

                                The following rules relate to LogicalCalc: * *

                                  *
                                • {@link FilterToCalcRule} creates this from a {@link LogicalFilter} diff --git a/core/src/main/java/org/apache/calcite/rel/logical/LogicalCorrelate.java b/core/src/main/java/org/apache/calcite/rel/logical/LogicalCorrelate.java index 2929f03208a0..5db859a14117 100644 --- a/core/src/main/java/org/apache/calcite/rel/logical/LogicalCorrelate.java +++ b/core/src/main/java/org/apache/calcite/rel/logical/LogicalCorrelate.java @@ -53,6 +53,7 @@ public final class LogicalCorrelate extends Correlate { /** * Creates a LogicalCorrelate. + * * @param cluster cluster this relational expression belongs to * @param left left input relational expression * @param right right input relational expression diff --git a/core/src/main/java/org/apache/calcite/rel/logical/LogicalProject.java b/core/src/main/java/org/apache/calcite/rel/logical/LogicalProject.java index 2cfe9e0b9c86..c1db7f223b81 100644 --- a/core/src/main/java/org/apache/calcite/rel/logical/LogicalProject.java +++ b/core/src/main/java/org/apache/calcite/rel/logical/LogicalProject.java @@ -122,6 +122,7 @@ public LogicalProject(RelInput input) { /** * Creates a LogicalProject. + * * @deprecated Use {@link #create(RelNode, List, List, List, Set)} instead */ @Deprecated // to be removed before 2.0 @@ -145,6 +146,7 @@ public static LogicalProject create(final RelNode input, List hints, /** * Creates a LogicalProject, specifying row type rather than field names. + * * @deprecated Use {@link #create(RelNode, List, List, RelDataType, Set)} instead */ @Deprecated // to be removed before 2.0 diff --git a/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableScan.java b/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableScan.java index 07157d01979f..7424c007b8e1 100644 --- a/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableScan.java +++ b/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableScan.java @@ -41,13 +41,13 @@ * possible to read all of the rows unless some narrowing constraint is applied. * *

                                  In the example of the net.sf.saffron.ext.ReflectSchema - * schema,

                                  + * schema, * *
                                  *
                                  select from fields
                                  *
                                  * - *

                                  cannot be implemented, but

                                  + *

                                  cannot be implemented, but * *

                                  *
                                  select from fields as f
                                  @@ -55,7 +55,7 @@
                                    * 
                                  * *

                                  can. It is the optimizer's responsibility to find these ways, by applying - * transformation rules.

                                  + * transformation rules. */ public final class LogicalTableScan extends TableScan { //~ Constructors ----------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/ChainedRelMetadataProvider.java b/core/src/main/java/org/apache/calcite/rel/metadata/ChainedRelMetadataProvider.java index 5377b06bc610..acfc83bda18a 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/ChainedRelMetadataProvider.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/ChainedRelMetadataProvider.java @@ -39,7 +39,7 @@ * *

                                  When a consumer calls the {@link #apply} method to ask for a provider * for a particular type of {@link RelNode} and {@link Metadata}, scans the list - * of underlying providers.

                                  + * of underlying providers. */ public class ChainedRelMetadataProvider implements RelMetadataProvider { //~ Instance fields -------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/Metadata.java b/core/src/main/java/org/apache/calcite/rel/metadata/Metadata.java index af4767e2a75a..cf7bb3e24321 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/Metadata.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/Metadata.java @@ -32,7 +32,7 @@ *

                                  A {@code Metadata} instance already knows which particular {@code RelNode} * it is describing, so the methods do not pass in the {@code RelNode}. In fact, * quite a few metadata methods have no extra parameters. For instance, you can - * get the row-count as follows:

                                  + * get the row-count as follows: * *
                                  
                                    * RelNode rel;
                                  diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactory.java b/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactory.java
                                  index b773e822c873..157d6a3e7566 100644
                                  --- a/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactory.java
                                  +++ b/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactory.java
                                  @@ -24,11 +24,11 @@
                                    * Source of metadata about relational expressions.
                                    *
                                    * 

                                  The metadata is typically various kinds of statistics used to estimate - * costs.

                                  + * costs. * *

                                  Each kind of metadata has an interface that extends {@link Metadata} and * has a method. Some examples: {@link BuiltInMetadata.Selectivity}, - * {@link BuiltInMetadata.ColumnUniqueness}.

                                  + * {@link BuiltInMetadata.ColumnUniqueness}. */ public interface MetadataFactory { /** Returns a metadata interface to get a particular kind of metadata diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactoryImpl.java b/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactoryImpl.java index c78d34a30671..c0f725af29be 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactoryImpl.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/MetadataFactoryImpl.java @@ -35,7 +35,7 @@ * *

                                  The cache does not store metadata. It remembers which providers can * provide which kinds of metadata, for which kinds of relational - * expressions.

                                  + * expressions. * * @deprecated Use {@link RelMetadataQuery}. */ diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/MetadataHandlerProvider.java b/core/src/main/java/org/apache/calcite/rel/metadata/MetadataHandlerProvider.java index c709f6dbfc79..51dfa86fc611 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/MetadataHandlerProvider.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/MetadataHandlerProvider.java @@ -28,6 +28,7 @@ public interface MetadataHandlerProvider { /** * Provide a handler for the requested metadata class. + * * @param handlerClass The handler interface expected * @param The metadata type the handler relates to. * @return The handler implementation. diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/ProxyingMetadataHandlerProvider.java b/core/src/main/java/org/apache/calcite/rel/metadata/ProxyingMetadataHandlerProvider.java index 9c84cbf32347..ecba433ac493 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/ProxyingMetadataHandlerProvider.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/ProxyingMetadataHandlerProvider.java @@ -44,6 +44,7 @@ public class ProxyingMetadataHandlerProvider implements MetadataHandlerProvider /** * Create a proxying handler provider. + * * @param provider The provider this will operate against. */ public ProxyingMetadataHandlerProvider(RelMetadataProvider provider) { diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/ReflectiveRelMetadataProvider.java b/core/src/main/java/org/apache/calcite/rel/metadata/ReflectiveRelMetadataProvider.java index ab01fc2b2c64..cb775d8380b0 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/ReflectiveRelMetadataProvider.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/ReflectiveRelMetadataProvider.java @@ -56,7 +56,7 @@ * the same signature as the implemented metadata method except for an * additional first parameter of type {@link RelNode} or a sub-class. That * parameter gives this provider an indication of that relational expressions it - * can handle.

                                  + * can handle. * *

                                  For an example, see {@link RelMdColumnOrigins#SOURCE}. */ @@ -101,7 +101,7 @@ protected ReflectiveRelMetadataProvider( * *

                                  For example, {@link BuiltInMetadata.Selectivity} has a method * {@link BuiltInMetadata.Selectivity#getSelectivity(RexNode)}. - * A class

                                  + * A class * *
                                  
                                      * class RelMdSelectivity {
                                  @@ -111,7 +111,7 @@ protected ReflectiveRelMetadataProvider(
                                      *
                                      * 

                                  provides implementations of selectivity for relational expressions * that extend {@link org.apache.calcite.rel.core.Union} - * or {@link org.apache.calcite.rel.core.Filter}.

                                  + * or {@link org.apache.calcite.rel.core.Filter}. */ @Deprecated // to be removed before 2.0 public static RelMetadataProvider reflectiveSource(Method method, diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdCollation.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdCollation.java index f68c54339aa8..815968d03102 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdCollation.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdCollation.java @@ -457,6 +457,7 @@ public static Ordering> comparator( * *

                                  If the inputs are sorted on other keys in addition to the join * key, the result preserves those collations too. + * * @deprecated Use {@link #mergeJoin(RelMetadataQuery, RelNode, RelNode, ImmutableIntList, ImmutableIntList, JoinRelType)} */ @Deprecated // to be removed before 2.0 public static @Nullable List mergeJoin(RelMetadataQuery mq, diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdExpressionLineage.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdExpressionLineage.java index 16215e7c0b92..1b34451111d6 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdExpressionLineage.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdExpressionLineage.java @@ -396,6 +396,7 @@ protected RelMdExpressionLineage() {} /** * Expression lineage from Snapshot. + * * @param rel Snapshot relational expression * @param mq metadata query * @param outputExpression expression which needs to be inferred diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPredicates.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPredicates.java index 96a7b0d2cc0c..e1302639c2ef 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPredicates.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPredicates.java @@ -530,6 +530,7 @@ public RelOptPredicateList getPredicates(Exchange exchange, * Returns the * {@link BuiltInMetadata.Predicates#getPredicates()} * statistic. + * * @see RelMetadataQuery#getPulledUpPredicates(RelNode) */ public RelOptPredicateList getPredicates(RelSubset r, RelMetadataQuery mq) { diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdUtil.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdUtil.java index 36b2c3ded1ce..696daa77db0d 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdUtil.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdUtil.java @@ -638,7 +638,7 @@ public static void splitCols( return numDistinctVals(population, mq.getRowCount(join)); } - /** Add an epsilon to the value passed in. **/ + /** Add an epsilon to the value passed in. */ public static double addEpsilon(double d) { assert d >= 0d; final double d0 = d; diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataProvider.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataProvider.java index 57c0eb9bbaf6..f9a4e5d1f8b8 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataProvider.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataProvider.java @@ -46,9 +46,9 @@ public interface RelMetadataProvider { * of relational expression. * *

                                  The object returned is a function. It can be applied to a relational - * expression of the given type to create a metadata object.

                                  + * expression of the given type to create a metadata object. * - *

                                  For example, you might call

                                  + *

                                  For example, you might call * *

                                      * RelMetadataProvider provider;
                                  diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQuery.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQuery.java
                                  index 63976f7b3f85..b1ff4495e76b 100644
                                  --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQuery.java
                                  +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQuery.java
                                  @@ -118,6 +118,7 @@ protected RelMetadataQuery() {
                                   
                                     /**
                                      * Create a RelMetadataQuery with a given {@link MetadataHandlerProvider}.
                                  +   *
                                      * @param provider The provider to use for construction.
                                      */
                                     public RelMetadataQuery(MetadataHandlerProvider provider) {
                                  diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQueryBase.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQueryBase.java
                                  index 8b936b318cca..37a2e5a127f4 100644
                                  --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQueryBase.java
                                  +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQueryBase.java
                                  @@ -125,6 +125,7 @@ private MetadataHandlerProvider getMetadataHandlerProvider() {
                                   
                                     /**
                                      * Provide a handler for the requested metadata class.
                                  +   *
                                      * @param handlerClass The handler interface expected
                                      * @param  The metadata type the handler relates to.
                                      * @return The handler implementation.
                                  diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/janino/CacheGeneratorUtil.java b/core/src/main/java/org/apache/calcite/rel/metadata/janino/CacheGeneratorUtil.java
                                  index 9a0aa8ca8dcc..262a7c7e23a9 100644
                                  --- a/core/src/main/java/org/apache/calcite/rel/metadata/janino/CacheGeneratorUtil.java
                                  +++ b/core/src/main/java/org/apache/calcite/rel/metadata/janino/CacheGeneratorUtil.java
                                  @@ -160,15 +160,14 @@ private static StringBuilder newDescriptiveCacheKey(StringBuilder buff,
                                      */
                                     private enum CacheKeyStrategy {
                                       /**
                                  -     * Generates an immutable method key, then during each call instantiates a new list to all
                                  -     * the arguments.
                                  +     * Generates an immutable method key, then during each call instantiates a
                                  +     * new list to all the arguments.
                                        *
                                  -     * Example:
                                  -     * 
                                  -     *     private final Object method_key_0 =
                                  -     *        new org.apache.calcite.rel.metadata.janino.DescriptiveCacheKey("...");
                                  +     * 

                                  Example: * - * ... + *

                                  {@code
                                  +     *   private final Object method_key_0 =
                                  +     *       new org.apache.calcite.rel.metadata.janino.DescriptiveCacheKey("...");
                                        *
                                        *   public java.lang.Double getDistinctRowCount(
                                        *       org.apache.calcite.rel.RelNode r,
                                  @@ -176,12 +175,14 @@ private enum CacheKeyStrategy {
                                        *       org.apache.calcite.util.ImmutableBitSet a2,
                                        *       org.apache.calcite.rex.RexNode a3) {
                                        *     final Object key;
                                  -     *     key = org.apache.calcite.runtime.FlatLists.of(method_key_0, org.apache.calcite.rel
                                  -     * .metadata.NullSentinel.mask(a2), a3);
                                  +     *     key = org.apache.calcite.runtime.FlatLists.of(method_key_0,
                                  +     *         org.apache.calcite.rel.metadata.NullSentinel.mask(a2), a3);
                                        *     final Object v = mq.map.get(r, key);
                                        *     if (v != null) {
                                  -     *      ...
                                  -     * 
                                  +     *       ...
                                  +     *     }
                                  +     *   }
                                  +     * }
                                  */ DEFAULT { @Override void cacheProperties(StringBuilder buff, Method method, int methodIndex) { @@ -315,17 +316,17 @@ private StringBuilder safeArgList(StringBuilder buff, Method method) { } }, /** - * Generates 2 immutable keys for functions that only take a single boolean arg. + * Generates 2 immutable keys for functions that only take a single boolean + * arg. * - * Example: - * - * private final Object method_key_0True = + *

                                  Example: + * + *

                                  {@code
                                  +     *   private final Object method_key_0True =
                                        *       new org.apache.calcite.rel.metadata.janino.DescriptiveCacheKey("...");
                                        *   private final Object method_key_0False =
                                        *       new org.apache.calcite.rel.metadata.janino.DescriptiveCacheKey("...");
                                        *
                                  -     *   ...
                                  -     *
                                        *   public java.util.Set getUniqueKeys(
                                        *       org.apache.calcite.rel.RelNode r,
                                        *       org.apache.calcite.rel.metadata.RelMetadataQuery mq,
                                  @@ -334,7 +335,8 @@ private StringBuilder safeArgList(StringBuilder buff, Method method) {
                                        *     key = a2 ? method_key_0True : method_key_0False;
                                        *     final Object v = mq.map.get(r, key);
                                        *     ...
                                  -     * 
                                  +     *   }
                                  +     * }
                                  */ BOOLEAN_ARG { @Override void cacheKeyBlock(StringBuilder buff, Method method, int methodIndex) { diff --git a/core/src/main/java/org/apache/calcite/rel/mutable/MutableRel.java b/core/src/main/java/org/apache/calcite/rel/mutable/MutableRel.java index f61eb52e16ea..1bbb849b82fc 100644 --- a/core/src/main/java/org/apache/calcite/rel/mutable/MutableRel.java +++ b/core/src/main/java/org/apache/calcite/rel/mutable/MutableRel.java @@ -39,7 +39,7 @@ * than their {@code RelNode} counterparts. * But, you don't need to copy a {@code MutableRel} in order to change it. * For this reason, you should use {@code MutableRel} for short-lived - * operations, and transcribe back to {@code RelNode} when you are done.

                                  + * operations, and transcribe back to {@code RelNode} when you are done. */ public abstract class MutableRel { diff --git a/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java b/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java index 1f5fa0fca055..f04a5a11cfe4 100644 --- a/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java +++ b/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java @@ -532,7 +532,7 @@ protected boolean isAnon() { } /** Wraps a node in a SELECT statement that has no clauses: - * "SELECT ... FROM (node)". */ + * "SELECT ... FROM (node)". */ SqlSelect wrapSelect(SqlNode node) { assert node instanceof SqlJoin || node instanceof SqlIdentifier diff --git a/core/src/main/java/org/apache/calcite/rel/rules/AbstractJoinExtractFilterRule.java b/core/src/main/java/org/apache/calcite/rel/rules/AbstractJoinExtractFilterRule.java index 93bc014afa4b..ad3c3a6a8ab8 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/AbstractJoinExtractFilterRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/AbstractJoinExtractFilterRule.java @@ -34,7 +34,7 @@ * the FennelCartesianJoinRule applicable. * *

                                  The constructor is parameterized to allow any sub-class of - * {@link org.apache.calcite.rel.core.Join}.

                                  + * {@link org.apache.calcite.rel.core.Join}. */ public abstract class AbstractJoinExtractFilterRule extends RelRule diff --git a/core/src/main/java/org/apache/calcite/rel/rules/AggregateJoinRemoveRule.java b/core/src/main/java/org/apache/calcite/rel/rules/AggregateJoinRemoveRule.java index 2440cfbb7579..f4c6c4b97c24 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/AggregateJoinRemoveRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/AggregateJoinRemoveRule.java @@ -45,7 +45,7 @@ * provided that the join is a left join or right join and it computes no * aggregate functions or all the aggregate calls have distinct. * - *

                                  For instance,

                                  + *

                                  For instance, * *

                                  *
                                  select distinct s.product_id from
                                  diff --git a/core/src/main/java/org/apache/calcite/rel/rules/CoreRules.java b/core/src/main/java/org/apache/calcite/rel/rules/CoreRules.java
                                  index 074bb4f6350d..54ad1ae8cd43 100644
                                  --- a/core/src/main/java/org/apache/calcite/rel/rules/CoreRules.java
                                  +++ b/core/src/main/java/org/apache/calcite/rel/rules/CoreRules.java
                                  @@ -417,7 +417,7 @@ private CoreRules() {}
                                         SubQueryRemoveRule.Config.JOIN.toRule();
                                   
                                     /** Rule that transforms a {@link Project}
                                  -   *  into a mixture of {@code LogicalProject}
                                  +   * into a mixture of {@code LogicalProject}
                                      * and {@link LogicalWindow}. */
                                     public static final ProjectToWindowRule.ProjectToLogicalProjectAndWindowRule
                                         PROJECT_TO_LOGICAL_PROJECT_AND_WINDOW =
                                  @@ -471,7 +471,7 @@ private CoreRules() {}
                                         ProjectMultiJoinMergeRule.Config.DEFAULT.toRule();
                                   
                                     /** Rule that, given a {@link Project} node that merely returns its input,
                                  -   *  converts the node into its input. */
                                  +   * converts the node into its input. */
                                     public static final ProjectRemoveRule PROJECT_REMOVE =
                                         ProjectRemoveRule.Config.DEFAULT.toRule();
                                   
                                  diff --git a/core/src/main/java/org/apache/calcite/rel/rules/FilterFlattenCorrelatedConditionRule.java b/core/src/main/java/org/apache/calcite/rel/rules/FilterFlattenCorrelatedConditionRule.java
                                  index d625fd32ad12..391ac86e7b6d 100644
                                  --- a/core/src/main/java/org/apache/calcite/rel/rules/FilterFlattenCorrelatedConditionRule.java
                                  +++ b/core/src/main/java/org/apache/calcite/rel/rules/FilterFlattenCorrelatedConditionRule.java
                                  @@ -33,21 +33,24 @@
                                   import java.util.List;
                                   
                                   /**
                                  - * Planner rule that matches a {@link Filter} expression with correlated variables, and rewrites the
                                  - * condition in a simpler form that is more convenient for the decorrelation logic.
                                  + * Planner rule that matches a {@link Filter} expression with correlated
                                  + * variables, and rewrites the condition in a simpler form that is more
                                  + * convenient for the decorrelation logic.
                                    *
                                  - * 

                                  Uncorrelated calls below a comparison operator are turned into input references by extracting - * the computation in a {@link org.apache.calcite.rel.core.Project} expression. An additional - * projection may be added on top of the new filter to retain expression equivalence.

                                  + *

                                  Uncorrelated calls below a comparison operator are turned into input + * references by extracting the computation in a + * {@link org.apache.calcite.rel.core.Project} expression. An additional + * projection may be added on top of the new filter to retain expression + * equivalence. * - *

                                  Sub-plan before

                                  + *

                                  Sub-plan before *

                                    * LogicalProject($f0=[true])
                                    *   LogicalFilter(condition=[=($cor0.DEPTNO, +($7, 30))])
                                    *     LogicalTableScan(table=[[CATALOG, SALES, EMP]])
                                    * 
                                  * - *

                                  Sub-plan after

                                  + *

                                  Sub-plan after *

                                    * LogicalProject($f0=[true])
                                    *   LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2],..., COMM=[$6], DEPTNO=[$7], SLACKER=[$8])
                                  @@ -56,10 +59,11 @@
                                    *         LogicalTableScan(table=[[CATALOG, SALES, EMP]])
                                    * 
                                  * - *

                                  The rule should be used in conjunction with other rules and transformations to have a positive - * impact on the plan. At the moment it is tightly connected with the decorrelation logic and may - * not be useful in a broader context. Projects may implement decorrelation differently so they may - * choose to use this rule or not.

                                  + *

                                  The rule should be used in conjunction with other rules and + * transformations to have a positive impact on the plan. At the moment it is + * tightly connected with the decorrelation logic and may not be useful in a + * broader context. Projects may implement decorrelation differently so they may + * choose to use this rule or not. */ @API(since = "1.27", status = API.Status.EXPERIMENTAL) @Value.Enclosing diff --git a/core/src/main/java/org/apache/calcite/rel/rules/FilterJoinRule.java b/core/src/main/java/org/apache/calcite/rel/rules/FilterJoinRule.java index b66c0cd484f9..f9b64bc1ce5d 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/FilterJoinRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/FilterJoinRule.java @@ -237,7 +237,7 @@ protected void perform(RelOptRuleCall call, @Nullable Filter filter, /** * Infers more equal conditions for the join condition. * - *

                                  For example, in {@code SELECT * FROM T1, T2, T3 WHERE T1.id = T3.id AND T2.id = T3.id}, + *

                                  For example, in {@code SELECT * FROM T1, T2, T3 WHERE T1.id = T3.id AND T2.id = T3.id}, * we can infer {@code T1.id = T2.id} for the first Join node from second Join node's condition: * {@code T1.id = T3.id AND T2.id = T3.id}. * diff --git a/core/src/main/java/org/apache/calcite/rel/rules/IntersectToDistinctRule.java b/core/src/main/java/org/apache/calcite/rel/rules/IntersectToDistinctRule.java index ab6b6fb03c12..35d359bd8b73 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/IntersectToDistinctRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/IntersectToDistinctRule.java @@ -40,7 +40,7 @@ * {@link org.apache.calcite.rel.core.Union}, * {@link org.apache.calcite.rel.core.Aggregate}, etc. * - *

                                  Rewrite: (GB-Union All-GB)-GB-UDTF (on all attributes) + *

                                  Rewrite: (GB-Union All-GB)-GB-UDTF (on all attributes) * *

                                  Example

                                  * diff --git a/core/src/main/java/org/apache/calcite/rel/rules/JoinAssociateRule.java b/core/src/main/java/org/apache/calcite/rel/rules/JoinAssociateRule.java index 66b18c4a4f52..373040699158 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/JoinAssociateRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/JoinAssociateRule.java @@ -38,7 +38,7 @@ /** * Planner rule that changes a join based on the associativity rule. * - *

                                  ((a JOIN b) JOIN c) → (a JOIN (b JOIN c))

                                  + *

                                  ((a JOIN b) JOIN c) → (a JOIN (b JOIN c)) * *

                                  We do not need a rule to convert (a JOIN (b JOIN c)) → * ((a JOIN b) JOIN c) because we have diff --git a/core/src/main/java/org/apache/calcite/rel/rules/JoinCommuteRule.java b/core/src/main/java/org/apache/calcite/rel/rules/JoinCommuteRule.java index 541c31f95595..f95d4b122ed3 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/JoinCommuteRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/JoinCommuteRule.java @@ -189,7 +189,7 @@ public JoinCommuteRule(Class clazz, *

                                  If the field index is less than leftFieldCount, it must be from the * left, and so has rightFieldCount added to it; if the field index is * greater than leftFieldCount, it must be from the right, so we subtract - * leftFieldCount from it.

                                  + * leftFieldCount from it. */ private static class VariableReplacer extends RexShuttle { private final RexBuilder rexBuilder; diff --git a/core/src/main/java/org/apache/calcite/rel/rules/JoinPushThroughJoinRule.java b/core/src/main/java/org/apache/calcite/rel/rules/JoinPushThroughJoinRule.java index be1ad08f09d0..c020bffbb77c 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/JoinPushThroughJoinRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/JoinPushThroughJoinRule.java @@ -61,7 +61,7 @@ * on p.product_class_id = pc.product_class_id
                                  * *

                                  Before the rule, one join has two conditions and the other has none - * ({@code ON TRUE}). After the rule, each join has one condition.

                                  + * ({@code ON TRUE}). After the rule, each join has one condition. */ @Value.Enclosing public class JoinPushThroughJoinRule diff --git a/core/src/main/java/org/apache/calcite/rel/rules/JoinToCorrelateRule.java b/core/src/main/java/org/apache/calcite/rel/rules/JoinToCorrelateRule.java index 296433e356e7..49c2428996f5 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/JoinToCorrelateRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/JoinToCorrelateRule.java @@ -41,16 +41,16 @@ * into a {@link org.apache.calcite.rel.logical.LogicalCorrelate}, which can * then be implemented using nested loops. * - *

                                  For example,

                                  + *

                                  For example, * *

                                  select * from emp join dept on emp.deptno = * dept.deptno
                                  * *

                                  becomes a Correlator which restarts LogicalTableScan("DEPT") for each - * row read from LogicalTableScan("EMP").

                                  + * row read from LogicalTableScan("EMP"). * *

                                  This rule is not applicable if for certain types of outer join. For - * example,

                                  + * example, * *
                                  select * from emp right join dept on emp.deptno = * dept.deptno
                                  diff --git a/core/src/main/java/org/apache/calcite/rel/rules/JoinToMultiJoinRule.java b/core/src/main/java/org/apache/calcite/rel/rules/JoinToMultiJoinRule.java index 4504e0ceabb5..c07b8ea302f2 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/JoinToMultiJoinRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/JoinToMultiJoinRule.java @@ -101,7 +101,7 @@ * *

                                  The constructor is parameterized to allow any sub-class of * {@link org.apache.calcite.rel.core.Join}, not just - * {@link org.apache.calcite.rel.logical.LogicalJoin}.

                                  + * {@link org.apache.calcite.rel.logical.LogicalJoin}. * * @see org.apache.calcite.rel.rules.FilterMultiJoinMergeRule * @see org.apache.calcite.rel.rules.ProjectMultiJoinMergeRule diff --git a/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinOptimizeBushyRule.java b/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinOptimizeBushyRule.java index ab2044ecd641..755df10ab2b3 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinOptimizeBushyRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinOptimizeBushyRule.java @@ -320,9 +320,9 @@ int chooseBestEdge(List edges, /** Returns the index within a list at which compares least according to a * comparator. * - *

                                  In the case of a tie, returns the earliest such element.

                                  + *

                                  In the case of a tie, returns the earliest such element. * - *

                                  If the list is empty, returns -1.

                                  + *

                                  If the list is empty, returns -1. */ static int minPos(List list, Comparator fn) { if (list.isEmpty()) { diff --git a/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinProjectTransposeRule.java b/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinProjectTransposeRule.java index 4a27b65be375..832b522ceda8 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinProjectTransposeRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinProjectTransposeRule.java @@ -43,9 +43,10 @@ * *

                                  For example, if we have the following sub-query: * - *

                                  - * (select X.x1, Y.y1 from X, Y
                                  - *  where X.x2 = Y.y2 and X.x3 = 1 and Y.y3 = 2)
                                  + *
                                  {@code
                                  + *   (select X.x1, Y.y1
                                  + *    from X, Y
                                  + *    where X.x2 = Y.y2 and X.x3 = 1 and Y.y3 = 2)}
                                  * *

                                  The {@link MultiJoin} associated with (X, Y) associates x1 with X and * y1 with Y. Although x3 and y3 need to be read due to the filters, they are diff --git a/core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinJoinRemoveRule.java b/core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinJoinRemoveRule.java index e59641ff0670..f88f54a17bc6 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinJoinRemoveRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinJoinRemoveRule.java @@ -43,7 +43,7 @@ * on a {@link org.apache.calcite.rel.core.Join} and removes the left input * of the join provided that the left input is also a left join if possible. * - *

                                  For instance,

                                  + *

                                  For instance, * *

                                  *
                                  select s.product_id, pc.product_id
                                  diff --git a/core/src/main/java/org/apache/calcite/rel/rules/ProjectRemoveRule.java b/core/src/main/java/org/apache/calcite/rel/rules/ProjectRemoveRule.java
                                  index b298f4a48cc0..551cae2086e5 100644
                                  --- a/core/src/main/java/org/apache/calcite/rel/rules/ProjectRemoveRule.java
                                  +++ b/core/src/main/java/org/apache/calcite/rel/rules/ProjectRemoveRule.java
                                  @@ -31,7 +31,7 @@
                                    * merely returns its input, converts the node into its child.
                                    *
                                    * 

                                  For example, Project(ArrayReader(a), {$input0}) becomes - * ArrayReader(a).

                                  + * ArrayReader(a). * * @see CalcRemoveRule * @see ProjectMergeRule diff --git a/core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java b/core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java index b32d6525fe5e..ff208a9ccdaf 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java @@ -262,6 +262,7 @@ private static boolean isEmpty(RelNode node) { /** * Rule that converts a {@link Correlate} to empty if its right child is empty. + * *

                                  Examples: *

                                    *
                                  • Correlate(Scan(Emp), Empty, INNER) becomes Empty
                                  • @@ -282,16 +283,19 @@ private static boolean isEmpty(RelNode node) { /** * Rule that converts a relation into empty. - *

                                    - * The users can control the application of the rule by:

                                    + * + *

                                    The users can control the application of the rule by: + * *

                                      - *
                                    • calling the appropriate constructor and passing the necessary configuration;
                                    • - *
                                    • extending the class through inheritance and overriding - * {@link RemoveEmptySingleRule#matches(RelOptRuleCall)}).
                                    • + *
                                    • calling the appropriate constructor and passing the necessary + * configuration; + * + *
                                    • extending the class through inheritance and overriding + * {@link RemoveEmptySingleRule#matches(RelOptRuleCall)}). *
                                    * - *

                                    When using the deprecated constructors it is only possible to convert relations - * which strictly have a single input ({@link SingleRel}).

                                    */ + *

                                    When using the deprecated constructors it is only possible to convert + * relations which strictly have a single input ({@link SingleRel}). */ public static class RemoveEmptySingleRule extends PruneEmptyRule { /** Creates a RemoveEmptySingleRule. */ RemoveEmptySingleRule(PruneEmptyRule.Config config) { diff --git a/core/src/main/java/org/apache/calcite/rel/rules/PushProjector.java b/core/src/main/java/org/apache/calcite/rel/rules/PushProjector.java index 6ac717d7a678..d3717d6cb668 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/PushProjector.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/PushProjector.java @@ -68,7 +68,7 @@ *

                                    Sometimes an expression needs to be split before it can be pushed down. * To flag that an expression cannot be split, specify a rule that it must be * preserved. Such an expression will be pushed down intact to one - * of the inputs, or not pushed down at all.

                                    + * of the inputs, or not pushed down at all. */ public class PushProjector { //~ Instance fields -------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/rel/rules/SubstitutionRule.java b/core/src/main/java/org/apache/calcite/rel/rules/SubstitutionRule.java index 6f720fa8bd2c..edc3e764aec4 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/SubstitutionRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/SubstitutionRule.java @@ -29,7 +29,7 @@ public interface SubstitutionRule extends TransformationRule { * there is at least 1 equivalent rel generated by the rule. * *

                                    Default is false, the user needs to prune the old node - * manually in the rule.

                                    + * manually in the rule. */ default boolean autoPruneOld() { return false; diff --git a/core/src/main/java/org/apache/calcite/rel/rules/TransformationRule.java b/core/src/main/java/org/apache/calcite/rel/rules/TransformationRule.java index e5095be2f646..df35febca84d 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/TransformationRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/TransformationRule.java @@ -31,7 +31,7 @@ *

                                    But in {@link VolcanoPlanner}, {@link TransformationRule} doesn't match * with physical operator that implements {@link PhysicalNode}. It is not * allowed to generate physical operators in {@link TransformationRule}, - * unless you are using it in {@link HepPlanner}.

                                    + * unless you are using it in {@link HepPlanner}. * * @see VolcanoPlanner * @see SubstitutionRule diff --git a/core/src/main/java/org/apache/calcite/rel/rules/ValuesReduceRule.java b/core/src/main/java/org/apache/calcite/rel/rules/ValuesReduceRule.java index eedc22b52414..488e10fe9c1a 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/ValuesReduceRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/ValuesReduceRule.java @@ -54,12 +54,12 @@ *

                                    Returns a simplified {@code Values}, perhaps containing zero tuples * if all rows are filtered away. * - *

                                    For example,

                                    + *

                                    For example, * *

                                    select a - b from (values (1, 2), (3, 5), (7, 11)) as t (a, * b) where a + b > 4
                                    * - *

                                    becomes

                                    + *

                                    becomes * *

                                    select x from (values (-2), (-4))
                                    * diff --git a/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewRule.java b/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewRule.java index e2aa969c4ab0..4a7f101e230e 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewRule.java @@ -506,6 +506,7 @@ protected abstract boolean isValidPlan(@Nullable Project topProject, RelNode nod * *

                                    Rules implementing the method should follow different approaches depending on the * operators they rewrite. + * * @return ViewPartialRewriting, or null if the rewrite can't be done */ protected abstract @Nullable ViewPartialRewriting compensateViewPartial( diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelCrossType.java b/core/src/main/java/org/apache/calcite/rel/type/RelCrossType.java index f39f2b67737a..5423676b6492 100644 --- a/core/src/main/java/org/apache/calcite/rel/type/RelCrossType.java +++ b/core/src/main/java/org/apache/calcite/rel/type/RelCrossType.java @@ -26,7 +26,7 @@ * Type of the cartesian product of two or more sets of records. * *

                                    Its fields are those of its constituent records, but unlike a - * {@link RelRecordType}, those fields' names are not necessarily distinct.

                                    + * {@link RelRecordType}, those fields' names are not necessarily distinct. */ public class RelCrossType extends RelDataTypeImpl { //~ Instance fields -------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelDataType.java b/core/src/main/java/org/apache/calcite/rel/type/RelDataType.java index 60df7f16e70a..437a2a0f85ca 100644 --- a/core/src/main/java/org/apache/calcite/rel/type/RelDataType.java +++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataType.java @@ -92,7 +92,7 @@ public interface RelDataType { /** * Looks up a field by name. * - *

                                    NOTE: Be careful choosing the value of {@code caseSensitive}:

                                    + *

                                    NOTE: Be careful choosing the value of {@code caseSensitive}: *

                                      *
                                    • If the field name was supplied by an end-user (e.g. as a column alias * in SQL), use your session's case-sensitivity setting.
                                    • @@ -173,7 +173,7 @@ public interface RelDataType { * for an INTEGER type. * *

                                      Returns {@link #PRECISION_NOT_SPECIFIED} (-1) if precision is not - * applicable for this type.

                                      + * applicable for this type. * * @return number of decimal digits for exact numeric types; number of * decimal digits in mantissa for approximate numeric types; number of diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java index cf24db0b1baf..da1b3c399a54 100644 --- a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java +++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java @@ -240,7 +240,7 @@ RelDataType createTypeWithCharsetAndCollation( /** * Creates a SQL type that represents the "unknown" type. * It is only equal to itself, and is distinct from the NULL type. - + * * @return unknown type */ RelDataType createUnknownType(); diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactoryImpl.java b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactoryImpl.java index bdf963f207ff..87a1e5045272 100644 --- a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactoryImpl.java +++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactoryImpl.java @@ -443,7 +443,7 @@ protected RelDataType canonize(final RelDataType type) { * *

                                      This approach allows us to use a cheap temporary key. A permanent * key is more expensive, because it must be immutable and not hold - * references into other data structures.

                                      + * references into other data structures. */ protected RelDataType canonize(final StructKind kind, final List names, diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java index 274a6b72c8c0..9891ee304aa1 100644 --- a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java +++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeImpl.java @@ -47,7 +47,7 @@ * {@link RelDataType}. * *

                                      Identity is based upon the {@link #digest} field, which each derived class - * should set during construction.

                                      + * should set during construction. */ public abstract class RelDataTypeImpl implements RelDataType, RelDataTypeFamily { @@ -358,7 +358,7 @@ public static RelProtoDataType proto(final RelDataType protoType) { * that will create a type {@code typeName}. * *

                                      For example, {@code proto(SqlTypeName.DATE), false} - * will create {@code DATE NOT NULL}.

                                      + * will create {@code DATE NOT NULL}. * * @param typeName Type name * @param nullable Whether nullable @@ -377,7 +377,7 @@ public static RelProtoDataType proto(final SqlTypeName typeName, * that will create a type {@code typeName(precision)}. * *

                                      For example, {@code proto(SqlTypeName.VARCHAR, 100, false)} - * will create {@code VARCHAR(100) NOT NULL}.

                                      + * will create {@code VARCHAR(100) NOT NULL}. * * @param typeName Type name * @param precision Precision @@ -397,7 +397,7 @@ public static RelProtoDataType proto(final SqlTypeName typeName, * that will create a type {@code typeName(precision, scale)}. * *

                                      For example, {@code proto(SqlTypeName.DECIMAL, 7, 2, false)} - * will create {@code DECIMAL(7, 2) NOT NULL}.

                                      + * will create {@code DECIMAL(7, 2) NOT NULL}. * * @param typeName Type name * @param precision Precision diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypePrecedenceList.java b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypePrecedenceList.java index 919a5fac6799..867cc9318b21 100644 --- a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypePrecedenceList.java +++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypePrecedenceList.java @@ -38,7 +38,7 @@ public interface RelDataTypePrecedenceList { /** * Compares the precedence of two types. * - *

                                      The list must contain both types.

                                      + *

                                      The list must contain both types. * * @param type1 first type to compare * @param type2 second type to compare diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelRecordType.java b/core/src/main/java/org/apache/calcite/rel/type/RelRecordType.java index 7fc4ebba26ef..cd94c8f09d1f 100644 --- a/core/src/main/java/org/apache/calcite/rel/type/RelRecordType.java +++ b/core/src/main/java/org/apache/calcite/rel/type/RelRecordType.java @@ -48,6 +48,7 @@ public class RelRecordType extends RelDataTypeImpl implements Serializable { /** * Creates a RecordType. This should only be called from a * factory method. + * * @param kind Name resolution policy * @param fields List of fields * @param nullable Whether this record type allows null values diff --git a/core/src/main/java/org/apache/calcite/rex/RexBuilder.java b/core/src/main/java/org/apache/calcite/rex/RexBuilder.java index df55de6b040b..7efea7b94ee3 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexBuilder.java +++ b/core/src/main/java/org/apache/calcite/rex/RexBuilder.java @@ -84,7 +84,7 @@ /** * Factory for row expressions. * - *

                                      Some common literal values (NULL, TRUE, FALSE, 0, 1, '') are cached.

                                      + *

                                      Some common literal values (NULL, TRUE, FALSE, 0, 1, '') are cached. */ public class RexBuilder { /** @@ -180,7 +180,7 @@ public SqlStdOperatorTable getOpTab() { * SQL), use your session's case-sensitivity setting. * Only hard-code {@code true} if you are sure that the field name is * internally generated. - * Hard-coding {@code false} is almost certainly wrong.

                                      + * Hard-coding {@code false} is almost certainly wrong. * * @param expr Expression yielding a record * @param fieldName Name of field in record @@ -261,7 +261,7 @@ public RexNode makeCall( * *

                                      If you already know the return type of the call, then * {@link #makeCall(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.sql.SqlOperator, java.util.List)} - * is preferred.

                                      + * is preferred. */ public RexNode makeCall( SqlOperator op, @@ -301,7 +301,7 @@ public RelDataType deriveReturnType( * Creates a reference to an aggregate call, checking for repeated calls. * *

                                      Argument types help to optimize for repeated aggregates. - * For instance count(42) is equivalent to count(*).

                                      + * For instance count(42) is equivalent to count(*). * * @param aggCall aggregate call to be added * @param groupCount number of groups in the aggregate relation @@ -1497,7 +1497,7 @@ public RexNode copy(RexNode expr) { /** * Creates a literal of the default value for the given type. * - *

                                      This value is:

                                      + *

                                      This value is: * *

                                        *
                                      • 0 for numeric types; diff --git a/core/src/main/java/org/apache/calcite/rex/RexCall.java b/core/src/main/java/org/apache/calcite/rex/RexCall.java index 2526d7df5df8..c2d7b332d398 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexCall.java +++ b/core/src/main/java/org/apache/calcite/rex/RexCall.java @@ -50,7 +50,7 @@ *

                                        It's not often necessary to sub-class this class. The smarts should be in * the operator, rather than the call. Any extra information about the call can * often be encoded as extra arguments. (These don't need to be hidden, because - * no one is going to be generating source code from this tree.)

                                        + * no one is going to be generating source code from this tree.) */ public class RexCall extends RexNode { diff --git a/core/src/main/java/org/apache/calcite/rex/RexCorrelVariable.java b/core/src/main/java/org/apache/calcite/rex/RexCorrelVariable.java index e7c056271ae3..101ca1c67bf2 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexCorrelVariable.java +++ b/core/src/main/java/org/apache/calcite/rex/RexCorrelVariable.java @@ -29,7 +29,7 @@ * *

                                        Correlating variables are introduced when performing nested loop joins. * Each row is received from one side of the join, a correlating variable is - * assigned a value, and the other side of the join is restarted.

                                        + * assigned a value, and the other side of the join is restarted. */ public class RexCorrelVariable extends RexVariable { public final CorrelationId id; diff --git a/core/src/main/java/org/apache/calcite/rex/RexInputRef.java b/core/src/main/java/org/apache/calcite/rex/RexInputRef.java index 788b44dc0611..2c8e6530bb1e 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexInputRef.java +++ b/core/src/main/java/org/apache/calcite/rex/RexInputRef.java @@ -29,14 +29,14 @@ * Variable which references a field of an input relational expression. * *

                                        Fields of the input are 0-based. If there is more than one input, they are - * numbered consecutively. For example, if the inputs to a join are

                                        + * numbered consecutively. For example, if the inputs to a join are * *
                                          *
                                        • Input #0: EMP(EMPNO, ENAME, DEPTNO) and
                                        • *
                                        • Input #1: DEPT(DEPTNO AS DEPTNO2, DNAME)
                                        • *
                                        * - *

                                        then the fields are:

                                        + *

                                        then the fields are: * *

                                          *
                                        • Field #0: EMPNO
                                        • @@ -47,7 +47,7 @@ *
                                        * *

                                        So RexInputRef(3, Integer) is the correct reference for the - * field DEPTNO2.

                                        + * field DEPTNO2. */ public class RexInputRef extends RexSlot { //~ Static fields/initializers --------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/rex/RexLiteral.java b/core/src/main/java/org/apache/calcite/rex/RexLiteral.java index 7c6bf04962db..b5231b66b71e 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexLiteral.java +++ b/core/src/main/java/org/apache/calcite/rex/RexLiteral.java @@ -73,16 +73,16 @@ * Constant value in a row-expression. * *

                                        There are several methods for creating literals in {@link RexBuilder}: - * {@link RexBuilder#makeLiteral(boolean)} and so forth.

                                        + * {@link RexBuilder#makeLiteral(boolean)} and so forth. * *

                                        How is the value stored? In that respect, the class is somewhat of a black * box. There is a {@link #getValue} method which returns the value as an * object, but the type of that value is implementation detail, and it is best * that your code does not depend upon that knowledge. It is better to use * task-oriented methods such as {@link #getValue2} and - * {@link #toJavaString}.

                                        + * {@link #toJavaString}. * - *

                                        The allowable types and combinations are:

                                        + *

                                        The allowable types and combinations are: * * * @@ -446,6 +446,7 @@ private static String toJavaString( /** * Computes if data type can be omitted from the digest. + * *

                                        For instance, {@code 1:BIGINT} has to keep data type while {@code 1:INT} * should be represented as just {@code 1}. * @@ -608,7 +609,7 @@ public void printAsJava(PrintWriter pw) { * Appends the specified value in the provided destination as a Java string. The value must be * consistent with the type, as per {@link #valueMatchesType}. * - *

                                        Typical return values:

                                        + *

                                        Typical return values: * *

                                          *
                                        • true
                                        • diff --git a/core/src/main/java/org/apache/calcite/rex/RexNode.java b/core/src/main/java/org/apache/calcite/rex/RexNode.java index a3a841fb78c1..9db8c867a598 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexNode.java +++ b/core/src/main/java/org/apache/calcite/rex/RexNode.java @@ -36,9 +36,9 @@ *

                                          Some common row-expressions are: {@link RexLiteral} (constant value), * {@link RexVariable} (variable), {@link RexCall} (call to operator with * operands). Expressions are generally created using a {@link RexBuilder} - * factory.

                                          + * factory. * - *

                                          All sub-classes of RexNode are immutable.

                                          + *

                                          All sub-classes of RexNode are immutable. */ public abstract class RexNode { diff --git a/core/src/main/java/org/apache/calcite/rex/RexNormalize.java b/core/src/main/java/org/apache/calcite/rex/RexNormalize.java index 713a1f78879f..95ffc9fb63b9 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexNormalize.java +++ b/core/src/main/java/org/apache/calcite/rex/RexNormalize.java @@ -154,7 +154,7 @@ private static int reorderOperands(RexNode operand0, RexNode operand1) { return x != 0 ? x : operand1.hashCode() - operand0.hashCode(); } - /** Returns whether a call is symmetrical. **/ + /** Returns whether a call is symmetrical. */ private static boolean isSymmetricalCall( SqlOperator operator, RexNode operand0, @@ -164,10 +164,9 @@ private static boolean isSymmetricalCall( && SqlTypeUtil.equalSansNullability(operand0.getType(), operand1.getType()); } - /** Compute a hash that is symmetric in its arguments - that is a hash - * where the order of appearance of elements does not matter. - * This is useful for hashing symmetrical rex calls, for example. - */ + /** Computes a hash that is symmetric in its arguments - that is, a hash + * where the order of appearance of elements does not matter. + * This is useful for hashing symmetrical rex calls, for example. */ private static int unorderedHash(List xs) { int a = 0; int b = 0; diff --git a/core/src/main/java/org/apache/calcite/rex/RexProgram.java b/core/src/main/java/org/apache/calcite/rex/RexProgram.java index d001e49f185c..623475c1a1a6 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexProgram.java +++ b/core/src/main/java/org/apache/calcite/rex/RexProgram.java @@ -109,7 +109,7 @@ public class RexProgram { * Creates a program. * *

                                          The expressions must be valid: they must not contain common expressions, - * forward references, or non-trivial aggregates.

                                          + * forward references, or non-trivial aggregates. * * @param inputRowType Input row type * @param exprs Common expressions @@ -517,7 +517,7 @@ public boolean isValid( * *

                                          Like {@link RexUtil#isNull(RexNode)}, null literals are null, and * casts of null literals are null. But this method also regards references - * to null expressions as null.

                                          + * to null expressions as null. * * @param expr Expression * @return Whether expression always evaluates to null diff --git a/core/src/main/java/org/apache/calcite/rex/RexProgramBuilder.java b/core/src/main/java/org/apache/calcite/rex/RexProgramBuilder.java index e1a3bce3c69e..99bd7551eb4b 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexProgramBuilder.java +++ b/core/src/main/java/org/apache/calcite/rex/RexProgramBuilder.java @@ -269,7 +269,7 @@ public RexLocalRef addProject(int at, int ordinal, final String name) { * Sets the condition of the program. * *

                                          The expression must be specified in terms of the input fields. If - * not, call {@link #registerOutput(RexNode)} first.

                                          + * not, call {@link #registerOutput(RexNode)} first. */ public void addCondition(RexNode expr) { assert expr != null; @@ -294,9 +294,9 @@ public void addCondition(RexNode expr) { /** * Registers an expression in the list of common sub-expressions, and * returns a reference to that expression. - + * *

                                          The expression must be expressed in terms of the inputs of - * this program.

                                          + * this program. */ public RexLocalRef registerInput(RexNode expr) { final RexShuttle shuttle = new RegisterInputShuttle(true); @@ -739,7 +739,7 @@ public static RexProgram mergePrograms( * 6: ($2 = 6) // c = 6 * * - *

                                          Another example:

                                          + *

                                          Another example: * *

                                          *
                                          SELECT *
                                          @@ -826,7 +826,7 @@ private List registerProjectsAndCondition(RexProgram program) {
                                             /**
                                              * Removes all project items.
                                              *
                                          -   * 

                                          After calling this method, you may need to re-normalize.

                                          + *

                                          After calling this method, you may need to re-normalize. */ public void clearProjects() { projectRefList.clear(); @@ -836,7 +836,7 @@ public void clearProjects() { /** * Clears the condition. * - *

                                          After calling this method, you may need to re-normalize.

                                          + *

                                          After calling this method, you may need to re-normalize. */ public void clearCondition() { conditionRef = null; diff --git a/core/src/main/java/org/apache/calcite/rex/RexRangeRef.java b/core/src/main/java/org/apache/calcite/rex/RexRangeRef.java index 1cdb19e41f21..1abac5d19aee 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexRangeRef.java +++ b/core/src/main/java/org/apache/calcite/rex/RexRangeRef.java @@ -29,16 +29,16 @@ * {@link org.apache.calcite.sql.SqlNode SQL} tree to a * {@link org.apache.calcite.rel.RelNode rel}/{@link RexNode rex} * tree. Regular {@link RexNode rex} trees do not contain this - * construct.

                                          + * construct. * *

                                          While translating a join of EMP(EMPNO, ENAME, DEPTNO) to DEPT(DEPTNO2, * DNAME) we create RexRangeRef(DeptType,3) to represent the pair * of columns (DEPTNO2, DNAME) which came from DEPT. The type has 2 columns, and - * therefore the range represents columns {3, 4} of the input.

                                          + * therefore the range represents columns {3, 4} of the input. * *

                                          Suppose we later create a reference to the DNAME field of this * RexRangeRef; it will return a {@link RexInputRef}(5,Integer), - * and the {@link org.apache.calcite.rex.RexRangeRef} will disappear.

                                          + * and the {@link org.apache.calcite.rex.RexRangeRef} will disappear. */ public class RexRangeRef extends RexNode { //~ Instance fields -------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/rex/RexShuttle.java b/core/src/main/java/org/apache/calcite/rex/RexShuttle.java index 718d36159149..a300e9a8c7c0 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexShuttle.java +++ b/core/src/main/java/org/apache/calcite/rex/RexShuttle.java @@ -33,7 +33,7 @@ *

                                          Like {@link RexVisitor}, this is an instance of the * {@link org.apache.calcite.util.Glossary#VISITOR_PATTERN Visitor Pattern}. Use * RexShuttle if you would like your methods to return a - * value.

                                          + * value. */ public class RexShuttle implements RexVisitor { //~ Methods ---------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/rex/RexSimplify.java b/core/src/main/java/org/apache/calcite/rex/RexSimplify.java index c95752b80c03..b22ec3a77fad 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexSimplify.java +++ b/core/src/main/java/org/apache/calcite/rex/RexSimplify.java @@ -204,7 +204,7 @@ public RexNode simplifyPreservingType(RexNode e, RexUnknownAs unknownAs, /** * Simplifies a boolean expression. * - *

                                          In particular:

                                          + *

                                          In particular: *

                                            *
                                          • {@code simplify(x = 1 OR NOT x = 1 OR x IS NULL)} * returns {@code TRUE}
                                          • diff --git a/core/src/main/java/org/apache/calcite/rex/RexSubQuery.java b/core/src/main/java/org/apache/calcite/rex/RexSubQuery.java index 3bb6f2892dac..609a4a5a0166 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexSubQuery.java +++ b/core/src/main/java/org/apache/calcite/rex/RexSubQuery.java @@ -61,7 +61,7 @@ public static RexSubQuery in(RelNode rel, ImmutableList nodes) { * If {@code comparison} is {@code >} * then {@code negated-comparison} is {@code <=}, and so forth. * - *

                                            Also =SOME is rewritten into IN

                                            */ + *

                                            Also =SOME is rewritten into IN */ public static RexSubQuery some(RelNode rel, ImmutableList nodes, SqlQuantifyOperator op) { assert op.kind == SqlKind.SOME; diff --git a/core/src/main/java/org/apache/calcite/rex/RexUnaryBiVisitor.java b/core/src/main/java/org/apache/calcite/rex/RexUnaryBiVisitor.java index 7f4ca0ea6623..227325d347ff 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexUnaryBiVisitor.java +++ b/core/src/main/java/org/apache/calcite/rex/RexUnaryBiVisitor.java @@ -31,7 +31,7 @@ protected RexUnaryBiVisitor(boolean deep) { } /** Called as the last action of, and providing the result for, - * each {@code visitXxx} method; derived classes may override. */ + * each {@code visitXxx} method; derived classes may override. */ protected R end(RexNode e, R arg) { return arg; } diff --git a/core/src/main/java/org/apache/calcite/rex/RexUtil.java b/core/src/main/java/org/apache/calcite/rex/RexUtil.java index 1f4a99ff79e2..bc4d280e0058 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexUtil.java +++ b/core/src/main/java/org/apache/calcite/rex/RexUtil.java @@ -1603,7 +1603,7 @@ public static List flatten(List exprs, * would be considered "flat". * *

                                            For example, {@code isFlat([w, AND[x, y], z, AND)} returns false; - *

                                            {@code isFlat([w, x, y, z], AND)} returns true.

                                            + * {@code isFlat([w, x, y, z], AND)} returns true. */ private static boolean isFlat( List exprs, final SqlOperator op) { @@ -1645,6 +1645,7 @@ private static void flattenRecurse( * *

                                            The implementation of this method does not return false positives. * However, it is not complete. + * * @param node input node to verify if it represents a loss-less cast * @return true iff the node is a loss-less cast */ @@ -1666,6 +1667,7 @@ public static boolean isLosslessCast(RexNode node) { * *

                                            The implementation of this method does not return false positives. * However, it is not complete. + * * @param source source type * @param target target type * @return true iff the conversion is a loss-less cast @@ -1959,7 +1961,7 @@ public static RexNode simplify(RexBuilder rexBuilder, RexNode e) { * Simplifies a boolean expression, * using the default executor. * - *

                                            In particular:

                                            + *

                                            In particular: *

                                              *
                                            • {@code simplify(x = 1 AND y = 2 AND NOT x = 1)} * returns {@code y = 2}
                                            • diff --git a/core/src/main/java/org/apache/calcite/rex/RexWindowBound.java b/core/src/main/java/org/apache/calcite/rex/RexWindowBound.java index 7ad7247a3f05..e2d0d7fd2a07 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexWindowBound.java +++ b/core/src/main/java/org/apache/calcite/rex/RexWindowBound.java @@ -38,6 +38,7 @@ public static RexWindowBound create(SqlNode node, RexNode rexNode) { /** * Returns if the bound is unbounded. + * * @return if the bound is unbounded */ @Pure @@ -49,6 +50,7 @@ public boolean isUnbounded() { /** * Returns if the bound is PRECEDING. + * * @return if the bound is PRECEDING */ public boolean isPreceding() { @@ -57,6 +59,7 @@ public boolean isPreceding() { /** * Returns if the bound is FOLLOWING. + * * @return if the bound is FOLLOWING */ public boolean isFollowing() { @@ -65,6 +68,7 @@ public boolean isFollowing() { /** * Returns if the bound is CURRENT ROW. + * * @return if the bound is CURRENT ROW */ @Pure diff --git a/core/src/main/java/org/apache/calcite/rex/package-info.java b/core/src/main/java/org/apache/calcite/rex/package-info.java index 7352cc51a88c..57bd7f4c3920 100644 --- a/core/src/main/java/org/apache/calcite/rex/package-info.java +++ b/core/src/main/java/org/apache/calcite/rex/package-info.java @@ -24,22 +24,22 @@ * parse tree consisting of {@link org.apache.calcite.sql.SqlNode} objects into * a relational expression ({@link org.apache.calcite.rel.RelNode}). Several * kinds of nodes in this tree have row expressions - * ({@link org.apache.calcite.rex.RexNode}).

                                              + * ({@link org.apache.calcite.rex.RexNode}). * *

                                              After the relational expression has been optimized, a * {@link org.apache.calcite.adapter.enumerable.JavaRelImplementor} converts it * into to a plan. If the plan is a Java parse tree, row-expressions are - * translated into equivalent Java expressions.

                                              + * translated into equivalent Java expressions. * *

                                              Expressions

                                              * * *

                                              Every row-expression has a type. (Compare with * {@link org.apache.calcite.sql.SqlNode}, which is created before validation, - * and therefore types may not be available.)

                                              + * and therefore types may not be available.) * *

                                              Every node in the parse tree is a {@link org.apache.calcite.rex.RexNode}. - * Sub-types are:

                                              + * Sub-types are: *
                                                *
                                              • {@link org.apache.calcite.rex.RexLiteral} represents a boolean, * numeric, string, or date constant, or the value NULL. @@ -67,7 +67,7 @@ *
                                              * *

                                              Expressions are generally - * created using a {@link org.apache.calcite.rex.RexBuilder} factory.

                                              + * created using a {@link org.apache.calcite.rex.RexBuilder} factory. * *

                                              Related packages

                                              *
                                                diff --git a/core/src/main/java/org/apache/calcite/runtime/BinarySearch.java b/core/src/main/java/org/apache/calcite/runtime/BinarySearch.java index 0c1e2f71a15d..536920c0abd4 100644 --- a/core/src/main/java/org/apache/calcite/runtime/BinarySearch.java +++ b/core/src/main/java/org/apache/calcite/runtime/BinarySearch.java @@ -38,6 +38,7 @@ protected BinarySearch() { * It is assumed that the array is sorted. * The method is guaranteed to return the minimal index of the element that is * greater or equal to the given key. + * * @param a array that holds the values * @param key element to look for * @param comparator comparator that compares keys @@ -57,6 +58,7 @@ public static int lowerBound(T[] a, T key, Comparator comparator) { * It is assumed that the array is sorted. * The method is guaranteed to return the maximal index of the element that is * less or equal to the given key. + * * @param a array that holds the values * @param key element to look for * @param comparator comparator that compares keys @@ -77,6 +79,7 @@ public static int upperBound(T[] a, T key, Comparator comparator) { * It is assumed that the array is sorted. * The method is guaranteed to return the minimal index of the element that is * greater or equal to the given key. + * * @param a array that holds the values * @param key element to look for * @param keySelector function that transforms array contents to the type @@ -100,6 +103,7 @@ public static int lowerBound(T[] a, K key, Function1 keySelector, * It is assumed that the array is sorted. * The method is guaranteed to return the maximal index of the element that is * less or equal to the given key. + * * @param a array that holds the values * @param key element to look for * @param keySelector function that transforms array contents to the type @@ -122,6 +126,7 @@ public static int upperBound(T[] a, K key, Function1 keySelector, * It is assumed that the array is sorted. * The method is guaranteed to return the minimal index of the element that is * greater or equal to the given key. + * * @param a array that holds the values * @param key element to look for * @param imin the minimal index (inclusive) to look for @@ -144,6 +149,7 @@ public static int lowerBound(T[] a, T key, int imin, int imax, * It is assumed that the array is sorted. * The method is guaranteed to return the maximal index of the element that is * less or equal to the given key. + * * @param a array that holds the values * @param key element to look for * @param imin the minimal index (inclusive) to look for diff --git a/core/src/main/java/org/apache/calcite/runtime/Hook.java b/core/src/main/java/org/apache/calcite/runtime/Hook.java index 5909e4ce913c..b76b94a4ef33 100644 --- a/core/src/main/java/org/apache/calcite/runtime/Hook.java +++ b/core/src/main/java/org/apache/calcite/runtime/Hook.java @@ -34,7 +34,7 @@ * Collection of hooks that can be set by observers and are executed at various * parts of the query preparation process. * - *

                                                For testing and debugging rather than for end-users.

                                                + *

                                                For testing and debugging rather than for end-users. */ public enum Hook { /** Called to get the current time. Use this to return a predictable time @@ -116,7 +116,7 @@ public enum Hook { /** Adds a handler for this Hook. * *

                                                Returns a {@link Hook.Closeable} so that you can use the following - * try-finally pattern to prevent leaks:

                                                + * try-finally pattern to prevent leaks: * *
                                                    *     final Hook.Closeable closeable = Hook.FOO.add(HANDLER);
                                                @@ -126,6 +126,7 @@ public enum Hook {
                                                    *         closeable.close();
                                                    *     }
                                                *
                                                + * * @deprecated this installs a global hook (cross-thread), so it might have greater impact * than expected. Use with caution. Prefer thread-local hooks. * @see #addThread(Consumer) diff --git a/core/src/main/java/org/apache/calcite/runtime/Matcher.java b/core/src/main/java/org/apache/calcite/runtime/Matcher.java index fd864b0eefd3..64668165e569 100644 --- a/core/src/main/java/org/apache/calcite/runtime/Matcher.java +++ b/core/src/main/java/org/apache/calcite/runtime/Matcher.java @@ -40,6 +40,7 @@ /** * Workspace that partialMatches patterns against an automaton. + * * @param Type of rows matched by this automaton */ public class Matcher { diff --git a/core/src/main/java/org/apache/calcite/runtime/Resources.java b/core/src/main/java/org/apache/calcite/runtime/Resources.java index 03bff3d54a60..e6716533d993 100644 --- a/core/src/main/java/org/apache/calcite/runtime/Resources.java +++ b/core/src/main/java/org/apache/calcite/runtime/Resources.java @@ -124,10 +124,10 @@ public static T create(Class clazz) { *

                                                Suppose that base = "com.example.MyResource" and the current locale is * "en_US". A method * - *

                                                + *
                                                
                                                    *     @BaseMessage("Illegal binary string {0}")
                                                    *     ExInst<IllegalArgumentException> illegalBinaryString(String a0);
                                                -   * 
                                                + *
                                          * *

                                          will look up a resource "IllegalBinaryString" from the resource file * "com/example/MyResource_en_US.properties", and substitute in the parameter @@ -910,7 +910,7 @@ public enum Validation { * the class is created, it loads a properties file with the same name as the * class. * - *

                                          In the standard scheme (see {@link ResourceBundle}), if + *

                                          In the standard scheme (see {@link ResourceBundle}), if * you call {@link ResourceBundle#getBundle}("foo.MyResource"), * it first looks for a class called foo.MyResource, then * looks for a file called foo/MyResource.properties. If it finds @@ -919,15 +919,16 @@ public enum Validation { * into a dedicated class; ShadowResourceBundle helps with this * case. * - *

                                          You should create a class as follows:

                                          + *

                                          You should create a class as follows: * - *

                                          package foo;
                                          -   *class MyResource extends ShadowResourceBundle {
                                          -   *    public MyResource() throws java.io.IOException {
                                          -   *    }
                                          -   *}
                                          + *
                                          
                                          +   * package foo;
                                              *
                                          -   * 
                                          + * class MyResource extends ShadowResourceBundle { + * public MyResource() throws java.io.IOException { + * } + * } + *
                                          * *

                                          Then when you call * {@link ResourceBundle#getBundle ResourceBundle.getBundle("foo.MyResource")}, @@ -1013,9 +1014,10 @@ protected Object handleGetObject(String key) { * for the given locale. * *

                                          This method should be called from a derived class, with the proper - * casting:

                                          + * casting: * - *
                                          class MyResource extends ShadowResourceBundle {
                                          +     * 
                                          
                                          +     * class MyResource extends ShadowResourceBundle {
                                                *    ...
                                                *
                                                *    /**
                                          @@ -1028,7 +1030,8 @@ protected Object handleGetObject(String key) {
                                                *           ResourceBundle.getBundle(MyResource.class.getName(), locale));
                                                *    }
                                                *    ...
                                          -     * }
                                          + * } + *
                                          * * @param baseName Base name * @param locale Locale diff --git a/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java b/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java index d9621c5c1bd0..8a5d633360a6 100644 --- a/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java +++ b/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java @@ -1039,7 +1039,7 @@ public static boolean ne(String s0, String s1, Comparator comparator) { } /** SQL <gt; operator applied to Object values (at least one - * operand has ANY type, including String; neither may be null). */ + * operand has ANY type, including String; neither may be null). */ public static boolean neAny(Object b0, Object b1) { return !eqAny(b0, b1); } diff --git a/core/src/main/java/org/apache/calcite/runtime/Unit.java b/core/src/main/java/org/apache/calcite/runtime/Unit.java index 77d2847a919f..babe434d6a93 100644 --- a/core/src/main/java/org/apache/calcite/runtime/Unit.java +++ b/core/src/main/java/org/apache/calcite/runtime/Unit.java @@ -19,7 +19,7 @@ /** * Synthetic record with zero fields. * - *

                                          Since all instances are identical, {@code Unit} is a singleton.

                                          + *

                                          Since all instances are identical, {@code Unit} is a singleton. */ public class Unit implements Comparable { public static final Unit INSTANCE = new Unit(); diff --git a/core/src/main/java/org/apache/calcite/schema/CustomColumnResolvingTable.java b/core/src/main/java/org/apache/calcite/schema/CustomColumnResolvingTable.java index 9ce0193c4d31..adc1cbfa55ac 100644 --- a/core/src/main/java/org/apache/calcite/schema/CustomColumnResolvingTable.java +++ b/core/src/main/java/org/apache/calcite/schema/CustomColumnResolvingTable.java @@ -29,10 +29,10 @@ * *

                                          It is optional for a Table to implement this interface. If Table does * not implement this interface, column resolving will be performed in the - * default way.

                                          + * default way. * *

                                          NOTE: This class is experimental and subject to - * change/removal without notice.

                                          + * change/removal without notice. */ public interface CustomColumnResolvingTable extends Table { diff --git a/core/src/main/java/org/apache/calcite/schema/Function.java b/core/src/main/java/org/apache/calcite/schema/Function.java index 8349056df8e3..8d9df7837ee6 100644 --- a/core/src/main/java/org/apache/calcite/schema/Function.java +++ b/core/src/main/java/org/apache/calcite/schema/Function.java @@ -23,11 +23,11 @@ * *

                                          The application may occur at compile time (for a macro) or at run time * (for a regular function). The result may be a relation, and so might any of - * the parameters.

                                          + * the parameters. * *

                                          Functions are registered in a {@link Schema}, and may be queried by name * ({@link Schema#getFunctions(String)}) then overloads resolved based on - * parameter types.

                                          + * parameter types. * * @see TableMacro * @see ScalarFunction diff --git a/core/src/main/java/org/apache/calcite/schema/FunctionParameter.java b/core/src/main/java/org/apache/calcite/schema/FunctionParameter.java index f675399aa4a5..90498fa435b4 100644 --- a/core/src/main/java/org/apache/calcite/schema/FunctionParameter.java +++ b/core/src/main/java/org/apache/calcite/schema/FunctionParameter.java @@ -23,7 +23,7 @@ * Parameter to a {@link Function}. * *

                                          NOTE: We'd have called it {@code Parameter} but the overlap with - * {@link java.lang.reflect.Parameter} was too confusing.

                                          + * {@link java.lang.reflect.Parameter} was too confusing. */ public interface FunctionParameter { /** diff --git a/core/src/main/java/org/apache/calcite/schema/ImplementableFunction.java b/core/src/main/java/org/apache/calcite/schema/ImplementableFunction.java index 5f16cb8cec96..fecfb85cd10e 100644 --- a/core/src/main/java/org/apache/calcite/schema/ImplementableFunction.java +++ b/core/src/main/java/org/apache/calcite/schema/ImplementableFunction.java @@ -27,6 +27,7 @@ public interface ImplementableFunction extends Function { /** * Returns implementor that translates the function to linq4j expression. + * * @return implementor that translates the function to linq4j expression. */ CallImplementor getImplementor(); diff --git a/core/src/main/java/org/apache/calcite/schema/Member.java b/core/src/main/java/org/apache/calcite/schema/Member.java index 8e37a0884274..b7f24e8af6bc 100644 --- a/core/src/main/java/org/apache/calcite/schema/Member.java +++ b/core/src/main/java/org/apache/calcite/schema/Member.java @@ -28,23 +28,23 @@ * *

                                          Several kinds of members crop up in real life. They all implement the * {@code Member} interface, but tend to be treated differently by the - * back-end system if not by Calcite.

                                          + * back-end system if not by Calcite. * *

                                          A member that has zero arguments and a type that is a collection of * records is referred to as a relation. In schemas backed by a - * relational database, tables and views will appear as relations.

                                          + * relational database, tables and views will appear as relations. * *

                                          A member that has one or more arguments and a type that is a collection * of records is referred to as a parameterized relation. Some relational * databases support these; for example, Oracle calls them "table - * functions".

                                          + * functions". * *

                                          Members may be also more typical of programming-language functions: - * they take zero or more arguments, and return a result of arbitrary type.

                                          + * they take zero or more arguments, and return a result of arbitrary type. * *

                                          From the above definitions, you can see that a member is a special * kind of function. This makes sense, because even though it has no - * arguments, it is "evaluated" each time it is used in a query.

                                          + * arguments, it is "evaluated" each time it is used in a query. */ public interface Member { /** diff --git a/core/src/main/java/org/apache/calcite/schema/ModifiableTable.java b/core/src/main/java/org/apache/calcite/schema/ModifiableTable.java index 1037baf78aea..3b49b54805a9 100644 --- a/core/src/main/java/org/apache/calcite/schema/ModifiableTable.java +++ b/core/src/main/java/org/apache/calcite/schema/ModifiableTable.java @@ -32,7 +32,7 @@ * A table that can be modified. * *

                                          NOTE: The current API is inefficient and experimental. It will change - * without notice.

                                          + * without notice. * * @see ModifiableView */ diff --git a/core/src/main/java/org/apache/calcite/schema/ModifiableView.java b/core/src/main/java/org/apache/calcite/schema/ModifiableView.java index 44bfff61c950..9731cf3fa804 100644 --- a/core/src/main/java/org/apache/calcite/schema/ModifiableView.java +++ b/core/src/main/java/org/apache/calcite/schema/ModifiableView.java @@ -39,7 +39,7 @@ * and column mapping is {@code [0, 2]}. * *

                                          NOTE: The current API is inefficient and experimental. It will change - * without notice.

                                          + * without notice. */ public interface ModifiableView extends Table { /** Returns a constraint that each candidate row must satisfy. diff --git a/core/src/main/java/org/apache/calcite/schema/ProjectableFilterableTable.java b/core/src/main/java/org/apache/calcite/schema/ProjectableFilterableTable.java index 366536312fe0..fa8fab08f3af 100644 --- a/core/src/main/java/org/apache/calcite/schema/ProjectableFilterableTable.java +++ b/core/src/main/java/org/apache/calcite/schema/ProjectableFilterableTable.java @@ -30,7 +30,7 @@ * without creating an intermediate relational expression. * *

                                          If you wish to write a table that can apply projects but not filters, - * simply decline all filters.

                                          + * simply decline all filters. * * @see ScannableTable * @see FilterableTable @@ -47,7 +47,7 @@ public interface ProjectableFilterableTable extends Table { * Any filters remaining will be implemented by the consuming Calcite * operator. * - *

                                          The projects are zero-based.

                                          + *

                                          The projects are zero-based. * * @param root Execution context * @param filters Mutable list of filters. The method should keep in the diff --git a/core/src/main/java/org/apache/calcite/schema/Schema.java b/core/src/main/java/org/apache/calcite/schema/Schema.java index fa5994379d62..5e034b1da9d5 100644 --- a/core/src/main/java/org/apache/calcite/schema/Schema.java +++ b/core/src/main/java/org/apache/calcite/schema/Schema.java @@ -30,30 +30,30 @@ *

                                          A schema can also contain sub-schemas, to any level of nesting. Most * providers have a limited number of levels; for example, most JDBC databases * have either one level ("schemas") or two levels ("database" and - * "catalog").

                                          + * "catalog"). * *

                                          There may be multiple overloaded functions with the same name but * different numbers or types of parameters. * For this reason, {@link #getFunctions} returns a list of all * members with the same name. Calcite will call * {@link Schemas#resolve(org.apache.calcite.rel.type.RelDataTypeFactory, String, java.util.Collection, java.util.List)} - * to choose the appropriate one.

                                          + * to choose the appropriate one. * *

                                          The most common and important type of member is the one with no * arguments and a result type that is a collection of records. This is called a * relation. It is equivalent to a table in a relational - * database.

                                          + * database. * - *

                                          For example, the query

                                          + *

                                          For example, the query * *

                                          select * from sales.emps
                                          * *

                                          is valid if "sales" is a registered * schema and "emps" is a member with zero parameters and a result type - * of Collection(Record(int: "empno", String: "name")).

                                          + * of Collection(Record(int: "empno", String: "name")). * *

                                          A schema may be nested within another schema; see - * {@link Schema#getSubSchema(String)}.

                                          + * {@link Schema#getSubSchema(String)}. */ public interface Schema { /** diff --git a/core/src/main/java/org/apache/calcite/schema/SchemaVersion.java b/core/src/main/java/org/apache/calcite/schema/SchemaVersion.java index 49eb5c9d436e..b1985ea84d3e 100644 --- a/core/src/main/java/org/apache/calcite/schema/SchemaVersion.java +++ b/core/src/main/java/org/apache/calcite/schema/SchemaVersion.java @@ -34,6 +34,7 @@ public interface SchemaVersion { /** * Returns if this Version happens before the other Version. + * * @param other the other Version object */ boolean isBefore(SchemaVersion other); diff --git a/core/src/main/java/org/apache/calcite/schema/Statistic.java b/core/src/main/java/org/apache/calcite/schema/Statistic.java index 2e4307f68fbc..7d494f28358d 100644 --- a/core/src/main/java/org/apache/calcite/schema/Statistic.java +++ b/core/src/main/java/org/apache/calcite/schema/Statistic.java @@ -28,7 +28,7 @@ /** * Statistics about a {@link Table}. * - *

                                          Each of the methods may return {@code null} meaning "not known".

                                          + *

                                          Each of the methods may return {@code null} meaning "not known". * * @see Statistics */ diff --git a/core/src/main/java/org/apache/calcite/schema/Table.java b/core/src/main/java/org/apache/calcite/schema/Table.java index d8d53d8e1697..bd422ff027f6 100644 --- a/core/src/main/java/org/apache/calcite/schema/Table.java +++ b/core/src/main/java/org/apache/calcite/schema/Table.java @@ -31,13 +31,13 @@ * user-defined schema in order to validate names appearing in a SQL query. * Calcite finds the schema by calling {@link Schema#getSubSchema(String)} on * the connection's root schema, then gets a table by calling - * {@link Schema#getTable(String)}.

                                          + * {@link Schema#getTable(String)}. * *

                                          Note that a table does not know its name. It is in fact possible for * a table to be used more than once, perhaps under multiple names or under * multiple schemas. (Compare with the * i-node concept in the UNIX - * filesystem.)

                                          + * filesystem.) * *

                                          A particular table instance may also implement {@link Wrapper}, * to give access to sub-objects. @@ -48,11 +48,11 @@ public interface Table { /** Returns this table's row type. * *

                                          This is a struct type whose - * fields describe the names and types of the columns in this table.

                                          + * fields describe the names and types of the columns in this table. * *

                                          The implementer must use the type factory provided. This ensures that * the type is converted into a canonical form; other equal types in the same - * query will use the same object.

                                          + * query will use the same object. * * @param typeFactory Type factory with which to create the type * @return Row type diff --git a/core/src/main/java/org/apache/calcite/schema/TableFactory.java b/core/src/main/java/org/apache/calcite/schema/TableFactory.java index 780bf2e6815c..011cd63498a6 100644 --- a/core/src/main/java/org/apache/calcite/schema/TableFactory.java +++ b/core/src/main/java/org/apache/calcite/schema/TableFactory.java @@ -27,7 +27,7 @@ * *

                                          A table factory allows you to include custom tables in a model file. * For example, here is a model that contains a custom table that generates - * a range of integers.

                                          + * a range of integers. * *
                                          {
                                            *   version: '1.0',
                                          @@ -51,11 +51,11 @@
                                            *   ]
                                            * }
                                          * - *

                                          Given that schema, the query

                                          + *

                                          Given that schema, the query * *

                                          SELECT * FROM math.integers
                                          * - *

                                          returns

                                          + *

                                          returns * *

                                            * +---+
                                          @@ -69,7 +69,7 @@
                                            * 
                                          * *

                                          A class that implements TableFactory specified in a schema must have a - * public default constructor.

                                          + * public default constructor. * * @param Sub-type of table created by this factory */ diff --git a/core/src/main/java/org/apache/calcite/schema/TableMacro.java b/core/src/main/java/org/apache/calcite/schema/TableMacro.java index b6befaa247ef..84c3c0b697ad 100644 --- a/core/src/main/java/org/apache/calcite/schema/TableMacro.java +++ b/core/src/main/java/org/apache/calcite/schema/TableMacro.java @@ -25,7 +25,7 @@ * *

                                          As the name "macro" implies, this is invoked at "compile time", that is, * during query preparation. Compile-time expansion of table expressions allows - * for some very powerful query-optimizations.

                                          + * for some very powerful query-optimizations. */ public interface TableMacro extends Function { /** diff --git a/core/src/main/java/org/apache/calcite/schema/impl/AbstractSchema.java b/core/src/main/java/org/apache/calcite/schema/impl/AbstractSchema.java index 04072f4cd98a..a7b050a5045f 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/AbstractSchema.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/AbstractSchema.java @@ -41,7 +41,7 @@ /** * Abstract implementation of {@link Schema}. * - *

                                          Behavior is as follows:

                                          + *

                                          Behavior is as follows: *

                                            *
                                          • The schema has no tables unless you override * {@link #getTableMap()}.
                                          • @@ -78,7 +78,7 @@ public AbstractSchema() { *

                                            The implementations of {@link #getTableNames()} * and {@link #getTable(String)} depend on this map. * The default implementation of this method returns the empty map. - * Override this method to change their behavior.

                                            + * Override this method to change their behavior. * * @return Map of tables in this schema by name */ @@ -101,7 +101,7 @@ protected Map getTableMap() { *

                                            The implementations of {@link #getTypeNames()} * and {@link #getType(String)} depend on this map. * The default implementation of this method returns the empty map. - * Override this method to change their behavior.

                                            + * Override this method to change their behavior. * * @return Map of types in this schema by name */ @@ -127,7 +127,7 @@ protected Map getTypeMap() { *

                                            The implementations of {@link #getFunctionNames()} * and {@link Schema#getFunctions(String)} depend on this map. * The default implementation of this method returns the empty multi-map. - * Override this method to change their behavior.

                                            + * Override this method to change their behavior. * * @return Multi-map of functions in this schema by name */ @@ -149,7 +149,7 @@ protected Multimap getFunctionMultimap() { *

                                            The implementations of {@link #getSubSchemaNames()} * and {@link #getSubSchema(String)} depend on this map. * The default implementation of this method returns the empty map. - * Override this method to change their behavior.

                                            + * Override this method to change their behavior. * * @return Map of sub-schemas in this schema by name */ diff --git a/core/src/main/java/org/apache/calcite/schema/impl/AbstractTableQueryable.java b/core/src/main/java/org/apache/calcite/schema/impl/AbstractTableQueryable.java index 8247c89a5a36..9ae41230b248 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/AbstractTableQueryable.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/AbstractTableQueryable.java @@ -32,7 +32,7 @@ * {@link QueryableTable}. * *

                                            Not to be confused with - * {@link org.apache.calcite.adapter.java.AbstractQueryableTable}.

                                            + * {@link org.apache.calcite.adapter.java.AbstractQueryableTable}. * * @param element type */ diff --git a/core/src/main/java/org/apache/calcite/schema/impl/ListTransientTable.java b/core/src/main/java/org/apache/calcite/schema/impl/ListTransientTable.java index 653a66f3eaec..a80556ceef28 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/ListTransientTable.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/ListTransientTable.java @@ -53,7 +53,7 @@ * {@link TransientTable} backed by a Java list. It will be automatically added to the * current schema when {@link #scan(DataContext)} method gets called. * - *

                                            NOTE: The current API is experimental and subject to change without notice.

                                            + *

                                            NOTE: The current API is experimental and subject to change without notice. */ @Experimental public class ListTransientTable extends AbstractQueryableTable diff --git a/core/src/main/java/org/apache/calcite/schema/impl/MaterializedViewTable.java b/core/src/main/java/org/apache/calcite/schema/impl/MaterializedViewTable.java index f878bc9fd8de..125693ee9a8f 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/MaterializedViewTable.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/MaterializedViewTable.java @@ -45,7 +45,7 @@ *

                                            It can exist in two states: materialized and not materialized. Over time, * a given materialized view may switch states. How it is expanded depends upon * its current state. State is managed by - * {@link org.apache.calcite.materialize.MaterializationService}.

                                            + * {@link org.apache.calcite.materialize.MaterializationService}. */ public class MaterializedViewTable extends ViewTable { diff --git a/core/src/main/java/org/apache/calcite/schema/impl/ReflectiveFunctionBase.java b/core/src/main/java/org/apache/calcite/schema/impl/ReflectiveFunctionBase.java index c3a0211342c9..ef28da6631a4 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/ReflectiveFunctionBase.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/ReflectiveFunctionBase.java @@ -100,6 +100,7 @@ static boolean classHasPublicFunctionContextConstructor(Class clazz) { /** * Finds a method in a given class by name. + * * @param clazz class to search method in * @param name name of the method to find * @return the first method with matching name or null when no method found diff --git a/core/src/main/java/org/apache/calcite/schema/impl/StarTable.java b/core/src/main/java/org/apache/calcite/schema/impl/StarTable.java index 27d4d4c779cb..97a17ec0db47 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/StarTable.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/StarTable.java @@ -50,11 +50,11 @@ * *

                                            Star tables do not occur in end-user queries. They are introduced by the * optimizer to help matching queries to materializations, and used only - * during the planning process.

                                            + * during the planning process. * *

                                            When a materialization is defined, if it involves a join, it is converted * to a query on top of a star table. Queries that are candidates to map onto - * the materialization are mapped onto the same star table.

                                            + * the materialization are mapped onto the same star table. */ public class StarTable extends AbstractTable implements TranslatableTable { public final Lattice lattice; diff --git a/core/src/main/java/org/apache/calcite/schema/impl/ViewTable.java b/core/src/main/java/org/apache/calcite/schema/impl/ViewTable.java index c055ab1dbe65..2f683520d863 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/ViewTable.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/ViewTable.java @@ -43,7 +43,7 @@ /** * Table whose contents are defined using an SQL statement. * - *

                                            It is not evaluated; it is expanded during query planning.

                                            + *

                                            It is not evaluated; it is expanded during query planning. */ public class ViewTable extends AbstractQueryableTable diff --git a/core/src/main/java/org/apache/calcite/sql/SqlBasicFunction.java b/core/src/main/java/org/apache/calcite/sql/SqlBasicFunction.java index a811228beab1..0230bdf3ca65 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlBasicFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlBasicFunction.java @@ -98,8 +98,8 @@ public static SqlBasicFunction create(SqlKind kind, } /** Creates a {@code SqlBasicFunction} - * with kind {@link SqlKind#OTHER_FUNCTION} - * and category {@link SqlFunctionCategory#NUMERIC}. */ + * with kind {@link SqlKind#OTHER_FUNCTION} + * and category {@link SqlFunctionCategory#NUMERIC}. */ public static SqlBasicFunction create(String name, SqlReturnTypeInference returnTypeInference, SqlOperandTypeChecker operandTypeChecker) { @@ -110,7 +110,7 @@ public static SqlBasicFunction create(String name, } /** Creates a {@code SqlBasicFunction} - * with kind {@link SqlKind#OTHER_FUNCTION}. */ + * with kind {@link SqlKind#OTHER_FUNCTION}. */ public static SqlBasicFunction create(String name, SqlReturnTypeInference returnTypeInference, SqlOperandTypeChecker operandTypeChecker, SqlFunctionCategory category) { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlCall.java b/core/src/main/java/org/apache/calcite/sql/SqlCall.java index 7cc66e7ec7dd..3f64e5757d88 100755 --- a/core/src/main/java/org/apache/calcite/sql/SqlCall.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlCall.java @@ -78,18 +78,23 @@ public void setOperand(int i, @Nullable SqlNode operand) { public abstract SqlOperator getOperator(); /** - * Returns the list of operands. The set and order of operands is call-specific. + * Returns the list of operands. The set and order of operands is + * call-specific. + * *

                                            Note: the proper type would be {@code List<@Nullable SqlNode>}, however, - * it would trigger too many changes to the current codebase.

                                            + * it would trigger too many changes to the current codebase. + * * @return the list of call operands, never null, the operands can be null */ public abstract List getOperandList(); /** * Returns i-th operand (0-based). + * *

                                            Note: the result might be null, so the proper signature would be - * {@code }, however, it would trigger to many changes to the current - * codebase.

                                            + * {@code }, however, it would trigger to many + * changes to the current codebase. + * * @param i operand index (0-based) * @param type of the result * @return i-th operand (0-based), the result might be null diff --git a/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java b/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java index 8c41e3001e8a..3dec2a2c2ff0 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java @@ -34,7 +34,7 @@ * Represents a SQL data type specification in a parse tree. * *

                                            A SqlDataTypeSpec is immutable; once created, you cannot - * change any of the fields.

                                            + * change any of the fields. * *

                                            We support the following data type expressions: * diff --git a/core/src/main/java/org/apache/calcite/sql/SqlDialect.java b/core/src/main/java/org/apache/calcite/sql/SqlDialect.java index ffb12c3629d9..31e96bf943fb 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlDialect.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlDialect.java @@ -724,18 +724,18 @@ public boolean supportsCharSet() { /** * Returns whether the dialect supports GROUP BY literals. * - *

                                            For instance, in {@link DatabaseProduct#REDSHIFT}, the following queries are illegal.

                                            - *
                                            {@code
                                            +   * 

                                            For instance, in {@link DatabaseProduct#REDSHIFT}, the following queries + * are illegal: + * + *

                                            {@code
                                                * select avg(salary)
                                                * from emp
                                                * group by true
                                            -   * }
                                            * - *
                                            {@code
                                                * select avg(salary)
                                                * from emp
                                                * group by 'a', DATE '2022-01-01'
                                            -   * }
                                            + * }
                                            */ public boolean supportsGroupByLiteral() { return true; @@ -851,7 +851,7 @@ public boolean supportsDataType(RelDataType type) { } /** Rewrite SINGLE_VALUE into expression based on database variants - * E.g. HSQLDB, MYSQL, ORACLE, etc + * E.g. HSQLDB, MYSQL, ORACLE, etc. */ public SqlNode rewriteSingleValueExpr(SqlNode aggCall) { LOGGER.debug("SINGLE_VALUE rewrite not supported for {}", databaseProduct); diff --git a/core/src/main/java/org/apache/calcite/sql/SqlFilterOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlFilterOperator.java index 9a3487332625..03ecb00606ee 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlFilterOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlFilterOperator.java @@ -33,7 +33,7 @@ * An operator that applies a filter before rows are included in an aggregate * function. * - *

                                            Operands are as follows:

                                            + *

                                            Operands are as follows: * *

                                              *
                                            • 0: a call to an aggregate function ({@link SqlCall}) diff --git a/core/src/main/java/org/apache/calcite/sql/SqlIntervalLiteral.java b/core/src/main/java/org/apache/calcite/sql/SqlIntervalLiteral.java index 7cf370a8feb2..c9a2d335d791 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlIntervalLiteral.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlIntervalLiteral.java @@ -37,9 +37,9 @@ *
                                            • INTERVAL '3:4' YEAR TO MONTH
                                            • *
                                            * - *

                                            YEAR/MONTH intervals are not implemented yet.

                                            + *

                                            YEAR/MONTH intervals are not implemented yet. * - *

                                            The interval string, such as '1:00:05.345', is not parsed yet.

                                            + *

                                            The interval string, such as '1:00:05.345', is not parsed yet. */ public class SqlIntervalLiteral extends SqlLiteral { //~ Constructors ----------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/sql/SqlIntervalQualifier.java b/core/src/main/java/org/apache/calcite/sql/SqlIntervalQualifier.java index 0dce371574d0..508aaaf3078b 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlIntervalQualifier.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlIntervalQualifier.java @@ -266,7 +266,7 @@ public boolean isTimestamp() { } /** Whether this qualifier represents {@code WEEK}, {@code ISOWEEK}, - * or {@code WEEK(}weekday{@code )} + * or {@code WEEK(}weekday{@code )} * (for weekday in {@code SUNDAY} .. {@code SATURDAY}). */ public boolean isWeek() { return timeUnitRange == TimeUnitRange.WEEK diff --git a/core/src/main/java/org/apache/calcite/sql/SqlKind.java b/core/src/main/java/org/apache/calcite/sql/SqlKind.java index b34c9d2b15d4..fa86e306eb86 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlKind.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlKind.java @@ -30,7 +30,7 @@ * *

                                            The values are immutable, canonical constants, so you can use Kinds to * find particular types of expressions quickly. To identity a call to a common - * operator such as '=', use {@link org.apache.calcite.sql.SqlNode#isA}:

                                            + * operator such as '=', use {@link org.apache.calcite.sql.SqlNode#isA}: * *
                                            * exp.{@link org.apache.calcite.sql.SqlNode#isA isA}({@link #EQUALS}) @@ -38,9 +38,9 @@ * *

                                            Only commonly-used nodes have their own type; other nodes are of type * {@link #OTHER}. Some of the values, such as {@link #SET_QUERY}, represent - * aggregates.

                                            + * aggregates. * - *

                                            To quickly choose between a number of options, use a switch statement:

                                            + *

                                            To quickly choose between a number of options, use a switch statement: * *

                                            *
                                            switch (exp.getKind()) {
                                            @@ -54,12 +54,12 @@
                                              * 
                                            * *

                                            Note that we do not even have to check that a {@code SqlNode} is a - * {@link SqlCall}.

                                            + * {@link SqlCall}. * *

                                            To identify a category of expressions, use {@code SqlNode.isA} with * an aggregate SqlKind. The following expression will return true * for calls to '=' and '>=', but false for the constant '5', or - * a call to '+':

                                            + * a call to '+': * *
                                            *
                                            exp.isA({@link #COMPARISON SqlKind.COMPARISON})
                                            @@ -67,16 +67,16 @@ * *

                                            RexNode also has a {@code getKind} method; {@code SqlKind} values are * preserved during translation from {@code SqlNode} to {@code RexNode}, where - * applicable.

                                            + * applicable. * *

                                            There is no water-tight definition of "common", but that's OK. There will * always be operators that don't have their own kind, and for these we use the * {@code SqlOperator}. But for really the common ones, e.g. the many places * where we are looking for {@code AND}, {@code OR} and {@code EQUALS}, the enum - * helps.

                                            + * helps. * *

                                            (If we were using Scala, {@link SqlOperator} would be a case - * class, and we wouldn't need {@code SqlKind}. But we're not.)

                                            + * class, and we wouldn't need {@code SqlKind}. But we're not.) */ public enum SqlKind { //~ Static fields/initializers --------------------------------------------- @@ -110,7 +110,7 @@ public enum SqlKind { * *

                                            A FROM clause with more than one table is represented as if it were a * join. For example, "FROM x, y, z" is represented as - * "JOIN(x, JOIN(x, y))".

                                            + * "JOIN(x, JOIN(x, y))". */ JOIN, @@ -581,42 +581,42 @@ public enum SqlKind { * The field access operator, ".". * *

                                            (Only used at the RexNode level; at - * SqlNode level, a field-access is part of an identifier.)

                                            + * SqlNode level, a field-access is part of an identifier.) */ FIELD_ACCESS, /** * Reference to an input field. * - *

                                            (Only used at the RexNode level.)

                                            + *

                                            (Only used at the RexNode level.) */ INPUT_REF, /** * Reference to an input field, with a qualified name and an identifier. * - *

                                            (Only used at the RexNode level.)

                                            + *

                                            (Only used at the RexNode level.) */ TABLE_INPUT_REF, /** * Reference to an input field, with pattern var as modifier. * - *

                                            (Only used at the RexNode level.)

                                            + *

                                            (Only used at the RexNode level.) */ PATTERN_INPUT_REF, /** * Reference to a sub-expression computed within the current relational * operator. * - *

                                            (Only used at the RexNode level.)

                                            + *

                                            (Only used at the RexNode level.) */ LOCAL_REF, /** * Reference to correlation variable. * - *

                                            (Only used at the RexNode level.)

                                            + *

                                            (Only used at the RexNode level.) */ CORREL_VARIABLE, @@ -1361,25 +1361,27 @@ public enum SqlKind { /** * Category of operators that do not depend on the argument order. * - *

                                            For instance: {@link #AND}, {@link #OR}, {@link #EQUALS}, {@link #LEAST}

                                            - *

                                            Note: {@link #PLUS} does depend on the argument oder if argument types are different

                                            + *

                                            For instance: {@link #AND}, {@link #OR}, {@link #EQUALS}, + * {@link #LEAST}. + * + *

                                            Note: {@link #PLUS} does depend on the argument oder if argument types + * are different. */ @API(since = "1.22", status = API.Status.EXPERIMENTAL) public static final Set SYMMETRICAL = - EnumSet.of( - AND, OR, EQUALS, NOT_EQUALS, + EnumSet.of(AND, OR, EQUALS, NOT_EQUALS, IS_DISTINCT_FROM, IS_NOT_DISTINCT_FROM, GREATEST, LEAST); /** - * Category of operators that do not depend on the argument order if argument types are equal. + * Category of operators that do not depend on the argument order if argument + * types are equal. * - *

                                            For instance: {@link #PLUS}, {@link #TIMES}

                                            + *

                                            For instance: {@link #PLUS}, {@link #TIMES}. */ @API(since = "1.22", status = API.Status.EXPERIMENTAL) public static final Set SYMMETRICAL_SAME_ARG_TYPE = - EnumSet.of( - PLUS, TIMES); + EnumSet.of(PLUS, TIMES); /** * Simple binary operators are those operators which expects operands from the same Domain. diff --git a/core/src/main/java/org/apache/calcite/sql/SqlLiteral.java b/core/src/main/java/org/apache/calcite/sql/SqlLiteral.java index 4c9884ea2e9d..8ce572495aac 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlLiteral.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlLiteral.java @@ -61,11 +61,11 @@ * object, but the type of that value is implementation detail, and it is best * that your code does not depend upon that knowledge. It is better to use * task-oriented methods such as {@link #toSqlString(SqlDialect)} and - * {@link #toValue}.

                                            + * {@link #toValue}. * *

                                            If you really need to access the value directly, you should switch on the * value of the {@link #typeName} field, rather than making assumptions about - * the runtime type of the {@link #value}.

                                            + * the runtime type of the {@link #value}. * *

                                            The allowable types and combinations are: * @@ -527,6 +527,7 @@ public static String stringValue(SqlNode node) { /** * Converts a chained string literals into regular literals; returns regular * literals unchanged. + * * @throws IllegalArgumentException if {@code node} is not a string literal * and cannot be unchained. */ diff --git a/core/src/main/java/org/apache/calcite/sql/SqlOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlOperator.java index 43a23795ffa0..6a85eb6df408 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlOperator.java @@ -784,7 +784,7 @@ protected void checkOperandCount( *

                                            Similar to {@link #checkOperandCount}, but some operators may have * different valid operands in {@link SqlNode} and {@code RexNode} formats * (some examples are CAST and AND), and this method throws internal errors, - * not user errors.

                                            + * not user errors. */ public boolean validRexOperands(int count, Litmus litmus) { return true; @@ -838,11 +838,11 @@ public String getAllowedSignatures(String opNameToUse) { * window functions. * Every aggregate function (e.g. SUM) is also a window function. * There are window functions that are not aggregate functions, e.g. RANK, - * NTILE, LEAD, FIRST_VALUE.

                                            + * NTILE, LEAD, FIRST_VALUE. * *

                                            Collectively, aggregate and window functions are called analytic * functions. Despite its name, this method returns true for every - * analytic function.

                                            + * analytic function. * * @see #requiresOrder() * @@ -876,7 +876,7 @@ public boolean requiresOver() { * *

                                            Per SQL:2011, 2, 6.10: "If <ntile function>, <lead or lag * function>, RANK or DENSE_RANK is specified, then the window ordering - * clause shall be present."

                                            + * clause shall be present." * * @see #isAggregator() */ diff --git a/core/src/main/java/org/apache/calcite/sql/SqlOperatorBinding.java b/core/src/main/java/org/apache/calcite/sql/SqlOperatorBinding.java index 578c1ee50565..439ddb6eade4 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlOperatorBinding.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlOperatorBinding.java @@ -66,9 +66,9 @@ protected SqlOperatorBinding( * GROUP BY deptno, gender", returns 2. * *

                                            Returns 0 if the query is implicitly "GROUP BY ()" because of an - * aggregate expression. For example, "SELECT sum(sal) FROM emp".

                                            + * aggregate expression. For example, "SELECT sum(sal) FROM emp". * - *

                                            Returns -1 if the query is not an aggregate query.

                                            + *

                                            Returns -1 if the query is not an aggregate query. */ public int getGroupCount() { return -1; diff --git a/core/src/main/java/org/apache/calcite/sql/SqlOrderBy.java b/core/src/main/java/org/apache/calcite/sql/SqlOrderBy.java index 25227e6c6058..c0c88240f80e 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlOrderBy.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlOrderBy.java @@ -29,7 +29,7 @@ * *

                                            It is a purely syntactic operator, and is eliminated by * {@link org.apache.calcite.sql.validate.SqlValidatorImpl#performUnconditionalRewrites} - * and replaced with the ORDER_OPERAND of SqlSelect.

                                            + * and replaced with the ORDER_OPERAND of SqlSelect. */ public class SqlOrderBy extends SqlCall { public static final SqlSpecialOperator OPERATOR = new Operator() { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlOverOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlOverOperator.java index beed7f11b1a9..c04b986b42ba 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlOverOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlOverOperator.java @@ -30,7 +30,7 @@ /** * An operator describing a window function specification. * - *

                                            Operands are as follows:

                                            + *

                                            Operands are as follows: * *

                                              *
                                            • 0: name of window function ({@link org.apache.calcite.sql.SqlCall})
                                            • diff --git a/core/src/main/java/org/apache/calcite/sql/SqlSampleSpec.java b/core/src/main/java/org/apache/calcite/sql/SqlSampleSpec.java index 7f4a6f0d4969..974c23d6f4da 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlSampleSpec.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlSampleSpec.java @@ -21,14 +21,14 @@ /** * Specification of a SQL sample. * - *

                                              For example, the query

                                              + *

                                              For example, the query * *

                                              *
                                              SELECT *
                                                * FROM emp TABLESAMPLE SUBSTITUTE('medium')
                                              *
                                              * - *

                                              declares a sample which is created using {@link #createNamed}.

                                              + *

                                              declares a sample which is created using {@link #createNamed}. * *

                                              A sample is not a {@link SqlNode}. To include it in a parse tree, wrap it * as a literal, viz: diff --git a/core/src/main/java/org/apache/calcite/sql/SqlSelectOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlSelectOperator.java index d6bd88dc40d2..0ced9901396c 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlSelectOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlSelectOperator.java @@ -34,7 +34,7 @@ /** * An operator describing a query. (Not a query itself.) * - *

                                              Operands are:

                                              + *

                                              Operands are: * *

                                                *
                                              • 0: distinct ({@link SqlLiteral})
                                              • diff --git a/core/src/main/java/org/apache/calcite/sql/SqlTableRef.java b/core/src/main/java/org/apache/calcite/sql/SqlTableRef.java index 51907f214986..1d4896d584ed 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlTableRef.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlTableRef.java @@ -27,10 +27,10 @@ import static java.util.Objects.requireNonNull; /** - * A SqlTableRef is a node of a parse tree which represents - * a table reference. + * A SqlTableRef is a node of a parse tree which represents + * a table reference. * - *

                                                It can be attached with a sql hint statement, see {@link SqlHint} for details. + *

                                                It can be attached with a sql hint statement, see {@link SqlHint} for details. */ public class SqlTableRef extends SqlCall { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlTypeConstructorFunction.java b/core/src/main/java/org/apache/calcite/sql/SqlTypeConstructorFunction.java index 99798557c3be..216ebc783d05 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlTypeConstructorFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlTypeConstructorFunction.java @@ -23,7 +23,7 @@ * Type Constructor function. * *

                                                Created by the parser, then it is rewritten to proper SqlFunction by - * the validator to a function defined in a Calcite schema.

                                                + * the validator to a function defined in a Calcite schema. */ public class SqlTypeConstructorFunction extends SqlFunction { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlUnresolvedFunction.java b/core/src/main/java/org/apache/calcite/sql/SqlUnresolvedFunction.java index 9ea781f4027f..d1f3d796a9bd 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlUnresolvedFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlUnresolvedFunction.java @@ -31,7 +31,7 @@ * Placeholder for an unresolved function. * *

                                                Created by the parser, then it is rewritten to proper SqlFunction by - * the validator to a function defined in a Calcite schema.

                                                + * the validator to a function defined in a Calcite schema. */ public class SqlUnresolvedFunction extends SqlFunction { /** diff --git a/core/src/main/java/org/apache/calcite/sql/SqlUtil.java b/core/src/main/java/org/apache/calcite/sql/SqlUtil.java index 26362e9f415f..d5e0b7e41976 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlUtil.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlUtil.java @@ -842,6 +842,7 @@ public static String deriveAliasFromOrdinal(int ordinal) { /** * Whether the alias is generated by calcite. + * * @param alias not null * @return true if alias is generated by calcite, otherwise false */ diff --git a/core/src/main/java/org/apache/calcite/sql/SqlWindow.java b/core/src/main/java/org/apache/calcite/sql/SqlWindow.java index 848fad0d762a..198b9961c340 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlWindow.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlWindow.java @@ -47,7 +47,7 @@ /** * SQL window specification. * - *

                                                For example, the query

                                                + *

                                                For example, the query * *

                                                *
                                                SELECT sum(a) OVER (w ROWS 3 PRECEDING)
                                                @@ -57,7 +57,7 @@
                                                  * 
                                                * *

                                                declares windows w and w1, and uses a window in an OVER clause. It thus - * contains 3 {@link SqlWindow} objects.

                                                + * contains 3 {@link SqlWindow} objects. */ public class SqlWindow extends SqlCall { /** diff --git a/core/src/main/java/org/apache/calcite/sql/SqlWindowTableFunction.java b/core/src/main/java/org/apache/calcite/sql/SqlWindowTableFunction.java index a17a1eb181e9..f826fdce09b2 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlWindowTableFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlWindowTableFunction.java @@ -70,8 +70,8 @@ public class SqlWindowTableFunction extends SqlFunction * and two additional fields. The fields are as follows: * *
                                                  - *
                                                1. {@code window_start}: TIMESTAMP type to indicate a window's start - *
                                                2. {@code window_end}: TIMESTAMP type to indicate a window's end + *
                                                3. {@code window_start}: TIMESTAMP type to indicate a window's start + *
                                                4. {@code window_end}: TIMESTAMP type to indicate a window's end *
                                                */ public static final SqlReturnTypeInference ARG0_TABLE_FUNCTION_WINDOWING = diff --git a/core/src/main/java/org/apache/calcite/sql/SqlWithinGroupOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlWithinGroupOperator.java index d33594832287..f542c6b97aa0 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlWithinGroupOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlWithinGroupOperator.java @@ -34,7 +34,7 @@ /** * An operator that applies a sort operation before rows are included in an aggregate function. * - *

                                                Operands are as follows:

                                                + *

                                                Operands are as follows: * *

                                                  *
                                                • 0: a call to an aggregate function ({@link SqlCall}) diff --git a/core/src/main/java/org/apache/calcite/sql/SqlWriter.java b/core/src/main/java/org/apache/calcite/sql/SqlWriter.java index 9f8463230260..47a400f417e4 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlWriter.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlWriter.java @@ -106,7 +106,7 @@ enum FrameTypeEnum implements FrameType { /** * Function call or datatype declaration. * - *

                                                  Examples:

                                                  + *

                                                  Examples: *

                                                    *
                                                  • SUBSTRING('foobar' FROM 1 + 2 TO 4)
                                                  • *
                                                  • DECIMAL(10, 5)
                                                  • @@ -117,7 +117,7 @@ enum FrameTypeEnum implements FrameType { /** * Window specification. * - *

                                                    Examples:

                                                    + *

                                                    Examples: *

                                                      *
                                                    • SUM(x) OVER (ORDER BY hireDate ROWS 3 PRECEDING)
                                                    • *
                                                    • WINDOW w1 AS (ORDER BY hireDate), w2 AS (w1 PARTITION BY gender @@ -136,7 +136,7 @@ enum FrameTypeEnum implements FrameType { /** * ORDER BY list. * - *

                                                      Example:

                                                      + *

                                                      Example: *

                                                        *
                                                      • ORDER BY x, y DESC, z
                                                      • *
                                                      @@ -157,7 +157,7 @@ enum FrameTypeEnum implements FrameType { /** * OFFSET clause. * - *

                                                      Example:

                                                      + *

                                                      Example: *

                                                        *
                                                      • OFFSET 10 ROWS
                                                      • *
                                                      @@ -167,7 +167,7 @@ enum FrameTypeEnum implements FrameType { /** * FETCH clause. * - *

                                                      Example:

                                                      + *

                                                      Example: *

                                                        *
                                                      • FETCH FIRST 3 ROWS ONLY
                                                      • *
                                                      @@ -177,7 +177,7 @@ enum FrameTypeEnum implements FrameType { /** * GROUP BY list. * - *

                                                      Example:

                                                      + *

                                                      Example: *

                                                        *
                                                      • GROUP BY x, FLOOR(y)
                                                      • *
                                                      @@ -188,7 +188,7 @@ enum FrameTypeEnum implements FrameType { * Sub-query list. Encloses a SELECT, UNION, EXCEPT, INTERSECT query * with optional ORDER BY. * - *

                                                      Example:

                                                      + *

                                                      Example: *

                                                        *
                                                      • GROUP BY x, FLOOR(y)
                                                      • *
                                                      @@ -198,7 +198,7 @@ enum FrameTypeEnum implements FrameType { /** * Set operation. * - *

                                                      Example:

                                                      + *

                                                      Example: *

                                                        *
                                                      • SELECT * FROM a UNION SELECT * FROM b
                                                      • *
                                                      @@ -233,7 +233,7 @@ enum FrameTypeEnum implements FrameType { /** * Compound identifier. * - *

                                                      Example:

                                                      + *

                                                      Example: *

                                                        *
                                                      • "A"."B"."C"
                                                      • *
                                                      diff --git a/core/src/main/java/org/apache/calcite/sql/SqlWriterConfig.java b/core/src/main/java/org/apache/calcite/sql/SqlWriterConfig.java index 2e3f50a3925b..038201bbd150 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlWriterConfig.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlWriterConfig.java @@ -425,6 +425,7 @@ enum LineFolding { /** * Create a default SqlWriterConfig object. + * * @return The config. */ static SqlWriterConfig of() { diff --git a/core/src/main/java/org/apache/calcite/sql/TableCharacteristic.java b/core/src/main/java/org/apache/calcite/sql/TableCharacteristic.java index c4afe538435c..245a965494bc 100644 --- a/core/src/main/java/org/apache/calcite/sql/TableCharacteristic.java +++ b/core/src/main/java/org/apache/calcite/sql/TableCharacteristic.java @@ -23,7 +23,7 @@ /** * A table-valued input parameter of a table function is classified by three * characteristics. - + * *

                                                      The first characteristic is semantics. The table has either * row semantics or set semantics. * diff --git a/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisor.java b/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisor.java index b81170988dba..572cb8f159fe 100644 --- a/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisor.java +++ b/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisor.java @@ -225,6 +225,7 @@ public List getCompletionHints0(String sql, int cursor) { * Returns casing which is preferred for replacement. * For instance, {@code en => ename, EN => ENAME}. * When input has mixed case, {@code Casing.UNCHANGED} is returned. + * * @param word input word * @return preferred casing when replacing input word */ diff --git a/core/src/main/java/org/apache/calcite/sql/advise/package-info.java b/core/src/main/java/org/apache/calcite/sql/advise/package-info.java index 9ecc39e65742..2b2726e43053 100644 --- a/core/src/main/java/org/apache/calcite/sql/advise/package-info.java +++ b/core/src/main/java/org/apache/calcite/sql/advise/package-info.java @@ -19,7 +19,7 @@ * Provides hints and corrections for editing SQL statements. * *

                                                      The SQL statement might be partially-formed SQL statement or - * invalid. It is edited in a SQL editor user-interface.

                                                      + * invalid. It is edited in a SQL editor user-interface. * *

                                                      The advisor uses the validation and parser framework set up in * org.apache.calcite.sql.validate package. diff --git a/core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java b/core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java index f2a3f7fc2672..e7a91dea2e30 100644 --- a/core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java +++ b/core/src/main/java/org/apache/calcite/sql/dialect/BigQuerySqlDialect.java @@ -251,7 +251,7 @@ public BigQuerySqlDialect(SqlDialect.Context context) { /** * For usage of TRIM, LTRIM and RTRIM in BQ see * - * BQ Trim Function. + * BQ Trim Function. */ private static void unparseTrim(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) { diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlCaseOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlCaseOperator.java index ffb11eb07149..0c547fb87667 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlCaseOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlCaseOperator.java @@ -71,7 +71,7 @@ * *

                                                      The switched form of the CASE statement is normalized to the * simple form by inserting calls to the = operator. For - * example,

                                                      + * example, * *
                                                      CASE x + y
                                                        *   WHEN 1 THEN 'fee'
                                                      @@ -79,7 +79,7 @@
                                                        *   ELSE 'foe'
                                                        * END
                                                      * - *

                                                      becomes

                                                      + *

                                                      becomes * *

                                                      CASE
                                                        * WHEN Equals(x + y, 1) THEN 'fee'
                                                      @@ -88,9 +88,9 @@
                                                        * END
                                                      * *

                                                      REVIEW jhyde 2004/3/19 Does Equals handle NULL semantics - * correctly?

                                                      + * correctly? * - *

                                                      COALESCE(x, y, z) becomes

                                                      + *

                                                      COALESCE(x, y, z) becomes * *

                                                      CASE
                                                        * WHEN x IS NOT NULL THEN x
                                                      @@ -98,7 +98,7 @@
                                                        * ELSE z
                                                        * END
                                                      * - *

                                                      NULLIF(x, -1) becomes

                                                      + *

                                                      NULLIF(x, -1) becomes * *

                                                      CASE
                                                        * WHEN x = -1 THEN NULL
                                                      @@ -109,7 +109,7 @@
                                                        * This may make it more difficult to write optimizer rules (because the rules
                                                        * will have to deduce that expressions are equivalent). It also requires that
                                                        * some part of the planning process (probably the generator of the calculator
                                                      - * program) does common sub-expression elimination.

                                                      + * program) does common sub-expression elimination. * *

                                                      REVIEW jhyde 2004/3/19. Expanding expressions at parse time has some other * drawbacks. It is more difficult to give meaningful validation errors: given @@ -119,9 +119,9 @@ * but there's now no way to represent a call to COALESCE or NULLIF. All in all, * it would be better to have operators for COALESCE, NULLIF, and both simple * and switched forms of CASE, then translate to simple CASE when building the - * {@link org.apache.calcite.rex.RexNode} tree.

                                                      + * {@link org.apache.calcite.rex.RexNode} tree. * - *

                                                      The arguments are physically represented as follows:

                                                      + *

                                                      The arguments are physically represented as follows: * *

                                                        *
                                                      • The when expressions are stored in a {@link SqlNodeList} diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlJsonValueFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlJsonValueFunction.java index 878aefd3f331..5cc542bb49d7 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlJsonValueFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlJsonValueFunction.java @@ -88,7 +88,7 @@ public static List removeTypeSpecOperands(SqlCall call) { return SqlOperandCountRanges.between(2, 10); } - /** Returns the optional explicit returning type specification. **/ + /** Returns the optional explicit returning type specification. */ private static Optional explicitTypeSpec(SqlOperatorBinding opBinding) { if (opBinding.getOperandCount() > 2 && opBinding.isOperandLiteral(2, false) diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java index 01c16396c39d..4da7dd1e33bd 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java @@ -159,7 +159,7 @@ private SqlLibraryOperators() { OperandHandlers.of(SqlLibraryOperators::transformConvert)); /** Transforms a call binding of {@code CONVERT} to an equivalent binding for - * {@code CAST}. */ + * {@code CAST}. */ private static SqlCallBinding transformConvert(SqlOperatorBinding opBinding) { // Guaranteed to be a SqlCallBinding, with 2 or 3 arguments final SqlCallBinding binding = (SqlCallBinding) opBinding; @@ -168,7 +168,7 @@ private static SqlCallBinding transformConvert(SqlOperatorBinding opBinding) { } /** Transforms a call to {@code CONVERT} to an equivalent call to - * {@code CAST}. */ + * {@code CAST}. */ private static SqlCall transformConvert(SqlValidator validator, SqlCall call) { return SqlStdOperatorTable.CAST.createCall(call.getParserPosition(), call.operand(1), call.operand(0)); diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlMapQueryConstructor.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlMapQueryConstructor.java index 3daee8475154..bb8840889d11 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlMapQueryConstructor.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlMapQueryConstructor.java @@ -23,7 +23,7 @@ * Definition of the MAP query constructor, * MAP (<query>). * - *

                                                        Like the MAP type, not standard SQL.

                                                        + *

                                                        Like the MAP type, not standard SQL. */ public class SqlMapQueryConstructor extends SqlMultisetQueryConstructor { //~ Constructors ----------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlMapValueConstructor.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlMapValueConstructor.java index c0dc72b8072a..d3c4e5840ee1 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlMapValueConstructor.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlMapValueConstructor.java @@ -37,7 +37,7 @@ * Definition of the MAP constructor, * MAP [<key>, <value>, ...]. * - *

                                                        This is an extension to standard SQL.

                                                        + *

                                                        This is an extension to standard SQL. */ public class SqlMapValueConstructor extends SqlMultisetValueConstructor { public SqlMapValueConstructor() { diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetValueConstructor.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetValueConstructor.java index ccf681f3ee1c..8efd45a3eb3b 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetValueConstructor.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetValueConstructor.java @@ -42,7 +42,7 @@ * Definition of the SQL:2003 standard MULTISET constructor, MULTISET * [<expr>, ...]. * - *

                                                        Derived classes construct other kinds of collections.

                                                        + *

                                                        Derived classes construct other kinds of collections. * * @see SqlMultisetQueryConstructor */ diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java index 9332de3c5b2e..f24532095895 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java @@ -197,7 +197,7 @@ public class SqlStdOperatorTable extends ReflectiveSqlOperatorTable { public static final SqlSpecialOperator DEFAULT = new SqlDefaultOperator(); /** FILTER operator filters which rows are included in an - * aggregate function. */ + * aggregate function. */ public static final SqlFilterOperator FILTER = new SqlFilterOperator(); /** WITHIN_GROUP operator performs aggregations on ordered data input. */ @@ -1307,7 +1307,7 @@ public class SqlStdOperatorTable extends ReflectiveSqlOperatorTable { * <interval qualifier>

                                                      * *

                                                      This operator is special since it needs to hold the - * additional interval qualifier specification.

                                                      + * additional interval qualifier specification. */ public static final SqlDatetimeSubtractionOperator MINUS_DATE = new SqlDatetimeSubtractionOperator("-", ReturnTypes.ARG2_NULLABLE); @@ -1972,17 +1972,17 @@ public class SqlStdOperatorTable extends ReflectiveSqlOperatorTable { *

                                                      When the CAST operator is applies as a {@link SqlCall}, it has two * arguments: the expression and the type. The type must not include a * constraint, so CAST(x AS INTEGER NOT NULL), for instance, is - * invalid.

                                                      + * invalid. * *

                                                      When the CAST operator is applied as a RexCall, the * target type is simply stored as the return type, not an explicit operand. * For example, the expression CAST(1 + 2 AS DOUBLE) will * become a call to CAST with the expression 1 + 2 - * as its only operand.

                                                      + * as its only operand. * *

                                                      The RexCall form can also have a type which contains a * NOT NULL constraint. When this expression is implemented, if - * the value is NULL, an exception will be thrown.

                                                      + * the value is NULL, an exception will be thrown. */ public static final SqlFunction CAST = new SqlCastFunction(); @@ -2108,9 +2108,9 @@ public class SqlStdOperatorTable extends ReflectiveSqlOperatorTable { *

                                                      The SQL standard calls the ARRAY variant a * <array element reference>. Index is 1-based. The standard says * to raise "data exception - array element error" but we currently return - * null.

                                                      + * null. * - *

                                                      MAP is not standard SQL.

                                                      + *

                                                      MAP is not standard SQL. */ public static final SqlOperator ITEM = new SqlItemOperator("ITEM", OperandTypes.ARRAY_OR_MAP, 1, true); @@ -2162,11 +2162,11 @@ public class SqlStdOperatorTable extends ReflectiveSqlOperatorTable { * to keep types consistent. For example, ELEMENT(MULTISET [5]) * is translated to $ELEMENT_SLICE(MULTISET (VALUES ROW (5 * EXPR$0)) It is translated away when the multiset type is converted - * back to scalar values.

                                                      + * back to scalar values. * *

                                                      NOTE: jhyde, 2006/1/9: Usages of this operator are commented out, but * I'm not deleting the operator, because some multiset tests are disabled, - * and we may need this operator to get them working!

                                                      + * and we may need this operator to get them working! */ public static final SqlInternalOperator ELEMENT_SLICE = new SqlInternalOperator( diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlThrowOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlThrowOperator.java index ef4c8efac7dc..82245750cb22 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlThrowOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlThrowOperator.java @@ -27,10 +27,10 @@ * An internal operator that throws an exception. * *

                                                      The exception is thrown with a (localized) error message which is the only - * input parameter to the operator.

                                                      + * input parameter to the operator. * *

                                                      The return type is defined as a BOOLEAN to facilitate the use - * of it in constructs such as the following:

                                                      + * of it in constructs such as the following: * *
                                                      CASE
                                                      * WHEN <condition> THEN true
                                                      diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlTranslateFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlTranslateFunction.java index 82c1d2eb35e0..03ee525d6715 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlTranslateFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlTranslateFunction.java @@ -36,15 +36,18 @@ import static org.apache.calcite.util.Static.RESOURCE; /** - * Common base for the TRANSLATE(USING) and CONVERT(USING) function, - * which is different from {@link SqlLibraryOperators#TRANSLATE3} and {@link SqlLibraryOperators#MSSQL_CONVERT}. + * Common base for the TRANSLATE(USING) and + * CONVERT(USING) function, which is different from + * {@link SqlLibraryOperators#TRANSLATE3} and + * {@link SqlLibraryOperators#MSSQL_CONVERT}. + * *

                                                      The SQL syntax is * *

                                                        *   {@code TRANSLATE(characterString USING transcodingName)}
                                                        * 
                                                      * - * or + *

                                                      or * *

                                                        *   {@code CONVERT(characterString USING transcodingName)}
                                                      diff --git a/core/src/main/java/org/apache/calcite/sql/fun/package-info.java b/core/src/main/java/org/apache/calcite/sql/fun/package-info.java
                                                      index bfde0de26e5e..0bf59f39637c 100644
                                                      --- a/core/src/main/java/org/apache/calcite/sql/fun/package-info.java
                                                      +++ b/core/src/main/java/org/apache/calcite/sql/fun/package-info.java
                                                      @@ -25,6 +25,6 @@
                                                        * function; if other custom code is needed for an operator, it should be
                                                        * implemented in a top-level class within this package instead.  Operators
                                                        * which are not row-level (e.g. select and join) should be defined in package
                                                      - * {@link org.apache.calcite.sql} instead.

                                                      + * {@link org.apache.calcite.sql} instead. */ package org.apache.calcite.sql.fun; diff --git a/core/src/main/java/org/apache/calcite/sql/package-info.java b/core/src/main/java/org/apache/calcite/sql/package-info.java index 5f9131ad4a86..eb1e52b367bb 100644 --- a/core/src/main/java/org/apache/calcite/sql/package-info.java +++ b/core/src/main/java/org/apache/calcite/sql/package-info.java @@ -25,12 +25,12 @@ *

                                                      Parser

                                                      * *

                                                      {@link org.apache.calcite.sql.parser.SqlParser} parses a SQL string to a - * parse tree. It only performs the most basic syntactic validation.

                                                      + * parse tree. It only performs the most basic syntactic validation. * *

                                                      Object model

                                                      * *

                                                      Every node in the parse tree is a {@link org.apache.calcite.sql.SqlNode}. - * Sub-types are:

                                                      + * Sub-types are: *
                                                        * *
                                                      • {@link org.apache.calcite.sql.SqlLiteral} represents a boolean, @@ -56,7 +56,7 @@ * {@link org.apache.calcite.sql.SqlCall} into a SQL string. It is * important to note that operators are metadata, not data: there is only * one SqlOperator instance representing the '=' operator, even - * though there may be many calls to it.

                                                        + * though there may be many calls to it. * *

                                                        SqlOperator has several derived classes which make it easy to * define new operators: {@link org.apache.calcite.sql.SqlFunction}, @@ -69,11 +69,11 @@ * special operators even have their own sub-types of * {@link org.apache.calcite.sql.SqlCall}: * {@link org.apache.calcite.sql.SqlSelect} and - * {@link org.apache.calcite.sql.SqlJoin}.)

                                                        + * {@link org.apache.calcite.sql.SqlJoin}.) * *

                                                        A {@link org.apache.calcite.sql.SqlOperatorTable} is a collection of * operators. By supplying your own operator table, you can customize the - * dialect of SQL without modifying the parser.

                                                        + * dialect of SQL without modifying the parser. * *

                                                        Validation

                                                        * @@ -83,13 +83,13 @@ * {@link org.apache.calcite.sql.SqlOperatorTable} to describe the available * functions and operators, and a * {@link org.apache.calcite.sql.validate.SqlValidatorCatalogReader} for - * access to the database's catalog.

                                                        + * access to the database's catalog. * *

                                                        Generating SQL

                                                        * *

                                                        A {@link org.apache.calcite.sql.SqlWriter} converts a tree of * {@link org.apache.calcite.sql.SqlNode}s into a SQL string. A - * {@link org.apache.calcite.sql.SqlDialect} defines how this happens.

                                                        + * {@link org.apache.calcite.sql.SqlDialect} defines how this happens. */ @DefaultQualifier(value = NonNull.class, locations = TypeUseLocation.FIELD) @DefaultQualifier(value = NonNull.class, locations = TypeUseLocation.PARAMETER) diff --git a/core/src/main/java/org/apache/calcite/sql/parser/SqlParserImplFactory.java b/core/src/main/java/org/apache/calcite/sql/parser/SqlParserImplFactory.java index 4ad1d332db1d..d249bd2dda03 100644 --- a/core/src/main/java/org/apache/calcite/sql/parser/SqlParserImplFactory.java +++ b/core/src/main/java/org/apache/calcite/sql/parser/SqlParserImplFactory.java @@ -27,7 +27,7 @@ * *

                                                        A parser factory allows you to include a custom parser in * {@link org.apache.calcite.tools.Planner} created through - * {@link org.apache.calcite.tools.Frameworks}.

                                                        + * {@link org.apache.calcite.tools.Frameworks}. */ @FunctionalInterface public interface SqlParserImplFactory { diff --git a/core/src/main/java/org/apache/calcite/sql/parser/SqlParserPos.java b/core/src/main/java/org/apache/calcite/sql/parser/SqlParserPos.java index 00f57aef61b4..97c6b88bd19a 100644 --- a/core/src/main/java/org/apache/calcite/sql/parser/SqlParserPos.java +++ b/core/src/main/java/org/apache/calcite/sql/parser/SqlParserPos.java @@ -42,7 +42,7 @@ public class SqlParserPos implements Serializable { */ public static final SqlParserPos ZERO = new SqlParserPos(0, 0); - /** Same as {@link #ZERO} but always quoted. **/ + /** Same as {@link #ZERO} but always quoted. */ public static final SqlParserPos QUOTED_ZERO = new QuotedParserPos(0, 0, 0, 0); private static final long serialVersionUID = 1L; diff --git a/core/src/main/java/org/apache/calcite/sql/pretty/SqlPrettyWriter.java b/core/src/main/java/org/apache/calcite/sql/pretty/SqlPrettyWriter.java index 3a5d380e72b8..ee1c52d9b866 100644 --- a/core/src/main/java/org/apache/calcite/sql/pretty/SqlPrettyWriter.java +++ b/core/src/main/java/org/apache/calcite/sql/pretty/SqlPrettyWriter.java @@ -101,7 +101,7 @@ * *
                                        * - *
                                        Allowable types for RexLiteral instances
                                        {@link SqlWriterConfig#alwaysUseParentheses AlwaysUseParentheses}

                                        Whether to enclose all expressions in parentheses, even if the + *

                                        Whether to enclose all expressions in parentheses, even if the * operator has high enough precedence that the parentheses are not required. * *

                                        For example, the parentheses are required in the expression diff --git a/core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java b/core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java index e25e3b6c968c..09d23db838f4 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java +++ b/core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java @@ -832,13 +832,13 @@ public static SqlCall stripSeparator(SqlCall call) { * For example, * *

                                        concat(cast('a' as varchar(2)), cast('b' as varchar(3)),cast('c' as varchar(2))) - * returns varchar(7).

                                        + * returns varchar(7). * *

                                        concat(cast('a' as varchar), cast('b' as varchar(2), cast('c' as varchar(2)))) - * returns varchar.

                                        + * returns varchar. * *

                                        concat(cast('a' as varchar(65535)), cast('b' as varchar(2)), cast('c' as varchar(2))) - * returns varchar.

                                        + * returns varchar. */ public static final SqlReturnTypeInference MULTIVALENT_STRING_SUM_PRECISION = opBinding -> { diff --git a/core/src/main/java/org/apache/calcite/sql/type/SqlReturnTypeInferenceChain.java b/core/src/main/java/org/apache/calcite/sql/type/SqlReturnTypeInferenceChain.java index 825bb0133f19..6be969eef254 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/SqlReturnTypeInferenceChain.java +++ b/core/src/main/java/org/apache/calcite/sql/type/SqlReturnTypeInferenceChain.java @@ -41,7 +41,7 @@ public class SqlReturnTypeInferenceChain implements SqlReturnTypeInference { * Creates a SqlReturnTypeInferenceChain from an array of rules. * *

                                        Package-protected. - * Use {@link org.apache.calcite.sql.type.ReturnTypes#chain}.

                                        + * Use {@link org.apache.calcite.sql.type.ReturnTypes#chain}. */ SqlReturnTypeInferenceChain(SqlReturnTypeInference... rules) { Preconditions.checkArgument(rules.length > 1); diff --git a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java index 169e9e3577ed..2fdd95b34e58 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java +++ b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java @@ -181,6 +181,7 @@ public static List deriveAndCollectTypes( /** * Derives type of the call via its binding. + * * @param binding binding to derive the type from * @return datatype of the call */ @@ -191,6 +192,7 @@ public static RelDataType deriveType(SqlCallBinding binding) { /** * Derives type of the given call under given binding. + * * @param binding binding to derive the type from * @param node node type to derive * @return datatype of the given node @@ -203,6 +205,7 @@ public static RelDataType deriveType(SqlCallBinding binding, SqlNode node) { /** * Derives types for the list of nodes. + * * @param binding binding to derive the type from * @param nodes the list of nodes to derive types from * @return the list of types of the given nodes diff --git a/core/src/main/java/org/apache/calcite/sql/validate/GroupByScope.java b/core/src/main/java/org/apache/calcite/sql/validate/GroupByScope.java index 7db2e49224b7..951ecf86dc6a 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/GroupByScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/GroupByScope.java @@ -24,13 +24,13 @@ * Represents the name-resolution context for expressions in an GROUP BY clause. * *

                                        In some dialects of SQL, the GROUP BY clause can reference column aliases - * in the SELECT clause. For example, the query

                                        + * in the SELECT clause. For example, the query * *
                                        SELECT empno AS x
                                        * FROM emp
                                        * GROUP BY x
                                        * - *

                                        is valid.

                                        + *

                                        is valid. */ public class GroupByScope extends DelegatingScope { //~ Instance fields -------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/sql/validate/JoinScope.java b/core/src/main/java/org/apache/calcite/sql/validate/JoinScope.java index d73b16800ff3..af41321b56aa 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/JoinScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/JoinScope.java @@ -31,7 +31,7 @@ * *

                                        Consider "SELECT * FROM (A JOIN B ON {exp1}) JOIN C ON {exp2}". {exp1} is * resolved in the join scope for "A JOIN B", which contains A and B but not - * C.

                                        + * C. */ public class JoinScope extends ListScope { //~ Instance fields -------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/sql/validate/OrderByScope.java b/core/src/main/java/org/apache/calcite/sql/validate/OrderByScope.java index 0cbe802d33b5..87539e49d935 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/OrderByScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/OrderByScope.java @@ -34,13 +34,13 @@ * Represents the name-resolution context for expressions in an ORDER BY clause. * *

                                        In some dialects of SQL, the ORDER BY clause can reference column aliases - * in the SELECT clause. For example, the query

                                        + * in the SELECT clause. For example, the query * *
                                        SELECT empno AS x
                                        * FROM emp
                                        * ORDER BY x
                                        * - *

                                        is valid.

                                        + *

                                        is valid. */ public class OrderByScope extends DelegatingScope { //~ Instance fields -------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/sql/validate/OverScope.java b/core/src/main/java/org/apache/calcite/sql/validate/OverScope.java index 25bad3b31553..fd603199eb84 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/OverScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/OverScope.java @@ -28,7 +28,7 @@ * the parameters found on the left side of the over clause, and objects * inherited from the parent scope. * - *

                                        This object is both a {@link SqlValidatorScope} only. In the query

                                        + *

                                        This object is both a {@link SqlValidatorScope} only. In the query * *

                                        *
                                        SELECT name FROM (
                                        @@ -40,7 +40,7 @@
                                          * 
                                        * *

                                        We need to use the {@link OverScope} as a {@link SqlValidatorNamespace} - * when resolving names used in the window specification.

                                        + * when resolving names used in the window specification. */ public class OverScope extends ListScope { //~ Instance fields -------------------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SelectScope.java b/core/src/main/java/org/apache/calcite/sql/validate/SelectScope.java index 83306732c279..b35384a6eb84 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SelectScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SelectScope.java @@ -41,7 +41,7 @@ * * *

                                        This object is both a {@link SqlValidatorScope} and a - * {@link SqlValidatorNamespace}. In the query

                                        + * {@link SqlValidatorNamespace}. In the query * *
                                        *
                                        SELECT name FROM (
                                        @@ -51,11 +51,11 @@
                                          *
                                          * 

                                        we need to use the {@link SelectScope} as a * {@link SqlValidatorNamespace} when resolving 'name', and - * as a {@link SqlValidatorScope} when resolving 'gender'.

                                        + * as a {@link SqlValidatorScope} when resolving 'gender'. * *

                                        Scopes

                                        * - *

                                        In the query

                                        + *

                                        In the query * *

                                        *
                                        @@ -67,7 +67,7 @@
                                          * ORDER BY expr4
                                        *
                                        * - *

                                        The scopes available at various points of the query are as follows:

                                        + *

                                        The scopes available at various points of the query are as follows: * *

                                          *
                                        • expr1 can see t1, t2, q3
                                        • @@ -79,7 +79,7 @@ * *

                                          Namespaces

                                          * - *

                                          In the above query, there are 4 namespaces:

                                          + *

                                          In the above query, there are 4 namespaces: * *

                                            *
                                          • t1
                                          • diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java index 0a400da21a68..b8501f02f14a 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlConformance.java @@ -348,6 +348,7 @@ public interface SqlConformance { /** * Whether to allow SQL syntax "{@code ROW(expr1, expr2, expr3)}". + * *

                                            The equivalent syntax in standard SQL is * "{@code (expr1, expr2, expr3)}". * diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedAggFunction.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedAggFunction.java index 3384ec636512..d24d2d6df45d 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedAggFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedAggFunction.java @@ -35,7 +35,7 @@ * User-defined aggregate function. * *

                                            Created by the validator, after resolving a function call to a function - * defined in a Calcite schema.

                                            + * defined in a Calcite schema. */ public class SqlUserDefinedAggFunction extends SqlAggFunction { public final AggregateFunction function; diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java index b8717a60215c..1ff463eef666 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedFunction.java @@ -37,7 +37,7 @@ * User-defined scalar function. * *

                                            Created by the validator, after resolving a function call to a function - * defined in a Calcite schema.

                                            + * defined in a Calcite schema. */ public class SqlUserDefinedFunction extends SqlFunction { public final Function function; @@ -84,6 +84,7 @@ protected SqlUserDefinedFunction(SqlIdentifier opName, SqlKind kind, /** * Returns function that implements given operator call. + * * @return function that implements given operator call */ public Function getFunction() { diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableFunction.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableFunction.java index 9e811ea15b56..818e9fff52a5 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlUserDefinedTableFunction.java @@ -69,6 +69,7 @@ public SqlUserDefinedTableFunction(SqlIdentifier opName, SqlKind kind, /** * Returns function that implements given operator call. + * * @return function that implements given operator call */ @Override public TableFunction getFunction() { diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java index d20d9f4a49fe..23b8115c1b3a 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidator.java @@ -103,17 +103,17 @@ * which implement {@link SqlValidatorNamespace}, so don't try to cast your * namespace or use instanceof; use * {@link SqlValidatorNamespace#unwrap(Class)} and - * {@link SqlValidatorNamespace#isWrapperFor(Class)} instead.

                                            + * {@link SqlValidatorNamespace#isWrapperFor(Class)} instead. * *

                                            The validator builds the map by making a quick scan over the query when * the root {@link SqlNode} is first provided. Thereafter, it supplies the - * correct scope or namespace object when it calls validation methods.

                                            + * correct scope or namespace object when it calls validation methods. * *

                                            The methods {@link #getSelectScope}, {@link #getFromScope}, * {@link #getWhereScope}, {@link #getGroupScope}, {@link #getHavingScope}, * {@link #getOrderScope} and {@link #getJoinScope} get the correct scope * to resolve - * names in a particular clause of a SQL statement.

                                            + * names in a particular clause of a SQL statement. */ @Value.Enclosing public interface SqlValidator { @@ -363,7 +363,7 @@ RelDataType deriveType( *

                                            Note that the input exception is checked (it derives from * {@link Exception}) and the output exception is unchecked (it derives from * {@link RuntimeException}). This is intentional -- it should remind code - * authors to provide context for their validation errors.

                                            + * authors to provide context for their validation errors. * * @param node The place where the exception occurred, not null * @param e The validation error @@ -520,7 +520,7 @@ void setValidatedNodeType( * Returns the appropriate scope for validating a particular clause of a * SELECT statement. * - *

                                            Consider

                                            + *

                                            Consider * *

                                            SELECT *
                                                * FROM foo
                                            @@ -532,7 +532,7 @@ void setValidatedNodeType(
                                                *    GROUP BY deptno
                                                *    ORDER BY x)
                                            * - *

                                            What objects can be seen in each part of the sub-query?

                                            + *

                                            What objects can be seen in each part of the sub-query? * *

                                              *
                                            • In FROM ({@link #getFromScope} , you can only see 'foo'. @@ -960,6 +960,7 @@ public interface Config { } /** Returns the SQL conformance. + * * @deprecated Use {@link #conformance()} */ @Deprecated // to be removed before 2.0 default SqlConformance sqlConformance() { @@ -970,6 +971,7 @@ default SqlConformance sqlConformance() { Config withConformance(SqlConformance conformance); /** Sets the SQL conformance of the validator. + * * @deprecated Use {@link #conformance()} */ @Deprecated // to be removed before 2.0 default Config withSqlConformance(SqlConformance conformance) { diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java index 9e42e9dca9f1..b7ca08bcc6a4 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java @@ -1306,6 +1306,7 @@ private SqlValidatorScope getScopeOrThrow(SqlNode node) { /** * Namespace for the given node. + * * @param node node to compute the namespace for * @return namespace for the given node, never null * @see #getNamespace(SqlNode) @@ -1319,6 +1320,7 @@ SqlValidatorNamespace getNamespaceOrThrow(SqlNode node) { /** * Namespace for the given node. + * * @param node node to compute the namespace for * @param scope namespace scope * @return namespace for the given node, never null @@ -1334,6 +1336,7 @@ SqlValidatorNamespace getNamespaceOrThrow(SqlNode node, /** * Namespace for the given node. + * * @param id identifier to resolve * @param scope namespace scope * @return namespace for the given node, never null @@ -5029,7 +5032,7 @@ private void checkFieldCount(SqlNode node, SqlValidatorTable table, } /** Returns whether a query uses {@code DEFAULT} to populate a given - * column. */ + * column. */ private static boolean isValuesWithDefault(SqlNode source, int column) { switch (source.getKind()) { case VALUES: @@ -7482,15 +7485,15 @@ private enum Clause { * For example: * *
                                              {@code
                                              -     *  SELECT a + a as twoA
                                              -     *  GROUP BY twoA
                                              +     * SELECT a + a as twoA
                                              +     * GROUP BY twoA
                                                    * }
                                              * *

                                              turns into * *

                                              {@code
                                              -     *  SELECT a + a as twoA
                                              -     *  GROUP BY a + a
                                              +     * SELECT a + a as twoA
                                              +     * GROUP BY a + a
                                                    * }
                                              * *

                                              This is determined both by the clause and the config. diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorNamespace.java index 432b3fff1a5e..3de29d403e54 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorNamespace.java @@ -47,7 +47,7 @@ * {@link SqlValidatorNamespace}. Your SelectNamespace will be there somewhere, * but might be one or two levels deep. Don't try to cast the namespace or use * instanceof; use {@link SqlValidatorNamespace#unwrap(Class)} and - * {@link SqlValidatorNamespace#isWrapperFor(Class)} instead.

                                              + * {@link SqlValidatorNamespace#isWrapperFor(Class)} instead. * * @see SqlValidator * @see SqlValidatorScope @@ -87,11 +87,11 @@ public interface SqlValidatorNamespace { * Sets the type of this namespace. * *

                                              Allows the type for the namespace to be explicitly set, but usually is - * called during {@link #validate(RelDataType)}.

                                              + * called during {@link #validate(RelDataType)}. * *

                                              Implicitly also sets the row type. If the type is not a struct, then * the row type is the type wrapped as a struct with a single column, - * otherwise the type and row type are the same.

                                              + * otherwise the type and row type are the same. */ void setType(RelDataType type); @@ -105,10 +105,10 @@ public interface SqlValidatorNamespace { /** * Validates this namespace. * - *

                                              If the scope has already been validated, does nothing.

                                              + *

                                              If the scope has already been validated, does nothing. * *

                                              Please call {@link SqlValidatorImpl#validateNamespace} rather than - * calling this method directly.

                                              + * calling this method directly. * * @param targetRowType Desired row type, must not be null, may be the data * type 'unknown'. @@ -200,10 +200,10 @@ default boolean fieldExists(String name) { * *

                                              A {@code WITH}) clause defines table names that resolve to queries * (the body of the with-item). An {@link IdentifierNamespace} typically - * resolves to a {@link TableNamespace}.

                                              + * resolves to a {@link TableNamespace}. * *

                                              You must not call this method before {@link #validate(RelDataType)} has - * completed.

                                              */ + * completed. */ SqlValidatorNamespace resolve(); /** Returns whether this namespace is capable of giving results of the desired diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java index ef52904d0da3..ac53fe9de34d 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java @@ -214,7 +214,9 @@ public static ImmutableMap getIndexToFieldMap( } /** - * Gets the bit-set to the column ordinals in the source for columns that intersect in the target. + * Gets the bit-set to the column ordinals in the source for columns that + * intersect in the target. + * * @param sourceRowType The source upon which to ordinate the bit set. * @param targetRowType The target to overlay on the source to create the bit set. */ diff --git a/core/src/main/java/org/apache/calcite/sql/validate/WithScope.java b/core/src/main/java/org/apache/calcite/sql/validate/WithScope.java index fa9ff77454df..58d26a6f1e25 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/WithScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/WithScope.java @@ -27,14 +27,14 @@ /** Scope providing the objects that are available after evaluating an item * in a WITH clause. * - *

                                              For example, in

                                              + *

                                              For example, in * *

                                              {@code WITH t1 AS (q1) t2 AS (q2) q3}
                                              * *

                                              {@code t1} provides a scope that is used to validate {@code q2} * (and therefore {@code q2} may reference {@code t1}), * and {@code t2} provides a scope that is used to validate {@code q3} - * (and therefore q3 may reference {@code t1} and {@code t2}).

                                              + * (and therefore q3 may reference {@code t1} and {@code t2}). */ class WithScope extends ListScope { private final SqlWithItem withItem; diff --git a/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java b/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java index 04c3536b9672..e3a617648620 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java @@ -47,7 +47,7 @@ *
                                            * *

                                            REFERENCE: SQL-SERVER - * HIVE

                                            + * HIVE */ public interface TypeCoercion { /** diff --git a/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java b/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java index e51da487dcb8..23ae94f7ff84 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java @@ -175,9 +175,8 @@ public TypeCoercionImpl(RelDataTypeFactory typeFactory, SqlValidator validator) return coerced; } - /** - * For NUMERIC and STRING operands, cast STRING to data type of the other operand. - **/ + /** For NUMERIC and STRING operands, cast STRING to data type of the other + * operand. */ protected boolean binaryArithmeticWithStrings( SqlCallBinding binding, RelDataType left, @@ -211,7 +210,7 @@ protected boolean binaryArithmeticWithStrings( /** * Coerces operands in binary comparison expressions. * - *

                                            Rules:

                                            + *

                                            Rules: *

                                              *
                                            • For EQUALS(=) operator: 1. If operands are BOOLEAN and NUMERIC, evaluate * `1=true` and `0=false` all to be true; 2. If operands are datetime and string, @@ -268,7 +267,7 @@ protected boolean binaryArithmeticWithStrings( * If there are N(more than 2) operands, * finds the common type between two operands from left to right: * - *

                                              Rules:

                                              + *

                                              Rules: *

                                                  *   type1     type2    type3
                                                  *    |         |        |
                                              diff --git a/core/src/main/java/org/apache/calcite/sql/validate/implicit/package-info.java b/core/src/main/java/org/apache/calcite/sql/validate/implicit/package-info.java
                                              index 724ba17e511a..7e7c87c37698 100644
                                              --- a/core/src/main/java/org/apache/calcite/sql/validate/implicit/package-info.java
                                              +++ b/core/src/main/java/org/apache/calcite/sql/validate/implicit/package-info.java
                                              @@ -60,7 +60,7 @@
                                                * 

                                              The supported conversion contexts are: * Conversion Expressions * - *

                                              Strategies for Finding Common Type:

                                              + *

                                              Strategies for Finding Common Type: *

                                                *
                                              • If the operator has expected data types, just take them as the desired one. i.e. the UDF. *
                                              • diff --git a/core/src/main/java/org/apache/calcite/sql2rel/CorrelateProjectExtractor.java b/core/src/main/java/org/apache/calcite/sql2rel/CorrelateProjectExtractor.java index 3dc7ee839cda..2e8029ba3cbc 100644 --- a/core/src/main/java/org/apache/calcite/sql2rel/CorrelateProjectExtractor.java +++ b/core/src/main/java/org/apache/calcite/sql2rel/CorrelateProjectExtractor.java @@ -50,11 +50,13 @@ import java.util.Set; /** - * A visitor for relational expressions that extracts a {@link org.apache.calcite.rel.core.Project}, with a "simple" - * computation over the correlated variables, from the right side of a correlation - * ({@link org.apache.calcite.rel.core.Correlate}) and places it on the left side. + * A visitor for relational expressions that extracts a + * {@link org.apache.calcite.rel.core.Project}, with a "simple" computation over + * the correlated variables, from the right side of a correlation + * ({@link org.apache.calcite.rel.core.Correlate}) and places it on the left + * side. * - *

                                                Plan before

                                                + *

                                                Plan before *

                                                  * LogicalCorrelate(correlation=[$cor0], joinType=[left], requiredColumns=[{7}])
                                                  *   LogicalTableScan(table=[[scott, EMP]])
                                                @@ -62,7 +64,7 @@
                                                  *     LogicalTableScan(table=[[scott, DEPT]])
                                                  * 
                                                * - *

                                                Plan after

                                                + *

                                                Plan after *

                                                  * LogicalProject(EMPNO=[$0], ENAME=[$1], JOB=[$2], MGR=[$3],... DNAME=[$10], LOC=[$11])
                                                  *   LogicalCorrelate(correlation=[$cor0], joinType=[left], requiredColumns=[{8}])
                                                @@ -72,9 +74,10 @@
                                                  *       LogicalTableScan(table=[[scott, DEPT]])
                                                  * 
                                                * - *

                                                Essentially this transformation moves the computation over a correlated expression from the - * inner loop to the outer loop. It materializes the computation on the left side and flattens - * expressions on correlated variables on the right side.

                                                + *

                                                Essentially this transformation moves the computation over a correlated + * expression from the inner loop to the outer loop. It materializes the + * computation on the left side and flattens expressions on correlated variables + * on the right side. */ @API(since = "1.27", status = API.Status.EXPERIMENTAL) public final class CorrelateProjectExtractor extends RelHomogeneousShuttle { diff --git a/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java b/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java index d40f681799e7..af342d0f7ac0 100644 --- a/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java +++ b/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java @@ -131,7 +131,7 @@ * from joining the RelNode that produces the corExp with the RelNode that * references it. * - *

                                                TODO:

                                                + *

                                                TODO: *

                                                  *
                                                • replace {@code CorelMap} constructor parameter with a RelNode *
                                                • make {@link #currentRel} immutable (would require a fresh diff --git a/core/src/main/java/org/apache/calcite/sql2rel/SqlRexContext.java b/core/src/main/java/org/apache/calcite/sql2rel/SqlRexContext.java index 6be0882b8a57..468e50542d97 100644 --- a/core/src/main/java/org/apache/calcite/sql2rel/SqlRexContext.java +++ b/core/src/main/java/org/apache/calcite/sql2rel/SqlRexContext.java @@ -50,11 +50,13 @@ public interface SqlRexContext { * empty. * *

                                                  Returns 0 if the query is implicitly "GROUP BY ()" because of an - * aggregate expression. For example, "SELECT sum(sal) FROM emp".

                                                  + * aggregate expression. For example, "SELECT sum(sal) FROM emp". + * + *

                                                  Returns -1 if the query is not an aggregate query. * - *

                                                  Returns -1 if the query is not an aggregate query.

                                                  * @return 0 if the query is implicitly GROUP BY (), -1 if the query is not * and aggregate query + * * @see org.apache.calcite.sql.SqlOperatorBinding#getGroupCount() */ int getGroupCount(); diff --git a/core/src/main/java/org/apache/calcite/tools/FrameworkConfig.java b/core/src/main/java/org/apache/calcite/tools/FrameworkConfig.java index 40844f3b7939..68f727a318ff 100644 --- a/core/src/main/java/org/apache/calcite/tools/FrameworkConfig.java +++ b/core/src/main/java/org/apache/calcite/tools/FrameworkConfig.java @@ -103,12 +103,12 @@ public interface FrameworkConfig { * *

                                                  If the list is not null, the planner first de-registers any * existing {@link RelTraitDef}s, then registers the {@code RelTraitDef}s in - * this list.

                                                  + * this list. * *

                                                  The order of {@code RelTraitDef}s in the list matters if the * planner is VolcanoPlanner. The planner calls {@link RelTraitDef#convert} in * the order of this list. The most important trait comes first in the list, - * followed by the second most important one, etc.

                                                  + * followed by the second most important one, etc. */ @Nullable ImmutableList getTraitDefs(); diff --git a/core/src/main/java/org/apache/calcite/tools/Program.java b/core/src/main/java/org/apache/calcite/tools/Program.java index 0986f9bde50f..6a44d67f5097 100644 --- a/core/src/main/java/org/apache/calcite/tools/Program.java +++ b/core/src/main/java/org/apache/calcite/tools/Program.java @@ -30,8 +30,9 @@ * *

                                                  A planner is a sequence of programs, each of which is sometimes called * a "phase". - * The most typical program is an invocation of the volcano planner with a - * particular {@link org.apache.calcite.tools.RuleSet}.

                                                  + * + *

                                                  The most typical program is an invocation of the volcano planner with a + * particular {@link org.apache.calcite.tools.RuleSet}. */ public interface Program { RelNode run(RelOptPlanner planner, RelNode rel, diff --git a/core/src/main/java/org/apache/calcite/util/BarfingInvocationHandler.java b/core/src/main/java/org/apache/calcite/util/BarfingInvocationHandler.java index a02cf186c7f3..50db7bb4bfc2 100644 --- a/core/src/main/java/org/apache/calcite/util/BarfingInvocationHandler.java +++ b/core/src/main/java/org/apache/calcite/util/BarfingInvocationHandler.java @@ -29,7 +29,7 @@ * *

                                                  It is useful when you are prototyping code. You can rapidly create a * prototype class which implements the important methods in an interface, then - * implement other methods as they are called.

                                                  + * implement other methods as they are called. * * @see DelegatingInvocationHandler */ diff --git a/core/src/main/java/org/apache/calcite/util/BitSets.java b/core/src/main/java/org/apache/calcite/util/BitSets.java index 0ae561c46aef..da75bb4fb3a6 100644 --- a/core/src/main/java/org/apache/calcite/util/BitSets.java +++ b/core/src/main/java/org/apache/calcite/util/BitSets.java @@ -307,7 +307,7 @@ public static void populate(BitSet bitSet, Iterable list) { } /** Populates a {@link BitSet} from an - * {@link ImmutableIntList}. */ + * {@link ImmutableIntList}. */ public static void populate(BitSet bitSet, ImmutableIntList list) { for (int i = 0; i < list.size(); i++) { bitSet.set(list.getInt(i)); diff --git a/core/src/main/java/org/apache/calcite/util/Bug.java b/core/src/main/java/org/apache/calcite/util/Bug.java index 7bfe470ea0e9..1ca3a41fb63e 100644 --- a/core/src/main/java/org/apache/calcite/util/Bug.java +++ b/core/src/main/java/org/apache/calcite/util/Bug.java @@ -39,8 +39,7 @@ * the bug. When someone fixes the bug, they will remove the constant and all * usages of it. Also, the constant helps track the propagation of the fix: as * the fix is integrated into other branches, the constant will be removed from - * those branches.

                                                  - * + * those branches. */ public abstract class Bug { //~ Static fields/initializers --------------------------------------------- diff --git a/core/src/main/java/org/apache/calcite/util/ChunkList.java b/core/src/main/java/org/apache/calcite/util/ChunkList.java index 3d29197bb0b6..7f7ea16250ef 100644 --- a/core/src/main/java/org/apache/calcite/util/ChunkList.java +++ b/core/src/main/java/org/apache/calcite/util/ChunkList.java @@ -34,7 +34,7 @@ * in chunks of 32 elements. * *

                                                  ArrayList has O(n) insertion and deletion into the middle of the list. - * ChunkList insertion and deletion are O(1).

                                                  + * ChunkList insertion and deletion are O(1). * * @param element type */ diff --git a/core/src/main/java/org/apache/calcite/util/ControlFlowException.java b/core/src/main/java/org/apache/calcite/util/ControlFlowException.java index bdf19373d123..6da9df1c55c0 100644 --- a/core/src/main/java/org/apache/calcite/util/ControlFlowException.java +++ b/core/src/main/java/org/apache/calcite/util/ControlFlowException.java @@ -21,7 +21,7 @@ * use of exceptions which is to signal an error condition. * *

                                                  {@code ControlFlowException} does not populate its own stack trace, which - * makes instantiating one of these (or a sub-class) more efficient.

                                                  + * makes instantiating one of these (or a sub-class) more efficient. */ public class ControlFlowException extends RuntimeException { @Override public synchronized Throwable fillInStackTrace() { diff --git a/core/src/main/java/org/apache/calcite/util/Glossary.java b/core/src/main/java/org/apache/calcite/util/Glossary.java index 91f7c6c3aa0f..3ee9c8989cb2 100644 --- a/core/src/main/java/org/apache/calcite/util/Glossary.java +++ b/core/src/main/java/org/apache/calcite/util/Glossary.java @@ -22,7 +22,7 @@ * A collection of terms. * *

                                                  (This is not a real class. It is here so that terms which do not map to - * classes can be referenced in Javadoc.)

                                                  + * classes can be referenced in Javadoc.) */ public interface Glossary { //~ Static fields/initializers --------------------------------------------- @@ -31,7 +31,7 @@ public interface Glossary { /** *

                                                  This table shows how and where the Gang of Four patterns are applied. * The table uses information from the GoF book and from a course on - * advanced object design taught by Craig Larman.

                                                  + * advanced object design taught by Craig Larman. * *

                                                  The patterns are in three groups depicting frequency of use. The * patterns in light green are used @@ -40,7 +40,7 @@ public interface Glossary { * infrequently used. The GoF column gives the original Gang Of Four * category for the pattern. The Problem and Pattern columns are from * Craig's refinement of the type of problems they apply to and a refinement - * of the original three pattern categories.

                                                  + * of the original three pattern categories. * * * * * * * @@ -159,6 +161,7 @@ public interface Glossary { * * * @@ -249,6 +252,7 @@ public interface Glossary { * * * @@ -271,6 +275,7 @@ public interface Glossary { * * * @@ -361,7 +366,7 @@ public interface Glossary { *

                                                  Note that a common way of implementing a singleton, the so-called * double-checked locking pattern, is fatally flawed in Java. Don't use - * it!

                                                  + * it! */ @Nullable Glossary SINGLETON_PATTERN = null; diff --git a/core/src/main/java/org/apache/calcite/util/Holder.java b/core/src/main/java/org/apache/calcite/util/Holder.java index ebda064b924b..bc5567e8c07f 100644 --- a/core/src/main/java/org/apache/calcite/util/Holder.java +++ b/core/src/main/java/org/apache/calcite/util/Holder.java @@ -23,9 +23,9 @@ /** * A mutable slot that can contain one object. * - *

                                                  A holder is useful for implementing OUT or IN-OUT parameters.

                                                  + *

                                                  A holder is useful for implementing OUT or IN-OUT parameters. * - *

                                                  It is possible to sub-class to receive events on get or set.

                                                  + *

                                                  It is possible to sub-class to receive events on get or set. * * @param Element type */ diff --git a/core/src/main/java/org/apache/calcite/util/ImmutableBitSet.java b/core/src/main/java/org/apache/calcite/util/ImmutableBitSet.java index 0a46f1374845..cd688476f8f4 100644 --- a/core/src/main/java/org/apache/calcite/util/ImmutableBitSet.java +++ b/core/src/main/java/org/apache/calcite/util/ImmutableBitSet.java @@ -499,7 +499,7 @@ public int size() { * ordering. * *

                                                  Bit sets {@code (), (0), (0, 1), (0, 1, 3), (1), (2, 3)} are in sorted - * order.

                                                  + * order. */ @Override public int compareTo(ImmutableBitSet o) { int i = 0; diff --git a/core/src/main/java/org/apache/calcite/util/ImmutableNullableList.java b/core/src/main/java/org/apache/calcite/util/ImmutableNullableList.java index 2d88c11bf655..34b2ce948d1b 100644 --- a/core/src/main/java/org/apache/calcite/util/ImmutableNullableList.java +++ b/core/src/main/java/org/apache/calcite/util/ImmutableNullableList.java @@ -33,7 +33,7 @@ * An immutable list that may contain null values. * *

                                                  If the list cannot contain null values, use - * {@link com.google.common.collect.ImmutableList}.

                                                  + * {@link com.google.common.collect.ImmutableList}. * * @param Element type */ @@ -52,7 +52,7 @@ private ImmutableNullableList(E[] elements) { * *

                                                  Behavior as * {@link com.google.common.collect.ImmutableList#copyOf(java.util.Collection)} - * except that this list allows nulls.

                                                  + * except that this list allows nulls. */ public static List copyOf(Collection elements) { if (elements instanceof ImmutableNullableList @@ -107,7 +107,7 @@ public static List copyOf(Iterable elements) { * *

                                                  Behavior as * {@link com.google.common.collect.ImmutableList#copyOf(Object[])} - * except that this list allows nulls.

                                                  + * except that this list allows nulls. */ public static List copyOf(E[] elements) { // Check for nulls. diff --git a/core/src/main/java/org/apache/calcite/util/IntegerIntervalSet.java b/core/src/main/java/org/apache/calcite/util/IntegerIntervalSet.java index 00ad88c262aa..207af86e5733 100644 --- a/core/src/main/java/org/apache/calcite/util/IntegerIntervalSet.java +++ b/core/src/main/java/org/apache/calcite/util/IntegerIntervalSet.java @@ -66,7 +66,7 @@ private static void visit(String s, Handler handler) { * hyphen). For example, "1,2,3-20,-7,-10-15,12". * *

                                                  Inclusions and exclusions are performed in the order that they are - * seen. For example, "1-10,-2-9,3-7,-4-6"

                                                  does contain 3, because it is + * seen. For example, "1-10,-2-9,3-7,-4-6" does contain 3, because it is * included by "1-10", excluded by "-2-9" and last included by "3-7". But it * does not include 4. * diff --git a/core/src/main/java/org/apache/calcite/util/JsonBuilder.java b/core/src/main/java/org/apache/calcite/util/JsonBuilder.java index eeb59699cf45..600dbd14591d 100644 --- a/core/src/main/java/org/apache/calcite/util/JsonBuilder.java +++ b/core/src/main/java/org/apache/calcite/util/JsonBuilder.java @@ -108,7 +108,7 @@ public JsonBuilder putIf( * string. * *

                                                  We should use a JSON library such as Jackson when Mondrian needs - * one elsewhere.

                                                  + * one elsewhere. */ public String toJsonString(Object o) { StringBuilder buf = new StringBuilder(); diff --git a/core/src/main/java/org/apache/calcite/util/Pair.java b/core/src/main/java/org/apache/calcite/util/Pair.java index 01b07f9fd368..13660188405b 100644 --- a/core/src/main/java/org/apache/calcite/util/Pair.java +++ b/core/src/main/java/org/apache/calcite/util/Pair.java @@ -170,7 +170,7 @@ public static List> zip(List ks, ListThe length of the combined list is the lesser of the lengths of the - * source lists. But typically the source lists will be the same length.

                                                  + * source lists. But typically the source lists will be the same length. * * @param ks Left list * @param vs Right list @@ -198,7 +198,7 @@ public static List> zip( * Converts two iterables into an iterable of {@link Pair}s. * *

                                                  The resulting iterator ends whenever the first of the input iterators - * ends. But typically the source iterators will be the same length.

                                                  + * ends. But typically the source iterators will be the same length. * * @param ks Left iterable * @param vs Right iterable @@ -220,7 +220,7 @@ public static Iterable> zip( * *

                                                  The length of the combined list is the lesser of the lengths of the * source arrays. But typically the source arrays will be the same - * length.

                                                  + * length. * * @param ks Left array * @param vs Right array @@ -336,7 +336,7 @@ public static List right( /** * Returns an iterator that iterates over (i, i + 1) pairs in an iterable. * - *

                                                  For example, {@code adjacents([3, 5, 7])} returns [(3, 5), (5, 7)].

                                                  + *

                                                  For example, {@code adjacents([3, 5, 7])} returns [(3, 5), (5, 7)]. * * @param iterable Source collection * @param Element type @@ -356,7 +356,7 @@ public static Iterable> adjacents(final Iterable ite * Returns an iterator that iterates over (0, i) pairs in an iterable for * i > 0. * - *

                                                  For example, {@code firstAnd([3, 5, 7])} returns [(3, 5), (3, 7)].

                                                  + *

                                                  For example, {@code firstAnd([3, 5, 7])} returns [(3, 5), (3, 7)]. * * @param iterable Source collection * @param Element type diff --git a/core/src/main/java/org/apache/calcite/util/PartiallyOrderedSet.java b/core/src/main/java/org/apache/calcite/util/PartiallyOrderedSet.java index c77ac7f66b62..3689f8d8f61e 100644 --- a/core/src/main/java/org/apache/calcite/util/PartiallyOrderedSet.java +++ b/core/src/main/java/org/apache/calcite/util/PartiallyOrderedSet.java @@ -45,7 +45,7 @@ * *

                                                  When you create a partially-ordered set ('poset' for short) you must * provide an {@link Ordering} that determines the order relation. The - * ordering must be:

                                                  + * ordering must be: * *
                                                    *
                                                  • reflexive: e.lte(e) returns true;
                                                  • @@ -56,17 +56,17 @@ *
                                                  * *

                                                  Note that not all pairs of elements are related. It is OK if e.lte(f) - * returns false and f.lte(e) returns false also.

                                                  + * returns false and f.lte(e) returns false also. * *

                                                  In addition to the usual set methods, there are methods to determine the * immediate parents and children of an element in the set, and method to find * all elements which have no parents or no children (i.e. "root" and "leaf" - * elements).

                                                  + * elements). * *

                                                  A lattice is a special kind of poset where there is a unique top and * bottom element. You can use a PartiallyOrderedSet for a lattice also. It may * be helpful to add the top and bottom elements to the poset on - * construction.

                                                  + * construction. * * @param Element type */ @@ -806,7 +806,7 @@ private List descendants(E e, boolean up) { *

                                                  We deliberately do not override {@link #hashCode} or * {@link #equals(Object)}. A canonizing map ensures that within a * given PartiallyOrderedSet, two nodes are identical if and only if they - * contain the same value.

                                                  + * contain the same value. * * @param Element type */ @@ -848,14 +848,14 @@ private static class TopBottomNode extends Node { * *

                                                  To obey the constraints of the partially-ordered set, the function * must be consistent with the reflexive, anti-symmetric, and transitive - * properties required by a partially ordered set.

                                                  + * properties required by a partially ordered set. * *

                                                  For instance, if {@code ordering(foo, foo)} returned false for any - * not-null value of foo, it would violate the reflexive property.

                                                  + * not-null value of foo, it would violate the reflexive property. * *

                                                  If an ordering violates any of these required properties, the behavior * of a {@link PartiallyOrderedSet} is unspecified. (But mayhem is - * likely.)

                                                  + * likely.) * * @param Element type */ diff --git a/core/src/main/java/org/apache/calcite/util/Permutation.java b/core/src/main/java/org/apache/calcite/util/Permutation.java index 4a7cc2709c7e..b7ddf3b217e5 100644 --- a/core/src/main/java/org/apache/calcite/util/Permutation.java +++ b/core/src/main/java/org/apache/calcite/util/Permutation.java @@ -269,7 +269,7 @@ public void set(int source, int target, boolean allowResize) { /** * Inserts into the targets. * - *

                                                  For example, consider the permutation

                                                  + *

                                                  For example, consider the permutation * *

                                                  @@ -122,6 +122,7 @@ public interface Glossary { *
                                                  Access Control
                                                  *   *
                                                  + * *

                                                  Structural Decomposition of Objects or Subsystems

                                                  Wrap ManySingleton with Traversal Algorithm
                                                  *   *
                                                  + * *

                                                  Access Control

                                                  Low Coupling-Event Response
                                                  *   *
                                                  + * *

                                                  Organization or Communication of Work

                                                  Low Coupling-Single Algorithm
                                                  *   *
                                                  + * *

                                                  Organization or Communication of Work

                                                  Low Coupling-Interaction between Objects
                                                  *   *
                                                  + * *

                                                  Organization or Communication of Work

                                                  Low Coupling-
                                                  * @@ -292,7 +292,7 @@ public void set(int source, int target, boolean allowResize) { *
                                                  Example permutation
                                                  * *

                                                  After applying insertTarget(2) every target 2 or higher is - * shifted up one.

                                                  + * shifted up one. * * * @@ -317,7 +317,7 @@ public void set(int source, int target, boolean allowResize) { *
                                                  Mapping after applying insertTarget(2)
                                                  * *

                                                  Note that the array has been extended to accommodate the new target, and - * the previously unmapped source 5 is mapped to the unused target slot 2.

                                                  + * the previously unmapped source 5 is mapped to the unused target slot 2. * * @param x Ordinal of position to add to target */ @@ -337,7 +337,7 @@ public void insertTarget(int x) { /** * Inserts into the sources. * - *

                                                  Behavior is analogous to {@link #insertTarget(int)}.

                                                  + *

                                                  Behavior is analogous to {@link #insertTarget(int)}. * * @param x Ordinal of position to add to source */ diff --git a/core/src/main/java/org/apache/calcite/util/PrecedenceClimbingParser.java b/core/src/main/java/org/apache/calcite/util/PrecedenceClimbingParser.java index 1f9ff227e81c..7eb5ed698914 100644 --- a/core/src/main/java/org/apache/calcite/util/PrecedenceClimbingParser.java +++ b/core/src/main/java/org/apache/calcite/util/PrecedenceClimbingParser.java @@ -238,6 +238,7 @@ public static class Token { /** * Returns {@code o}. + * * @return o */ public @Nullable Object o() { diff --git a/core/src/main/java/org/apache/calcite/util/ReflectiveVisitDispatcher.java b/core/src/main/java/org/apache/calcite/util/ReflectiveVisitDispatcher.java index 0de673514237..6f55e0267180 100644 --- a/core/src/main/java/org/apache/calcite/util/ReflectiveVisitDispatcher.java +++ b/core/src/main/java/org/apache/calcite/util/ReflectiveVisitDispatcher.java @@ -80,7 +80,7 @@ public interface ReflectiveVisitDispatcherVisit method lookup follows the same rules as if compile-time resolution * for VisitorClass.visit(VisiteeClass) were performed. An ambiguous match due * to multiple interface inheritance results in an IllegalArgumentException. A - * non-match is indicated by returning false.

                                                  + * non-match is indicated by returning false. * * @param visitor object whose visit method is to be invoked * @param visitee object to be passed as a parameter to the visit diff --git a/core/src/main/java/org/apache/calcite/util/Static.java b/core/src/main/java/org/apache/calcite/util/Static.java index b000e69785d4..f31e40627739 100644 --- a/core/src/main/java/org/apache/calcite/util/Static.java +++ b/core/src/main/java/org/apache/calcite/util/Static.java @@ -33,7 +33,7 @@ *
                                                • Code that uses these objects will be terser. *
                                                * - *

                                                Cons:

                                                + *

                                                Cons: *

                                                  *
                                                • Namespace pollution, *
                                                • code that is difficult to understand (a general problem with static diff --git a/core/src/main/java/org/apache/calcite/util/TimestampString.java b/core/src/main/java/org/apache/calcite/util/TimestampString.java index 559df8805d8b..478bb0d51845 100644 --- a/core/src/main/java/org/apache/calcite/util/TimestampString.java +++ b/core/src/main/java/org/apache/calcite/util/TimestampString.java @@ -63,7 +63,7 @@ public TimestampString(String v) { } /** Creates a TimestampString for year, month, day, hour, minute, second, - * millisecond values. */ + * millisecond values. */ public TimestampString(int year, int month, int day, int h, int m, int s) { this(ymdhms(new StringBuilder(), year, month, day, h, m, s).toString()); } diff --git a/core/src/main/java/org/apache/calcite/util/TimestampWithTimeZoneString.java b/core/src/main/java/org/apache/calcite/util/TimestampWithTimeZoneString.java index 7a0baeec0c60..752fa12f25c7 100644 --- a/core/src/main/java/org/apache/calcite/util/TimestampWithTimeZoneString.java +++ b/core/src/main/java/org/apache/calcite/util/TimestampWithTimeZoneString.java @@ -58,8 +58,8 @@ public TimestampWithTimeZoneString(String v) { this.v = v; } - /** Creates a TimestampWithTimeZoneString for year, month, day, hour, minute, second, - * millisecond values in the given time-zone. */ + /** Creates a TimestampWithTimeZoneString for year, month, day, hour, minute, + * second, millisecond values in the given time-zone. */ public TimestampWithTimeZoneString(int year, int month, int day, int h, int m, int s, String timeZone) { this(DateTimeStringUtils.ymdhms(new StringBuilder(), year, month, day, h, m, s).toString() diff --git a/core/src/main/java/org/apache/calcite/util/UnmodifiableArrayList.java b/core/src/main/java/org/apache/calcite/util/UnmodifiableArrayList.java index 02fb2d1e6d97..afc3f0ac5637 100644 --- a/core/src/main/java/org/apache/calcite/util/UnmodifiableArrayList.java +++ b/core/src/main/java/org/apache/calcite/util/UnmodifiableArrayList.java @@ -24,12 +24,12 @@ * A view onto an array that cannot be modified by the client. * *

                                                  Since the array is not copied, modifications to the array will be - * reflected in the list.

                                                  + * reflected in the list. * - *

                                                  Null elements are allowed.

                                                  + *

                                                  Null elements are allowed. * *

                                                  Quick and low-memory, like {@link java.util.Arrays#asList(Object[])}, but - * unmodifiable.

                                                  + * unmodifiable. * * @param Element type */ diff --git a/core/src/main/java/org/apache/calcite/util/Util.java b/core/src/main/java/org/apache/calcite/util/Util.java index 0d76d416bf5b..788d62f319c6 100644 --- a/core/src/main/java/org/apache/calcite/util/Util.java +++ b/core/src/main/java/org/apache/calcite/util/Util.java @@ -134,7 +134,7 @@ private Util() {} *

                                                  In general, you should not use this in expected results of tests. * Expected results should be the expected result on Linux (or Mac OS) using * '\n'. Apply {@link Util#toLinux(String)} to Windows actual results, if - * necessary, to make them look like Linux actual.

                                                  + * necessary, to make them look like Linux actual. */ public static final String LINE_SEPARATOR = System.getProperty("line.separator"); @@ -508,7 +508,7 @@ public static void print( * prints "x\"y". * *

                                                  The appendable where the value is printed must not incur I/O operations. This method is - * not meant to be used for writing the values to permanent storage.

                                                  + * not meant to be used for writing the values to permanent storage. * * @throws IllegalStateException if the print to the specified appendable fails due to I/O */ @@ -689,16 +689,16 @@ public static String stripDoubleQuotes(String value) { * *

                                                  The mapping is one-to-one (that is, distinct strings will produce * distinct java identifiers). The mapping is also reversible, but the - * inverse mapping is not implemented.

                                                  + * inverse mapping is not implemented. * *

                                                  A valid Java identifier must start with a Unicode letter, underscore, * or dollar sign ($). The other characters, if any, can be a Unicode - * letter, underscore, dollar sign, or digit.

                                                  + * letter, underscore, dollar sign, or digit. * *

                                                  This method uses an algorithm similar to URL encoding. Valid * characters are unchanged; invalid characters are converted to an * underscore followed by the hex code of the character; and underscores are - * doubled.

                                                  + * doubled. * *

                                                  Examples: * @@ -747,6 +747,7 @@ public static String toJavaId( /** * Returns true when input string is a valid Java identifier. + * * @param s input string * @return true when input string is a valid Java identifier */ @@ -946,8 +947,10 @@ public static void throwIfUnchecked(Throwable throwable) { /** * This method rethrows input throwable as is (if its unchecked) or * wraps it with {@link RuntimeException} and throws. - *

                                                  The typical usage would be {@code throw throwAsRuntime(...)}, where {@code throw} statement - * is needed so Java compiler knows the execution stops at that line.

                                                  + * + *

                                                  The typical usage would be {@code throw throwAsRuntime(...)}, where + * {@code throw} statement is needed so Java compiler knows the execution + * stops at that line. * * @param throwable input throwable * @return the method never returns, it always throws an unchecked exception @@ -959,10 +962,12 @@ public static RuntimeException throwAsRuntime(Throwable throwable) { } /** - * This method rethrows input throwable as is (if its unchecked) with an extra message or - * wraps it with {@link RuntimeException} and throws. - *

                                                  The typical usage would be {@code throw throwAsRuntime(...)}, where {@code throw} statement - * is needed so Java compiler knows the execution stops at that line.

                                                  + * This method rethrows input throwable as is (if its unchecked) with an extra + * message or wraps it with {@link RuntimeException} and throws. + * + *

                                                  The typical usage would be {@code throw throwAsRuntime(...)}, where + * {@code throw} statement is needed so Java compiler knows the execution + * stops at that line. * * @param throwable input throwable * @return the method never returns, it always throws an unchecked exception @@ -1000,6 +1005,7 @@ public static RuntimeException toUnchecked(Exception e) { /** * Returns cause of the given throwable if it is non-null or the throwable itself. + * * @param throwable input throwable * @return cause of the given throwable if it is non-null or the throwable itself */ @@ -1475,7 +1481,7 @@ public static Iterable tokenize(final String s, final String delim) { *

                                                • 'time' has the same format as 'offset', and defaults to 02:00:00.
                                                • *
                                                * - *

                                                For example:

                                                + *

                                                For example: * *

                                                  *
                                                • "PST-8PDT01:00:00,M4.1.0/02:00:00,M10.1.0/02:00:00"; or more tersely @@ -2001,11 +2007,11 @@ public static synchronized > T enumVal(T default_, * starting at element {@code k}. * *

                                                  It is OK if the list is empty or its size is not a multiple of - * {@code n}.

                                                  + * {@code n}. * *

                                                  For instance, {@code quotientList(list, 2, 0)} returns the even * elements of a list, and {@code quotientList(list, 2, 1)} returns the odd - * elements. Those lists are the same length only if list has even size.

                                                  + * elements. Those lists are the same length only if list has even size. */ public static List quotientList( final List list, final int n, final int k) { @@ -2372,7 +2378,7 @@ public static List stringToList(String s) { /** Converts a number into human-readable form, with 3 digits and a "K", "M" * or "G" multiplier for thousands, millions or billions. * - *

                                                  Examples: -2, 0, 1, 999, 1.00K, 1.99K, 3.45M, 4.56B.

                                                  + *

                                                  Examples: -2, 0, 1, 999, 1.00K, 1.99K, 3.45M, 4.56B. */ public static String human(double d) { if (d == 0d) { diff --git a/core/src/main/java/org/apache/calcite/util/XmlOutput.java b/core/src/main/java/org/apache/calcite/util/XmlOutput.java index 8fef221e861a..f802621a5a42 100644 --- a/core/src/main/java/org/apache/calcite/util/XmlOutput.java +++ b/core/src/main/java/org/apache/calcite/util/XmlOutput.java @@ -36,7 +36,7 @@ *

                                                  Use this class to write XML to any streaming source. * While the class itself is unstructured and doesn't enforce any DTD * specification, use of the class - * does ensure that the output is syntactically valid XML.

                                                  + * does ensure that the output is syntactically valid XML. */ public class XmlOutput { @@ -246,6 +246,7 @@ public void beginNode() { * Completes a tag. This outputs the end tag corresponding to the * last exposed beginTag. The tag name must match the name of the * corresponding beginTag. + * * @param tagName the name of the end tag to write. */ public void endTag(String tagName) { @@ -432,7 +433,7 @@ public void content(@Nullable String content) { } /** - * Write header. Use default version 1.0. + * Write header. Use default version 1.0. */ public void header() { out.println(""); @@ -475,6 +476,7 @@ private static void printAtt(PrintWriter pw, String name, @Nullable String val) * Encode a String for XML output, displaying it to a PrintWriter. * The String to be encoded is displayed, except that * special characters are converted into entities. + * * @param input a String to convert. * @param out a PrintWriter to which to write the results. */ @@ -510,7 +512,7 @@ private static String escapeForQuoting(String val) { * CDATA section. Note that MSXML has a nasty bug whereby whitespace * characters outside of a CDATA section are lost when parsing. To * avoid hitting this bug, this method treats many whitespace characters - * as "special".

                                                  + * as "special". * * @param input the String to scan for XML special characters. * @return true if the String contains any such characters. @@ -543,7 +545,7 @@ private static boolean stringHasXMLSpecials(String input) { * state. Call {@link #defineEscape} as many times as necessary to set up * mappings, and then call {@link #makeImmutable} before * actually applying the defined transform. Or, - * use one of the global mappings pre-defined here.

                                                  + * use one of the global mappings pre-defined here. */ static class StringEscaper implements Cloneable { private @Nullable List<@Nullable String> translationVector; diff --git a/core/src/main/java/org/apache/calcite/util/format/FormatElement.java b/core/src/main/java/org/apache/calcite/util/format/FormatElement.java index ef5c2305107c..8346088ac481 100644 --- a/core/src/main/java/org/apache/calcite/util/format/FormatElement.java +++ b/core/src/main/java/org/apache/calcite/util/format/FormatElement.java @@ -37,7 +37,7 @@ public interface FormatElement { * *

                                                  Note that certain FormatElements may not have a Java equivalent. * In such cases, calling this method will throw an {@link UnsupportedOperationException}. - * See {@link FormatElementEnum#Q} as an example.

                                                  + * See {@link FormatElementEnum#Q} as an example. */ void toPattern(StringBuilder sb) throws UnsupportedOperationException; diff --git a/core/src/main/java/org/apache/calcite/util/graph/Graphs.java b/core/src/main/java/org/apache/calcite/util/graph/Graphs.java index adf094c7dc4d..de230db779fd 100644 --- a/core/src/main/java/org/apache/calcite/util/graph/Graphs.java +++ b/core/src/main/java/org/apache/calcite/util/graph/Graphs.java @@ -116,7 +116,7 @@ public static class FrozenGraph { * Returns an iterator of all paths between two nodes, * in non-decreasing order of path lengths. * - *

                                                  The current implementation is not optimal.

                                                  + *

                                                  The current implementation is not optimal. */ public List> getPaths(V from, V to) { List> list = new ArrayList<>(); @@ -130,6 +130,7 @@ public List> getPaths(V from, V to) { /** * Returns the shortest distance between two points, -1, if there is no path. + * * @param from From * @param to To * @return The shortest distance, -1, if there is no path. diff --git a/core/src/main/java/org/apache/calcite/util/mapping/IntPair.java b/core/src/main/java/org/apache/calcite/util/mapping/IntPair.java index e73bc47fa8cf..1c64c9e978b1 100644 --- a/core/src/main/java/org/apache/calcite/util/mapping/IntPair.java +++ b/core/src/main/java/org/apache/calcite/util/mapping/IntPair.java @@ -127,7 +127,7 @@ public static List zip(List lefts, * Converts two lists into a list of {@link IntPair}s. * *

                                                  The length of the combined list is the lesser of the lengths of the - * source lists. But typically the source lists will be the same length.

                                                  + * source lists. But typically the source lists will be the same length. * * @param lefts Left list * @param rights Right list diff --git a/core/src/main/java/org/apache/calcite/util/mapping/Mappings.java b/core/src/main/java/org/apache/calcite/util/mapping/Mappings.java index a9bf7d9b1a7e..c476a96edbce 100644 --- a/core/src/main/java/org/apache/calcite/util/mapping/Mappings.java +++ b/core/src/main/java/org/apache/calcite/util/mapping/Mappings.java @@ -313,7 +313,8 @@ public static List permute(final List list, * {@code mapping.getTarget(source)} and {@code list.size()} is * {@code mapping.getSourceCount()}. * - *

                                                  Converse of {@link #target(List, int)}

                                                  + *

                                                  Converse of {@link #target(List, int)}. + * * @see #asListNonNull(TargetMapping) */ @CheckReturnValue @@ -335,9 +336,10 @@ public static List permute(final List list, * {@code mapping.getTarget(source)} and {@code list.size()} is * {@code mapping.getSourceCount()}. * - *

                                                  The resulting list never contains null elements

                                                  + *

                                                  The resulting list never contains null elements. + * + *

                                                  Converse of {@link #target(List, int)}. * - *

                                                  Converse of {@link #target(List, int)}

                                                  * @see #asList(TargetMapping) */ @CheckReturnValue @@ -423,7 +425,7 @@ public static Mapping target(List sources, int sourceCount) { /** Creates a bijection. * - *

                                                  Throws if sources and targets are not one to one.

                                                  */ + *

                                                  Throws if sources and targets are not one to one. */ public static Mapping bijection(List targets) { return new Permutation(Ints.toArray(targets)); } @@ -481,14 +483,14 @@ public static boolean keepsOrdering(TargetMapping mapping) { /** * Creates a mapping that consists of a set of contiguous ranges. * - *

                                                  For example,

                                                  + *

                                                  For example, * *

                                                  createShiftMapping(60,
                                                      *     100, 0, 3,
                                                      *     200, 50, 5);
                                                      * 
                                                  * - *

                                                  creates

                                                  + *

                                                  creates * * * @@ -545,7 +547,7 @@ public static TargetMapping createShiftMapping( /** * Creates a mapping by appending two mappings. * - *

                                                  Sources and targets of the second mapping are shifted to the right.

                                                  + *

                                                  Sources and targets of the second mapping are shifted to the right. * *

                                                  For example,

                                                  append({0:0, 1:1}, {0:0, 1:1, 2:2})
                                                  yields *
                                                  {0:0, 1:1, 2:2, 3:3, 4:4}
                                                  . diff --git a/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java b/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java index 89ab31519745..0988544f9315 100644 --- a/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java +++ b/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java @@ -29,7 +29,7 @@ /** * Example of using Calcite via JDBC. * - *

                                                  Schema is specified programmatically.

                                                  + *

                                                  Schema is specified programmatically. */ public class JdbcExample { public static void main(String[] args) throws Exception { diff --git a/core/src/test/java/org/apache/calcite/rex/RexProgramBuilderBase.java b/core/src/test/java/org/apache/calcite/rex/RexProgramBuilderBase.java index 5273a86ebbf4..bc2b51da2958 100644 --- a/core/src/test/java/org/apache/calcite/rex/RexProgramBuilderBase.java +++ b/core/src/test/java/org/apache/calcite/rex/RexProgramBuilderBase.java @@ -234,7 +234,7 @@ protected RexNode case_(Iterable nodes) { /** * Creates a call to the CAST operator. * - *

                                                  This method enables to create {@code CAST(42 nullable int)} expressions.

                                                  + *

                                                  This method enables to create {@code CAST(42 nullable int)} expressions. * * @param e input node * @param type type to cast to @@ -250,7 +250,7 @@ protected RexNode abstractCast(RexNode e, RelDataType type) { * *

                                                  Tries to expand the cast, and therefore the result may be something * other than a {@link RexCall} to the CAST operator, such as a - * {@link RexLiteral}.

                                                  + * {@link RexLiteral}. * @param e input node * @param type type to cast to @@ -514,6 +514,7 @@ private void assertArgValue(int arg) { /** * Creates {@code nullable boolean variable} with index of 0. * If you need several distinct variables, use {@link #vBool(int)} + * * @return nullable boolean variable with index of 0 */ protected RexNode vBool() { diff --git a/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackLinqMiddleTest.java b/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackLinqMiddleTest.java index 48293f65152b..e57783734a41 100644 --- a/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackLinqMiddleTest.java +++ b/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackLinqMiddleTest.java @@ -111,7 +111,7 @@ class JdbcFrontJdbcBackLinqMiddleTest { * into input0.x = input1.x and ... input0.z = input1.z. * *

                                                  Currently, the query can be planned, but the plan is not efficient (uses - * cartesian product).

                                                  + * cartesian product). */ @Disabled("non-deterministic on JDK 1.7 vs 1.8") @Test void testJoinTheta() { diff --git a/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackTest.java b/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackTest.java index c8a9e1a68dbb..4bb84046b6fb 100644 --- a/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackTest.java +++ b/core/src/test/java/org/apache/calcite/test/JdbcFrontJdbcBackTest.java @@ -38,7 +38,7 @@ * *

                                                  The idea is that as much as possible of the query is pushed down * to the JDBC data source, in the form of a large (and hopefully efficient) - * SQL statement.

                                                  + * SQL statement. * * @see JdbcFrontJdbcBackLinqMiddleTest */ diff --git a/core/src/test/java/org/apache/calcite/test/JdbcFrontLinqBackTest.java b/core/src/test/java/org/apache/calcite/test/JdbcFrontLinqBackTest.java index 5554c7195c4b..ad95e5f06e41 100644 --- a/core/src/test/java/org/apache/calcite/test/JdbcFrontLinqBackTest.java +++ b/core/src/test/java/org/apache/calcite/test/JdbcFrontLinqBackTest.java @@ -119,7 +119,7 @@ public class JdbcFrontLinqBackTest { * Simple UNION, plus ORDER BY. * *

                                                  Also tests a query that returns a single column. We optimize this case - * internally, using non-array representations for rows.

                                                  + * internally, using non-array representations for rows. */ @Test void testUnionAllOrderBy() { hr() diff --git a/core/src/test/java/org/apache/calcite/test/JdbcTest.java b/core/src/test/java/org/apache/calcite/test/JdbcTest.java index 866fc8bbc2c7..9a7dbf43f22e 100644 --- a/core/src/test/java/org/apache/calcite/test/JdbcTest.java +++ b/core/src/test/java/org/apache/calcite/test/JdbcTest.java @@ -561,25 +561,25 @@ private void addTableMacro(Connection connection, Method method) throws SQLExcep } /** Tests a JDBC connection that provides a model that contains a table - * macro. */ + * macro. */ @Test void testTableMacroInModel() throws Exception { checkTableMacroInModel(Smalls.TableMacroFunction.class); } /** Tests a JDBC connection that provides a model that contains a table - * macro defined as a static method. */ + * macro defined as a static method. */ @Test void testStaticTableMacroInModel() throws Exception { checkTableMacroInModel(Smalls.StaticTableMacroFunction.class); } /** Tests a JDBC connection that provides a model that contains a table - * function. */ + * function. */ @Test void testTableFunctionInModel() throws Exception { checkTableFunctionInModel(Smalls.MyTableFunction.class); } /** Tests a JDBC connection that provides a model that contains a table - * function defined as a static method. */ + * function defined as a static method. */ @Test void testStaticTableFunctionInModel() throws Exception { checkTableFunctionInModel(Smalls.TestStaticTableFunction.class); } @@ -1577,7 +1577,7 @@ private void checkResultSetMetaData(Connection connection, String sql) *

                                                  With * [CALCITE-127] * EnumerableCalcRel can't support 3+ AND conditions, the last condition - * is ignored and rows with deptno=10 are wrongly returned.

                                                  + * is ignored and rows with deptno=10 are wrongly returned. */ @Test void testAnd3() { CalciteAssert.hr() @@ -2836,7 +2836,7 @@ private void checkNullableTimestamp(CalciteAssert.Config config) { * into a VARCHAR column the behavior would be different; the literals * would be converted into VARCHAR(3) values and the implied cast from * CHAR(1) to CHAR(3) that appends trailing spaces does not occur. See - * "contextually typed value specification" in the SQL spec.

                                                  + * "contextually typed value specification" in the SQL spec. */ @Test void testValuesComposite() { CalciteAssert.that() @@ -4635,7 +4635,7 @@ private void startOfGroupStep3(String startOfGroup) { * [CALCITE-285] * Window functions throw exception without ORDER BY. * - *

                                                  Note:

                                                  + *

                                                  Note: * *

                                                    *
                                                  • With no ORDER BY, the window is over all rows in the partition. diff --git a/core/src/test/java/org/apache/calcite/test/LatticeTest.java b/core/src/test/java/org/apache/calcite/test/LatticeTest.java index 030b72b496ee..75c3d9b676e3 100644 --- a/core/src/test/java/org/apache/calcite/test/LatticeTest.java +++ b/core/src/test/java/org/apache/calcite/test/LatticeTest.java @@ -420,7 +420,7 @@ private static CalciteAssert.AssertThat modelWithLattices( } /** A query that uses a pre-defined aggregate table, at the same - * granularity but fewer calls to aggregate functions. */ + * granularity but fewer calls to aggregate functions. */ @Test void testLatticeWithPreDefinedTilesFewerMeasures() { foodmartModelWithOneTile() .query("select t.\"the_year\", t.\"quarter\", count(*) as c\n" diff --git a/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java b/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java index 68f5ae9abac4..d24b7a26749a 100644 --- a/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java +++ b/core/src/test/java/org/apache/calcite/test/RelBuilderTest.java @@ -136,7 +136,7 @@ /** * Unit test for {@link RelBuilder}. * - *

                                                    Tasks:

                                                    + *

                                                    Tasks: *

                                                      *
                                                    1. Add RelBuilder.scan(List<String>)
                                                    2. *
                                                    3. Add RelBuilder.scan(Table)
                                                    4. diff --git a/core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java b/core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java index 6bbedf8e7504..150fa85f25c0 100644 --- a/core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java +++ b/core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java @@ -534,7 +534,8 @@ private static boolean skipItem(RexNode expr) { } /** As {@link #testJoinDeriveIsNotNullFilterRule1()}; - * should not create IS NOT NULL filter if join condition is not strong wrt each key. */ + * should not create IS NOT NULL filter if join condition is not strong wrt + * each key. */ @Test void testJoinDeriveIsNotNullFilterRule13() { final String sql = "select t1.deptno from empnullables t1 inner join\n" + "empnullables t2 on coalesce(t1.ename, t2.ename) = 'abc'"; @@ -542,7 +543,8 @@ private static boolean skipItem(RexNode expr) { } /** As {@link #testJoinDeriveIsNotNullFilterRule1()}; - * should not create IS NOT NULL filter if join condition is not strong wrt each key. */ + * should not create IS NOT NULL filter if join condition is not strong wrt + * each key. */ @Test void testJoinDeriveIsNotNullFilterRule14() { final String sql = "select t1.deptno from empnullables t1 inner join\n" + "empnullables t2 on nvl(t1.ename, t2.ename) = 'abc'"; @@ -553,7 +555,7 @@ private static boolean skipItem(RexNode expr) { } /** As {@link #testJoinDeriveIsNotNullFilterRule1()}; - * should create IS NOT NULL filter only for the first operand of NULLIF. */ + * should create IS NOT NULL filter only for the first operand of NULLIF. */ @Test void testJoinDeriveIsNotNullFilterRule15() { final String sql = "select t1.deptno from empnullables t1 inner join\n" + "empnullables t2 on nullif(t1.ename, t2.ename) = 'abc'"; @@ -1499,7 +1501,7 @@ private void checkSemiOrAntiJoinProjectTranspose(JoinRelType type) { } /** Tests implementing multiple distinct count the new way, using GROUPING - * SETS. */ + * SETS. */ @Test void testDistinctCountMultiple() { final String sql = "select deptno, count(distinct ename),\n" + " count(distinct job)\n" @@ -3273,7 +3275,7 @@ private void checkReduceNullableToNotNull(ReduceExpressionsRule rule) { } /** Test case that reduces a nullable expression to a NOT NULL literal that - * is cast to nullable. */ + * is cast to nullable. */ @Test void testReduceNullableToNotNull() { checkReduceNullableToNotNull(CoreRules.PROJECT_REDUCE_EXPRESSIONS); } @@ -7822,13 +7824,13 @@ private void checkJoinAssociateRuleWithTopAlwaysTrueCondition(boolean allowAlway } } - /** - * Test case for [CALCITE-4652] - * AggregateExpandDistinctAggregatesRule must cast top aggregates to original type. - *

                                                      - * Checks AggregateExpandDistinctAggregatesRule when return type of the SUM aggregate - * is changed (expanded) by define custom type factory. - */ + /** Test case for + * [CALCITE-4652] + * AggregateExpandDistinctAggregatesRule must cast top aggregates to original + * type. + * + *

                                                      Checks AggregateExpandDistinctAggregatesRule when return type of the SUM + * aggregate is changed (expanded) by define custom type factory. */ @Test void testDistinctCountWithExpandSumType() { // Define new type system to expand SUM return type. RelDataTypeSystemImpl typeSystem = new RelDataTypeSystemImpl() { @@ -7861,13 +7863,13 @@ private void checkJoinAssociateRuleWithTopAlwaysTrueCondition(boolean allowAlway .check(); } - /** - * Test case for [CALCITE-4818] - * AggregateExpandDistinctAggregatesRule must infer correct data type for top aggregate calls. - *

                                                      - * Checks AggregateExpandDistinctAggregatesRule when return type of the SUM aggregate - * is changed (expanded) by define custom type factory. - */ + /** Test case for + * [CALCITE-4818] + * AggregateExpandDistinctAggregatesRule must infer correct data type for top + * aggregate calls. + * + *

                                                      Checks AggregateExpandDistinctAggregatesRule when return type of the SUM + * aggregate is changed (expanded) by define custom type factory. */ @Test void testSumAndDistinctSumWithExpandSumType() { // Define new type system to expand SUM return type. RelDataTypeSystemImpl typeSystem = new RelDataTypeSystemImpl() { diff --git a/core/src/test/java/org/apache/calcite/test/SqlHintsConverterTest.java b/core/src/test/java/org/apache/calcite/test/SqlHintsConverterTest.java index 6eec68fdb6e2..ff4b549fa0b0 100644 --- a/core/src/test/java/org/apache/calcite/test/SqlHintsConverterTest.java +++ b/core/src/test/java/org/apache/calcite/test/SqlHintsConverterTest.java @@ -717,7 +717,7 @@ static MockEnumerableJoinRule create(RelHint hint) { } } - /** A visitor to validate a hintable node has specific hint. **/ + /** A visitor to validate a hintable node has specific hint. */ private static class ValidateHintVisitor extends RelVisitor { private final RelHint expectedHint; private final Class clazz; diff --git a/core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java b/core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java index 0c2c910f28f4..5c825720eff3 100644 --- a/core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java +++ b/core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java @@ -452,8 +452,11 @@ public static void checkActualAndReferenceFiles() { * Incorrect plan in with with ROLLUP inside GROUPING SETS. * *

                                                      Equivalence example: + * *

                                                      GROUP BY GROUPING SETS (ROLLUP(A, B), CUBE(C,D))
                                                      + * *

                                                      is equal to + * *

                                                      GROUP BY GROUPING SETS ((A,B), (A), (), * (C,D), (C), (D) )
                                                      */ diff --git a/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java b/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java index fc19a17aca0e..538333dfeec5 100644 --- a/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java +++ b/core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java @@ -2760,10 +2760,9 @@ protected void checkTimeUnitCodes(Map timeUnitCodes) { invalidCodes.forEach(invalidConsumer); } - /** Checks parsing of built-in functions that accept time unit - * Checks WEEK(WEEKDAY) - *

                                                      Override if your parser supports more such functions. */ - @Test void checkWeekdayCustomTimeFrames() { + /** Tests parsing of built-in functions that accept time unit + * "WEEK(WEEKDAY)". */ + @Test void testWeekdayCustomTimeFrames() { SqlValidatorFixture f = fixture() .withOperatorTable(operatorTableFor(SqlLibrary.BIG_QUERY)); diff --git a/core/src/test/java/org/apache/calcite/test/concurrent/ConcurrentTestCommandGenerator.java b/core/src/test/java/org/apache/calcite/test/concurrent/ConcurrentTestCommandGenerator.java index 01b63bf5e4fe..7015f1e689a9 100644 --- a/core/src/test/java/org/apache/calcite/test/concurrent/ConcurrentTestCommandGenerator.java +++ b/core/src/test/java/org/apache/calcite/test/concurrent/ConcurrentTestCommandGenerator.java @@ -46,18 +46,18 @@ * ({@link ConcurrentTestCommandExecutor}). * *

                                                      Typical actions include preparing a SQL statement for execution, executing - * the statement and verifying its result set, and closing the statement.

                                                      + * the statement and verifying its result set, and closing the statement. * *

                                                      A single ConcurrentTestCommandGenerator creates commands for * multiple threads. Each thread is represented by an integer "thread ID". * Thread IDs may take on any positive integer value and may be a sparse set - * (e.g. 1, 2, 5).

                                                      + * (e.g. 1, 2, 5). * *

                                                      When each command is created, it is associated with a thread and given an * execution order. Execution order values are positive integers, must be unique - * within a thread, and may be a sparse set.

                                                      + * within a thread, and may be a sparse set. * - *

                                                      There are no restrictions on the order of command creation.

                                                      + *

                                                      There are no restrictions on the order of command creation. */ public class ConcurrentTestCommandGenerator { private static final char APOS = '\''; @@ -207,7 +207,7 @@ public ConcurrentTestCommand addPrepareCommand( * *

                                                      Expected data format: { 'row1, col1 value', 'row1, col2 * value', ... }, { 'row2, col1 value', 'row2, col2 value', ... }, - * ...

                                                      + * ... * *
                                                        *
                                                      • For string data: enclose value in apostrophes, use doubled apostrophe diff --git a/core/src/test/java/org/apache/calcite/test/concurrent/package-info.java b/core/src/test/java/org/apache/calcite/test/concurrent/package-info.java index 64510274cae6..c00e80a859ca 100644 --- a/core/src/test/java/org/apache/calcite/test/concurrent/package-info.java +++ b/core/src/test/java/org/apache/calcite/test/concurrent/package-info.java @@ -25,11 +25,11 @@ * own thread as a separate jdbc client (ie a separate * java.sql.Connection). There are facilties to synchronize these * command threads. Only a simple command sequence is supported: no branching, - * no looping.

                                                        + * no looping. * *

                                                        An alternative is to define a test by writing a test script in * mtsql format, as described below. An instance of - * ConcurrentCommandScript parses and executes a script.

                                                        + * ConcurrentCommandScript parses and executes a script. * *

                                                        Script Format

                                                        * @@ -72,20 +72,20 @@ *

                                                        Synchronization:

                                                        * *

                                                        The threads are synchronized by inserting synchronization points - * (@sync).

                                                        + * (@sync). * *

                                                        When a thread reaches a @sync, it waits until all threads are waiting * on the same @sync: then all threads proceed. @sync points have no * names. Clearly all thread sections must contain the same number of @sync - * points.

                                                        + * points. * *

                                                        The directive @lockstep has the same effect as adding a @sync * after each command in every thread section. Clearly it requires that all * thread sections have the same number of commands. The default is the antonym - * @nolockstep.

                                                        + * @nolockstep. * *

                                                        The directive @disable means "skip this script". The deault is the - * antonym @enable.

                                                        + * antonym @enable. * * *

                                                        Error handling:

                                                        @@ -96,12 +96,12 @@ * section it can be toggled using the sql directive !SET FORCE * val, where val can be true, false, on, off. (This * is modelled after sqlline and sqllineClient. Other sqlline - * !-directives are ignored.)

                                                        + * !-directives are ignored.) * *

                                                        An error in a thread section will stop that thread, but the other threads * continue (with one fewer partner to synchronize with), and finally the * cleanup section runs. If the setup section quits, then only the cleanup - * section is run.

                                                        + * section is run. * *

                                                        Basic Commands (allowed in any section):

                                                        * @@ -189,13 +189,13 @@ *

                                                        The initial value of a script variable VAR is taken from the shell * environment variable of the same name. The value can be set to a * different value when the script is run, by employing a phrase - * VAR=VALUE on the mtsql command line.

                                                        + * VAR=VALUE on the mtsql command line. * *

                                                        Stand-Alone Tool

                                                        * *

                                                        A command-line tool that runs an mtsql script against a specified JDBC * connection,a nd prints the query results. (But see @print command to - * filter the output.)

                                                        + * filter the output.) * *

                                                        Usage: mtsql [-qvg] -u SERVER -d DRIVER [-n USER] [-p PASSWORD] * [VAR=VALUE]* SCRIPT [SCRIPT]*
                                                        @@ -205,7 +205,7 @@ * -u SERVER : sets the target; a JDBC URL.
                                                        * -d DRIVER : sets the jdbc driver; a class on the classpath
                                                        * VAR=VALUE : binds the script variable VAR to the VALUE; VAR must be - * declared at the beginning of the script(s) in a @var command.

                                                        + * declared at the beginning of the script(s) in a @var command. * * *

                                                        Example Script

                                                        diff --git a/core/src/test/java/org/apache/calcite/tools/PlannerTest.java b/core/src/test/java/org/apache/calcite/tools/PlannerTest.java index ac3256118b63..92464f6aa39f 100644 --- a/core/src/test/java/org/apache/calcite/tools/PlannerTest.java +++ b/core/src/test/java/org/apache/calcite/tools/PlannerTest.java @@ -1546,10 +1546,8 @@ private void checkView(String sql, Matcher matcher) assertValidPlan(sql, DelegatingTypeSystem.DEFAULT, is(expectedDefault)); } - /** - * Asserts a Planner generates the correct plan using the provided - * type system. - */ + /** Asserts that a Planner generates the correct plan using the + * provided type system. */ private void assertValidPlan(String sql, RelDataTypeSystem typeSystem, Matcher planMatcher) throws SqlParseException, ValidationException, RelConversionException { diff --git a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java index 5628e935a06c..2550aa03c8cf 100644 --- a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java +++ b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java @@ -241,7 +241,7 @@ public static DruidQuery extendQuery(DruidQuery query, query.druidTable, intervals, query.rels, query.getOperatorConversionMap()); } - /** Check if it is needed to use UTC for DATE and TIMESTAMP types. **/ + /** Check if it is needed to use UTC for DATE and TIMESTAMP types. */ private static boolean needUtcTimeExtract(RexNode rexNode) { return rexNode.getType().getSqlTypeName() == SqlTypeName.DATE || rexNode.getType().getSqlTypeName() == SqlTypeName.TIMESTAMP diff --git a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidSqlOperatorConverter.java b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidSqlOperatorConverter.java index 974cb52090fd..f84a2ad63184 100644 --- a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidSqlOperatorConverter.java +++ b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidSqlOperatorConverter.java @@ -38,6 +38,7 @@ public interface DruidSqlOperatorConverter { /** * Translate rexNode to valid Druid expression. + * * @param rexNode rexNode to translate to Druid expression * @param rowType row type associated with rexNode * @param druidQuery druid query used to figure out configs/fields related like timeZone diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchConstants.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchConstants.java index a2afb68f0ec6..2146ae6bdd9a 100644 --- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchConstants.java +++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchConstants.java @@ -43,6 +43,7 @@ interface ElasticsearchConstants { /** * Detects {@code select * from elastic} types of field name (select star). + * * @param name name of the field * @return {@code true} if this field represents whole raw, {@code false} otherwise */ diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchJson.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchJson.java index d316eb863034..c717a661dc36 100644 --- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchJson.java +++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchJson.java @@ -218,6 +218,7 @@ static class Result { /** * Constructor for this instance. + * * @param hits list of matched documents * @param took time taken (in took) for this query to execute */ @@ -397,6 +398,7 @@ Object valueOrNull(String name) { /** * Returns property from nested maps given a path like {@code a.b.c}. + * * @param map current map * @param path field path(s), optionally with dots ({@code a.b.c}). * @return value located at path {@code path} or {@code null} if not found. @@ -622,6 +624,7 @@ Map values() { /** * For single value. Returns single value represented by this leaf aggregation. + * * @return value corresponding to {@code value} */ Object value() { diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRel.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRel.java index db8aa4f24f11..95ab036331c5 100644 --- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRel.java +++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRel.java @@ -50,18 +50,21 @@ class Implementor { /** * Sorting clauses. + * * @see Sort */ final List> sort = new ArrayList<>(); /** * Elastic aggregation ({@code MIN / MAX / COUNT} etc.) statements (functions). + * * @see aggregations */ final List> aggregations = new ArrayList<>(); /** * Allows bucketing documents together. Similar to {@code select ... from table group by field1} + * * @see Bucket Aggregrations */ final List groupBy = new ArrayList<>(); @@ -77,12 +80,14 @@ class Implementor { /** * Starting index (default {@code 0}). Equivalent to {@code start} in ES query. + * * @see From/Size */ Long offset; /** * Number of records to return. Equivalent to {@code size} in ES query. + * * @see From/Size */ Long fetch; diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRules.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRules.java index 00685af824b8..9f542c4e4dae 100644 --- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRules.java +++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchRules.java @@ -62,6 +62,7 @@ private ElasticsearchRules() {} /** * Returns 'string' if it is a call to item['string'], null otherwise. + * * @param call current relational expression * @return literal value */ diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSearchResult.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSearchResult.java index 8784be3375b9..29fb4a059fcb 100644 --- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSearchResult.java +++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSearchResult.java @@ -39,6 +39,7 @@ public class ElasticsearchSearchResult { /** * Constructor for this instance. + * * @param hits list of matched documents * @param took time taken (in took) for this query to execute */ diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java index 419cc430319e..dd57b5e0797e 100644 --- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java +++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java @@ -350,6 +350,7 @@ private ElasticsearchTable getTable() { } /** Called via code-generation. + * * @param ops list of queries (as strings) * @param fields projection * @see ElasticsearchMethod#ELASTICSEARCH_QUERYABLE_FIND diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTableScan.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTableScan.java index 39cc693c3a10..668bdd68e499 100644 --- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTableScan.java +++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTableScan.java @@ -39,7 +39,7 @@ * Relational expression representing a scan of an Elasticsearch type. * *

                                                        Additional operations might be applied, - * using the "find" method.

                                                        + * using the "find" method. */ public class ElasticsearchTableScan extends TableScan implements ElasticsearchRel { private final ElasticsearchTable elasticsearchTable; diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchToEnumerableConverter.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchToEnumerableConverter.java index 99d6b5f289c4..3e0c03718267 100644 --- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchToEnumerableConverter.java +++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchToEnumerableConverter.java @@ -113,6 +113,7 @@ public class ElasticsearchToEnumerableConverter extends ConverterImpl implements /** E.g. {@code constantArrayList("x", "y")} returns * "Arrays.asList('x', 'y')". + * * @param values list of values * @param clazz runtime class representing each element in the list * @param type of elements in the list @@ -125,6 +126,7 @@ private static MethodCallExpression constantArrayList(List values, Class /** E.g. {@code constantList("x", "y")} returns * {@code {ConstantExpression("x"), ConstantExpression("y")}}. + * * @param values list of elements * @param type of elements inside this list * @return list of constant expressions diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTransport.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTransport.java index ef10225617df..d24278ae99fc 100644 --- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTransport.java +++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTransport.java @@ -228,6 +228,7 @@ Function search(final Map /** * Parses HTTP response into some class using jackson API. + * * @param result type */ private static class JsonParserFn implements Function { diff --git a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/PredicateAnalyzer.java b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/PredicateAnalyzer.java index f2f65e33696e..95d829f4d562 100644 --- a/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/PredicateAnalyzer.java +++ b/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/PredicateAnalyzer.java @@ -209,6 +209,7 @@ private static boolean supportedRexCall(RexCall call) { * 3) Sarg is real Range( > 1 and <= 10). * In this case the search call should be translated to rang Query * Currently only the 1) and 2) cases are supported. + * * @param search SEARCH RexCall * @return true if it isSearchWithPoints or isSearchWithComplementedPoints, other false */ @@ -486,6 +487,7 @@ boolean isSwapped() { * cause an exception to be thrown. For example, we currently do not support * comparing a literal to another literal as convention {@code 5 = 5}. Nor do we support * comparing named fields to other named fields as convention {@code $0 = $1}. + * * @param left left expression * @param right right expression */ @@ -887,6 +889,7 @@ private SimpleQueryExpression(NamedFieldExpression rel) { /** * By default, range queries on date/time need use the format of the source to parse the literal. * So we need to specify that the literal has "date_time" format + * * @param literal literal value * @param rangeQueryBuilder query builder to optionally add {@code format} expression * @return existing builder with possible {@code format} attribute diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ElasticSearchAdapterTest.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ElasticSearchAdapterTest.java index 88f73e9595b1..1936a833f528 100644 --- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ElasticSearchAdapterTest.java +++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ElasticSearchAdapterTest.java @@ -72,6 +72,7 @@ class ElasticSearchAdapterTest { /** * Used to create {@code zips} index and insert zip data in bulk. + * * @throws Exception when instance setup failed */ @BeforeAll diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchNode.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchNode.java index e1b80c13eef8..a47b704a762b 100644 --- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchNode.java +++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchNode.java @@ -71,10 +71,13 @@ private static EmbeddedElasticsearchNode create(Settings settings) { } /** - * Creates elastic node as single member of a cluster. Node will not be started - * unless {@link #start()} is explicitly called. - *

                                                        Need {@code synchronized} because of static caches inside ES (which are not thread safe). - * @return instance which needs to be explicitly started (using {@link #start()}) + * Creates elastic node as single member of a cluster. Node will not + * be started unless {@link #start()} is explicitly called. + * + *

                                                        Need {@code synchronized} because of static caches inside ES + * (which are not thread safe). + * + * @return instance; needs to be explicitly started using {@link #start()} */ public static synchronized EmbeddedElasticsearchNode create() { File data; @@ -115,6 +118,7 @@ public void start() { /** * Returns current address to connect to with HTTP client. + * * @return hostname/port for HTTP connection */ public TransportAddress httpAddress() { diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchPolicy.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchPolicy.java index c1fca5a7dbe4..38029c32fc75 100644 --- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchPolicy.java +++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/EmbeddedElasticsearchPolicy.java @@ -38,28 +38,30 @@ import java.util.Objects; /** - * Used to initialize a single elastic node. For performance reasons (node startup costs), - * same instance is shared across multiple tests (Elasticsearch does not allow multiple - * instances per JVM). + * Used to initialize a single Elasticsearch node. For performance reasons (node + * startup costs), same instance is shared across multiple tests (Elasticsearch + * does not allow multiple instances per JVM). * *

                                                        This rule should be used as follows: *

                                                        - *  public class MyTest {
                                                        - *    public static final EmbeddedElasticsearchPolicy RULE = EmbeddedElasticsearchPolicy.create();
                                                        + * public class MyTest {
                                                        + *   public static final EmbeddedElasticsearchPolicy RULE =
                                                        + *       EmbeddedElasticsearchPolicy.create();
                                                          *
                                                        - *    @BeforeClass
                                                        - *    public static void setup() {
                                                        - *       // ... populate instance
                                                        - *       // The collections must have different names so the tests could be executed concurrently
                                                        - *    }
                                                        + *   @BeforeClass
                                                        + *   public static void setup() {
                                                        + *      // ... populate instance
                                                        + *      // The collections must have different names so the tests could be
                                                        + *      // executed concurrently
                                                        + *   }
                                                          *
                                                        - *    @Test
                                                        - *    public void myTest() {
                                                        - *      RestClient client = RULE.restClient();
                                                        - *      // ....
                                                        - *    }
                                                        - *  }
                                                        - *  
                                                        + * @Test + * public void myTest() { + * RestClient client = RULE.restClient(); + * // .... + * } + * } + * */ class EmbeddedElasticsearchPolicy { @@ -86,6 +88,7 @@ private EmbeddedElasticsearchPolicy(EmbeddedElasticsearchNode resource) { /** * Factory method to create this rule. + * * @return managed resource to be used in unit tests */ public static EmbeddedElasticsearchPolicy create() { @@ -93,16 +96,15 @@ public static EmbeddedElasticsearchPolicy create() { } /** - * Creates index in elastic search given a mapping. Mapping can contain nested fields expressed - * as dots({@code .}). + * Creates index in Elasticsearch given a mapping. Mapping can + * contain nested fields expressed as dots({@code .}). * - *

                                                        Example - *

                                                        -   *  {@code
                                                        +   * 

                                                        Example: + * + *

                                                        {@code
                                                            *     b.a: long
                                                            *     b.b: keyword
                                                        -   *  }
                                                        -   * 
                                                        + * }
                                                        * * @param index index of the index * @param mapping field and field type mapping @@ -133,13 +135,12 @@ void createIndex(String index, Map mapping) throws IOException { * Creates alias in elastic search given an index. * as dots({@code .}). * - *

                                                        Example - *

                                                        -   *  {@code
                                                        +   * 

                                                        Example: + * + *

                                                        {@code
                                                            *     b.a: long
                                                            *     b.b: keyword
                                                        -   *  }
                                                        -   * 
                                                        + * }
                                                        * * @param index index of the index * @param alias alias of the index @@ -220,6 +221,7 @@ void insertBulk(String index, List documents) throws IOException { /** * Exposes Jackson API to be used to parse search results. + * * @return existing instance of ObjectMapper */ ObjectMapper mapper() { @@ -227,7 +229,9 @@ ObjectMapper mapper() { } /** - * Low-level http rest client connected to current embedded elastic search instance. + * Low-level http rest client connected to current embedded Elasticsearch + * instance. + * * @return http client connected to ES cluster */ RestClient restClient() { @@ -252,6 +256,7 @@ HttpHost httpHost() { /** * HTTP address for rest clients (can be ES native or any other). + * * @return http address to connect to */ private TransportAddress httpAddress() { diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/MatchTest.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/MatchTest.java index a2417ab01635..d6fb98cbeaf1 100644 --- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/MatchTest.java +++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/MatchTest.java @@ -79,6 +79,7 @@ class MatchTest { /** * Used to create {@code zips} index and insert zip data in bulk. + * * @throws Exception when instance setup failed */ @BeforeAll diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/Projection2Test.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/Projection2Test.java index 0c53ff92011d..9dd34be78d83 100644 --- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/Projection2Test.java +++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/Projection2Test.java @@ -125,6 +125,7 @@ private static Connection createConnection() throws SQLException { /** * Test that {@code _id} field is available when queried explicitly. + * * @see ID Field */ @Test void projectionWithIdField() { @@ -233,6 +234,7 @@ private static Connection createConnection() throws SQLException { * key1=foo1; key2=\\w+; key4=\\d{3,4} * } * + * * @param lines lines with regexp * @return consumer to be used in {@link org.apache.calcite.test.CalciteAssert.AssertQuery} */ diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/QueryBuildersTest.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/QueryBuildersTest.java index c47c15034730..5e80326fd7d0 100644 --- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/QueryBuildersTest.java +++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/QueryBuildersTest.java @@ -43,6 +43,7 @@ class QueryBuildersTest { /** * Test for simple scalar terms (boolean, int etc.) + * * @throws Exception not expected */ @Test void term() throws Exception { diff --git a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ScrollingTest.java b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ScrollingTest.java index 63205551cc5b..71063619733c 100644 --- a/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ScrollingTest.java +++ b/elasticsearch/src/test/java/org/apache/calcite/adapter/elasticsearch/ScrollingTest.java @@ -98,6 +98,7 @@ private ConnectionFactory newConnectionFactory(int fetchSize) { /** * Ensures there are no pending scroll contexts in elastic search cluster. * Queries {@code /_nodes/stats/indices/search} endpoint. + * * @see Indices Stats */ private void assertNoActiveScrolls() throws IOException { diff --git a/elasticsearch/src/test/java/org/apache/calcite/test/ElasticsearchChecker.java b/elasticsearch/src/test/java/org/apache/calcite/test/ElasticsearchChecker.java index 7e67020e919b..1e5189ff177f 100644 --- a/elasticsearch/src/test/java/org/apache/calcite/test/ElasticsearchChecker.java +++ b/elasticsearch/src/test/java/org/apache/calcite/test/ElasticsearchChecker.java @@ -48,6 +48,7 @@ private ElasticsearchChecker() {} /** Returns a function that checks that a particular Elasticsearch pipeline is * generated to implement a query. + * * @param strings expected expressions * @return validation function */ @@ -83,6 +84,7 @@ public static Consumer elasticsearchChecker(final String... strings) { * expanded to * {a: { b: {c: 1}}}} * + * * @param parent current node * @param type of node (usually JsonNode). * @return copy of existing node with field {@code a.b.c} expanded. diff --git a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvStreamTableFactory.java b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvStreamTableFactory.java index 49bb2e08232b..cb524dcf3f95 100644 --- a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvStreamTableFactory.java +++ b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvStreamTableFactory.java @@ -34,7 +34,7 @@ * Factory that creates a {@link CsvTranslatableTable}. * *

                                                        Allows a CSV table to be included in a model.json file, even in a - * schema that is not based upon {@link CsvSchema}.

                                                        + * schema that is not based upon {@link CsvSchema}. */ @SuppressWarnings("UnusedDeclaration") public class CsvStreamTableFactory implements TableFactory { diff --git a/example/csv/src/main/java/org/apache/calcite/adapter/csv/package-info.java b/example/csv/src/main/java/org/apache/calcite/adapter/csv/package-info.java index 03d602167ea1..5cb4d328b692 100644 --- a/example/csv/src/main/java/org/apache/calcite/adapter/csv/package-info.java +++ b/example/csv/src/main/java/org/apache/calcite/adapter/csv/package-info.java @@ -20,6 +20,6 @@ * *

                                                        A Calcite schema maps onto a directory, and each CSV file in that * directory appears as a table. Full SQL operations are available on - * those tables.

                                                        + * those tables. */ package org.apache.calcite.adapter.csv; diff --git a/file/src/main/java/org/apache/calcite/adapter/file/CsvStreamReader.java b/file/src/main/java/org/apache/calcite/adapter/file/CsvStreamReader.java index aa00472d24db..1c7aed8ff08d 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/CsvStreamReader.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/CsvStreamReader.java @@ -70,7 +70,7 @@ class CsvStreamReader extends CSVReader implements Closeable { * @param line The line number to skip for start reading * @param strictQuotes Sets if characters outside the quotes are ignored * @param ignoreLeadingWhiteSpace If true, parser should ignore - * white space before a quote in a field + * white space before a quote in a field */ private CsvStreamReader(Source source, char separator, char quoteChar, char escape, int line, boolean strictQuotes, diff --git a/geode/src/main/java/org/apache/calcite/adapter/geode/util/JavaTypeFactoryExtImpl.java b/geode/src/main/java/org/apache/calcite/adapter/geode/util/JavaTypeFactoryExtImpl.java index a322e4b6b418..6112caff4884 100644 --- a/geode/src/main/java/org/apache/calcite/adapter/geode/util/JavaTypeFactoryExtImpl.java +++ b/geode/src/main/java/org/apache/calcite/adapter/geode/util/JavaTypeFactoryExtImpl.java @@ -37,7 +37,7 @@ * Implementation of {@link JavaTypeFactory}. * *

                                                        NOTE: This class is experimental and subject to - * change/removal without notice.

                                                        + * change/removal without notice. */ public class JavaTypeFactoryExtImpl extends JavaTypeFactoryImpl { diff --git a/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeEmbeddedPolicy.java b/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeEmbeddedPolicy.java index 9faf9e99ec0b..0191d2e9e605 100644 --- a/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeEmbeddedPolicy.java +++ b/geode/src/test/java/org/apache/calcite/adapter/geode/rel/GeodeEmbeddedPolicy.java @@ -82,6 +82,7 @@ GeodeEmbeddedPolicy share() { /** * Returns current cache instance which was initialized for tests. + * * @throws IllegalStateException if server process didn't start */ Cache cache() { diff --git a/kafka/src/main/java/org/apache/calcite/adapter/kafka/package-info.java b/kafka/src/main/java/org/apache/calcite/adapter/kafka/package-info.java index e656068f3511..3524be916282 100644 --- a/kafka/src/main/java/org/apache/calcite/adapter/kafka/package-info.java +++ b/kafka/src/main/java/org/apache/calcite/adapter/kafka/package-info.java @@ -18,6 +18,6 @@ /** * Kafka query provider. * - *

                                                        One Kafka topic is mapping to one STREAM table.

                                                        + *

                                                        One Kafka topic is mapping to one STREAM table. */ package org.apache.calcite.adapter.kafka; diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable.java index d89614df3646..1a798704d12d 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable.java @@ -24,7 +24,7 @@ * *

                                                        It is helpful to derive from this class if you are implementing * {@code Enumerable}, because {@code Enumerable} has so many extension methods, - * but it is not required.

                                                        + * but it is not required. * * @param Element type */ diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable2.java b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable2.java index 774c9210eb53..8d3958625e2d 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable2.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable2.java @@ -22,7 +22,7 @@ * *

                                                        It is helpful to derive from this class if you are implementing * {@code Enumerable}, because {@code Enumerable} has so many extension methods, - * but it is not required.

                                                        + * but it is not required. * * @param Element type */ diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractQueryable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractQueryable.java index d3bb73888c57..a3f6349c0aea 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractQueryable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractQueryable.java @@ -22,7 +22,7 @@ * *

                                                        It is helpful to derive from this class if you are implementing * {@code Queryable}, because {@code Queryable} has so many extension methods, - * but it is not required.

                                                        + * but it is not required. * * @param Element type */ diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java index 2fc8e6ff9ce6..50b14b9ca950 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java @@ -50,7 +50,7 @@ *

                                                        The are two abstract methods: * {@link #enumerator()} and {@link #iterator()}. * The derived class can implement each separately, or implement one in terms of - * the other.

                                                        + * the other. * * @param Element type */ diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerable.java index 72824b9d4aa0..4af96280dd20 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerable.java @@ -22,9 +22,9 @@ * Exposes the enumerator, which supports a simple iteration over a collection. * *

                                                        Analogous to LINQ's System.Collections.IEnumerable (both generic - * and non-generic variants).

                                                        + * and non-generic variants). * - *

                                                        Also implements {@link Iterable}, to enable use in Java foreach loops.

                                                        + *

                                                        Also implements {@link Iterable}, to enable use in Java foreach loops. * * @param Element type */ diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java b/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java index 025487cf3415..6a1a21766f78 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java @@ -208,7 +208,7 @@ public static Enumerable asEnumerable( /** * Converts an Enumerable to an IQueryable. * - *

                                                        Analogous to the LINQ's Enumerable.AsQueryable extension method.

                                                        + *

                                                        Analogous to the LINQ's Enumerable.AsQueryable extension method. * * @param enumerable Enumerable * @param Element type @@ -321,7 +321,7 @@ public static Float average(Enumerable source, } /** - *

                                                        Analogous to LINQ's Enumerable.Cast extension method.

                                                        + *

                                                        Analogous to LINQ's Enumerable.Cast extension method. * * @param clazz Target type * @param Target type @@ -1647,12 +1647,12 @@ public static TSource last(Enumerable enumerable) { *

                                                        Fetches blocks of size {@code batchSize} from {@code outer}, * storing each block into a list ({@code outerValues}). * For each block, it uses the {@code inner} function to - * obtain an enumerable with the correlated rows from the right (inner) input.

                                                        + * obtain an enumerable with the correlated rows from the right (inner) input. * *

                                                        Each result present in the {@code innerEnumerator} has matched at least one * value from the block {@code outerValues}. * At this point a mini nested loop is performed between the outer values - * and inner values using the {@code predicate} to find out the actual matching join results.

                                                        + * and inner values using the {@code predicate} to find out the actual matching join results. * *

                                                        In order to optimize this mini nested loop, during the first iteration * (the first value from {@code outerValues}) we use the {@code innerEnumerator} @@ -1660,7 +1660,7 @@ public static TSource last(Enumerable enumerable) { * with said {@code innerEnumerator} rows. In the subsequent iterations * (2nd, 3rd, etc. value from {@code outerValues}) the list {@code innerValues} is used, * since it contains all the {@code innerEnumerator} values, - * which were stored in the first iteration.

                                                        + * which were stored in the first iteration. */ public static Enumerable correlateBatchJoin( final JoinType joinType, @@ -2147,6 +2147,7 @@ private void closeInner() { /** * Joins two inputs that are sorted on the key. * Inputs must sorted in ascending order, nulls last. + * * @deprecated Use {@link #mergeJoin(Enumerable, Enumerable, Function1, Function1, Function2, JoinType, Comparator)} */ @Deprecated // to be removed before 2.0 @@ -2171,7 +2172,9 @@ private void closeInner() { } /** - * Returns if certain join type is supported by Enumerable Merge Join implementation. + * Returns if certain join type is supported by Enumerable Merge + * Join implementation. + * *

                                                        NOTE: This method is subject to change or be removed without notice. */ public static boolean isMergeJoinSupported(JoinType joinType) { @@ -2620,7 +2623,7 @@ public static Float min(Enumerable source, * Filters the elements of an Enumerable based on a * specified type. * - *

                                                        Analogous to LINQ's Enumerable.OfType extension method.

                                                        + *

                                                        Analogous to LINQ's Enumerable.OfType extension method. * * @param clazz Target type * @param Target type @@ -2666,6 +2669,7 @@ public static Enumerable orderBy( /** * A sort implementation optimized for a sort with a fetch size (LIMIT). + * * @param offset how many rows are skipped from the sorted output. * Must be greater than or equal to 0. * @param fetch how many rows are retrieved. Must be greater than or equal to 0. @@ -3484,7 +3488,7 @@ public static OrderedEnumerable thenByDescending( * Enumerable<TSource> according to a specified key selector * function. * - *

                                                        NOTE: Called {@code toDictionary} in LINQ.NET.

                                                        + *

                                                        NOTE: Called {@code toDictionary} in LINQ.NET. */ public static Map toMap( Enumerable source, Function1 keySelector) { @@ -4369,6 +4373,7 @@ private boolean advance() { * Clears {@code left} list, adds {@code left} into it, and advance left enumerator, * adding all items with the same key to {@code left} list too, until left enumerator * is over or a different key is found. + * * @return {@code true} if there are still elements to be processed on the left enumerator, * {@code false} otherwise (left enumerator is over or null key is found). */ @@ -4401,6 +4406,7 @@ private boolean advanceLeft(TSource left, TKey leftKey) { * Clears {@code right} list, adds {@code right} into it, and advance right enumerator, * adding all items with the same key to {@code right} list too, until right enumerator * is over or a different key is found. + * * @return {@code true} if there are still elements to be processed on the right enumerator, * {@code false} otherwise (right enumerator is over or null key is found). */ diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedEnumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedEnumerable.java index c20fe988a06f..a375ff250bca 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedEnumerable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedEnumerable.java @@ -55,7 +55,7 @@ public interface ExtendedEnumerable { * Performs an operation for each member of this enumeration. * *

                                                        Returns the value returned by the function for the last element in - * this enumeration, or null if this enumeration is empty.

                                                        + * this enumeration, or null if this enumeration is empty. * * @param func Operation * @param Return type @@ -137,9 +137,9 @@ TResult aggregate(TAccumulate seed, *

                                                        If the type of source implements {@code Queryable}, this method * returns it directly. Otherwise, it returns a {@code Queryable} that * executes queries by calling the equivalent query operator methods in - * {@code Enumerable} instead of those in {@code Queryable}.

                                                        + * {@code Enumerable} instead of those in {@code Queryable}. * - *

                                                        Analogous to the LINQ's Enumerable.AsQueryable extension method.

                                                        + *

                                                        Analogous to the LINQ's Enumerable.AsQueryable extension method. * * @return A queryable */ @@ -572,7 +572,7 @@ Enumerable hashJoin(Enumerable inner, * optional outer join semantics. A specified * {@code EqualityComparer} is used to compare keys. * - *

                                                        A left join generates nulls on right, and vice versa:

                                                        + *

                                                        A left join generates nulls on right, and vice versa: * *

                                                  Example mapping
                                                  * @@ -599,7 +599,7 @@ Enumerable hashJoin(Enumerable inner, * optional outer join semantics. A specified * {@code EqualityComparer} is used to compare keys. * - *

                                                  A left join generates nulls on right, and vice versa:

                                                  + *

                                                  A left join generates nulls on right, and vice versa: * *

                                                  Join types
                                                  * @@ -614,7 +614,7 @@ Enumerable hashJoin(Enumerable inner, * *
                                                  Join types
                                                  FULLtruetrue
                                                  * - *

                                                  A predicate is used to filter the join result per-row

                                                  + *

                                                  A predicate is used to filter the join result per-row */ Enumerable hashJoin(Enumerable inner, Function1 outerKeySelector, @@ -836,7 +836,7 @@ Enumerable correlateJoin( * Filters the elements of an Enumerable based on a * specified type. * - *

                                                  Analogous to LINQ's Enumerable.OfType extension method.

                                                  + *

                                                  Analogous to LINQ's Enumerable.OfType extension method. * * @param clazz Target type * @param Target type @@ -1090,7 +1090,7 @@ boolean sequenceEqual(Enumerable enumerable1, * {@code Enumerable} according to a specified key selector * function. * - *

                                                  NOTE: Called {@code toDictionary} in LINQ.NET.

                                                  + *

                                                  NOTE: Called {@code toDictionary} in LINQ.NET. */ Map toMap(Function1 keySelector); diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedOrderedEnumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedOrderedEnumerable.java index 47ae6892a033..852b8c671c59 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedOrderedEnumerable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedOrderedEnumerable.java @@ -37,7 +37,7 @@ public interface ExtendedOrderedEnumerable extends Enumerable { * {@link #thenByDescending(org.apache.calcite.linq4j.function.Function1, java.util.Comparator) thenByDescending}, * depending on whether descending is true or false. They both perform a * subordinate ordering of an already sorted sequence of type - * {@link OrderedEnumerable}.

                                                  + * {@link OrderedEnumerable}. */ OrderedEnumerable createOrderedEnumerable( Function1 keySelector, Comparator comparator, diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedQueryable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedQueryable.java index ef3c2f7919a6..f30b22482b8a 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedQueryable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedQueryable.java @@ -275,7 +275,7 @@ Queryable> groupBy( * *

                                                  NOTE: Renamed from {@code groupBy} to distinguish from * {@link #groupBy(org.apache.calcite.linq4j.tree.FunctionExpression, org.apache.calcite.linq4j.tree.FunctionExpression)}, - * which has the same erasure.

                                                  + * which has the same erasure. */ Queryable groupByK( FunctionExpression> keySelector, @@ -445,7 +445,7 @@ Queryable join(Enumerable inner, * out any elements in source that are not of type TResult. * *

                                                  NOTE: clazz parameter not present in C# LINQ; necessary because of - * Java type erasure.

                                                  + * Java type erasure. */ @Override Queryable ofType(Class clazz); @@ -498,7 +498,7 @@ Queryable select( * form by incorporating the element's index. * *

                                                  NOTE: Renamed from {@code select} because had same erasure as - * {@link #select(org.apache.calcite.linq4j.tree.FunctionExpression)}.

                                                  + * {@link #select(org.apache.calcite.linq4j.tree.FunctionExpression)}. */ Queryable selectN( FunctionExpression> selector); @@ -519,7 +519,7 @@ Queryable selectMany( * projected form of that element. * *

                                                  NOTE: Renamed from {@code selectMany} because had same erasure as - * {@link #selectMany(org.apache.calcite.linq4j.tree.FunctionExpression)}

                                                  + * {@link #selectMany(org.apache.calcite.linq4j.tree.FunctionExpression)}. */ Queryable selectManyN( FunctionExpression>> diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/Extensions.java b/linq4j/src/main/java/org/apache/calcite/linq4j/Extensions.java index 5b8ba733b009..e7434a252c75 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/Extensions.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/Extensions.java @@ -28,7 +28,7 @@ *

                                                  Notes on mapping from LINQ.NET to Java

                                                  * *

                                                  We have preserved most of the API. But we've changed a few things, so that - * the API is more typical Java API:

                                                  + * the API is more typical Java API: * *
                                                    * diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/Linq4j.java b/linq4j/src/main/java/org/apache/calcite/linq4j/Linq4j.java index 964df314dd02..482a30757f19 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/Linq4j.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/Linq4j.java @@ -86,7 +86,7 @@ private Linq4j() {} * *

                                                    WARNING: The iterator returned by this method does not call * {@link org.apache.calcite.linq4j.Enumerator#close()}, so it is not safe to - * use with an enumerator that allocates resources.

                                                    + * use with an enumerator that allocates resources. * * @param enumerator Enumerator * @param Element type @@ -131,7 +131,7 @@ public static Enumerable asEnumerable(final List list) { * Adapter that converts an {@link Collection} into an {@link Enumerable}. * *

                                                    It uses more efficient implementations if the iterable happens to - * be a {@link List}.

                                                    + * be a {@link List}. * * @param collection Collection * @param Element type @@ -150,7 +150,7 @@ public static Enumerable asEnumerable(final Collection collection) { * Adapter that converts an {@link Iterable} into an {@link Enumerable}. * *

                                                    It uses more efficient implementations if the iterable happens to - * be a {@link Collection} or a {@link List}.

                                                    + * be a {@link Collection} or a {@link List}. * * @param iterable Iterable * @param Element type @@ -263,7 +263,7 @@ public static Enumerable cast( *

                                                    The {@code ofType} method returns only those elements in source that * can be cast to type TResult. To instead receive an exception if an * element cannot be cast to type TResult, use - * {@link #cast(Iterable, Class)}.

                                                    + * {@link #cast(Iterable, Class)}. * *

                                                    Since standard Java {@link Collection} objects implement the * {@link Iterable} interface, the {@code cast} method enables the standard @@ -368,13 +368,13 @@ public static Enumerable concat( * enumerator B that returns {"x", "y"}, product(List(A, B)) will return * {List("a", "x"), List("a", "y"), * List("b", "x"), List("b", "y"), - * List("c", "x"), List("c", "y")}.

                                                    + * List("c", "x"), List("c", "y")}. * *

                                                    Notice that the cardinality of the result is the product of the * cardinality of the inputs. The enumerators A and B have 3 and 2 * elements respectively, and the result has 3 * 2 = 6 elements. * This is always the case. In - * particular, if any of the enumerators is empty, the result is empty.

                                                    + * particular, if any of the enumerators is empty, the result is empty. * * @param enumerators List of enumerators * @param Element type diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/MemoryFactory.java b/linq4j/src/main/java/org/apache/calcite/linq4j/MemoryFactory.java index f68fa91777e7..421a52a98d7b 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/MemoryFactory.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/MemoryFactory.java @@ -23,6 +23,7 @@ /** * Contains the State and changes internally. * with the {@link #create()} method one can get immutable Snapshots. + * * @param Type of the base Object */ public class MemoryFactory { diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/MergeUnionEnumerator.java b/linq4j/src/main/java/org/apache/calcite/linq4j/MergeUnionEnumerator.java index 7039fd981566..d708f67858c3 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/MergeUnionEnumerator.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/MergeUnionEnumerator.java @@ -32,6 +32,7 @@ /** * Performs a union (or union all) of all its inputs (which must be already sorted), * respecting the order. + * * @param record type * @param sort key */ diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProvider.java b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProvider.java index bcc90660fd54..01af01e4b22a 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProvider.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProvider.java @@ -24,7 +24,7 @@ * Defines methods to create and execute queries that are described by a * {@link Queryable} object. * - *

                                                    Analogous to LINQ's System.Linq.QueryProvider.

                                                    + *

                                                    Analogous to LINQ's System.Linq.QueryProvider. */ public interface QueryProvider { /** @@ -33,7 +33,7 @@ public interface QueryProvider { * *

                                                    NOTE: The {@link org.apache.calcite.linq4j.Queryable#getExpression()} * property of the returned {@link Queryable} object is equal to - * {@code expression}.

                                                    + * {@code expression}. * * @param expression Expression * @param rowType Row type @@ -63,7 +63,7 @@ public interface QueryProvider { * (instead of an enumerable sequence of values). Expression trees that * represent queries that return enumerable results are executed when the * {@link Queryable} object that contains the expression tree is - * enumerated.

                                                    + * enumerated. * *

                                                    The Queryable standard query operator methods that return singleton * results call {@code execute}. They pass it a diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProviderImpl.java b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProviderImpl.java index 62889872eccd..4041d55ddaf9 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProviderImpl.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProviderImpl.java @@ -23,7 +23,7 @@ /** * Partial implementation of {@link QueryProvider}. * - *

                                                    Derived class needs to implement {@link #executeQuery}.

                                                    + *

                                                    Derived class needs to implement {@link #executeQuery}. */ public abstract class QueryProviderImpl implements QueryProvider { /** diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/Queryable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/Queryable.java index 9f9f049744ee..a1eb8f4c16b4 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/Queryable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/Queryable.java @@ -22,7 +22,7 @@ * Provides functionality to evaluate queries against a specific data source * wherein the type of the data is known. * - *

                                                    Analogous to LINQ's System.Linq.IQueryable.

                                                    + *

                                                    Analogous to LINQ's System.Linq.IQueryable. * * @param Element type */ diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableDefaults.java b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableDefaults.java index bef7d183e0ec..f84c08534340 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableDefaults.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableDefaults.java @@ -218,7 +218,7 @@ public static Long averageNullableLong(Queryable queryable, } /** - *

                                                    Analogous to LINQ's Enumerable.Cast extension method.

                                                    + *

                                                    Analogous to LINQ's Enumerable.Cast extension method. * * @param clazz Target type * @param Target type @@ -426,7 +426,7 @@ public static Queryable> groupBy( * *

                                                    NOTE: Renamed from {@code groupBy} to distinguish from * {@link #groupBy(org.apache.calcite.linq4j.Queryable, org.apache.calcite.linq4j.tree.FunctionExpression, org.apache.calcite.linq4j.tree.FunctionExpression)}, - * which has the same erasure.

                                                    + * which has the same erasure. */ public static Queryable> groupByK( Queryable queryable, @@ -457,7 +457,7 @@ public static Queryable> groupBy( * *

                                                    NOTE: Renamed from {@code groupBy} to distinguish from * {@link #groupBy(org.apache.calcite.linq4j.Queryable, org.apache.calcite.linq4j.tree.FunctionExpression, org.apache.calcite.linq4j.tree.FunctionExpression, org.apache.calcite.linq4j.function.EqualityComparer)}, - * which has the same erasure.

                                                    + * which has the same erasure. */ public static Queryable groupByK( Queryable queryable, @@ -675,7 +675,7 @@ public static TResult min(Queryable queryable, * {@link org.apache.calcite.linq4j.QueryProvider#createQuery createQuery} * method of the * {@link org.apache.calcite.linq4j.QueryProvider} represented by - * the Provider property of the source parameter.

                                                    + * the Provider property of the source parameter. * *

                                                    The query behavior that occurs as a result of executing an expression * tree that represents calling OfType depends on the implementation of the @@ -683,7 +683,7 @@ public static TResult min(Queryable queryable, * out any elements in source that are not of type TResult. * *

                                                    NOTE: clazz parameter not present in C# LINQ; necessary because of - * Java type erasure.

                                                    + * Java type erasure. */ public static Queryable ofType(Queryable queryable, Class clazz) { diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/RawEnumerable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/RawEnumerable.java index 35d3ac1db50e..b77a0f179838 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/RawEnumerable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/RawEnumerable.java @@ -23,10 +23,10 @@ * without the extension methods. * *

                                                    Just the bare methods, to make it easier to implement. Code that requires - * the extension methods can use the static methods in {@link Extensions}.

                                                    + * the extension methods can use the static methods in {@link Extensions}. * *

                                                    Analogous to LINQ's System.Collections.IEnumerable (both generic - * and non-generic variants), without the extension methods.

                                                    + * and non-generic variants), without the extension methods. * * @param Element type * @see Enumerable diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/RawQueryable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/RawQueryable.java index 953f6a07411c..05ecf85692aa 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/RawQueryable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/RawQueryable.java @@ -42,6 +42,7 @@ public interface RawQueryable extends Enumerable { /** * Gets the expression tree that is associated with this Queryable. + * * @return null if the expression is not available */ @Nullable Expression getExpression(); diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/function/Functions.java b/linq4j/src/main/java/org/apache/calcite/linq4j/function/Functions.java index c3b9877a6bb5..6a4a0da2a394 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/function/Functions.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/function/Functions.java @@ -207,9 +207,9 @@ public static Predicate2 toPredicate( * Returns the appropriate interface for a lambda function with * 1 argument and the given return type. * - *

                                                    For example:

                                                    - * functionClass(Integer.TYPE) returns IntegerFunction1.class - * functionClass(String.class) returns Function1.class + *

                                                    For example: + * functionClass(Integer.TYPE) returns IntegerFunction1.class; + * functionClass(String.class) returns Function1.class. * * @param aClass Return type * diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BlockBuilder.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BlockBuilder.java index 750d513db567..731db833627f 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BlockBuilder.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BlockBuilder.java @@ -34,7 +34,7 @@ /** * Builder for {@link BlockStatement}. * - *

                                                    Has methods that help ensure that variable names are unique.

                                                    + *

                                                    Has methods that help ensure that variable names are unique. */ public class BlockBuilder { final List statements = new ArrayList<>(); diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Blocks.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Blocks.java index 993470ca6c1f..578767adb6c3 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Blocks.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Blocks.java @@ -19,7 +19,7 @@ import static java.util.Objects.requireNonNull; /** - *

                                                    Helper methods concerning {@link BlockStatement}s.

                                                    + *

                                                    Helper methods concerning {@link BlockStatement}s. * * @see BlockBuilder */ diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalExpression.java index e33e2fa98cd7..0b0290d7d706 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalExpression.java @@ -32,7 +32,6 @@ * {c0, e0, c1, e1, ..., cn-1, en-1} * represents * "if (c0) e0 else if (c1) e1 ... else if (cn-1) en-1". - *

                                                    */ public class ConditionalExpression extends AbstractNode { final List expressionList; diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalStatement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalStatement.java index f83a3bbd42fc..df43ecc1014d 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalStatement.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConditionalStatement.java @@ -31,7 +31,6 @@ * {c0, e0, c1, e1, ..., cn-1, en-1} * represents * "if (c0) e0 else if (c1) e1 ... else if (cn-1) en-1". - *

                                                    */ public class ConditionalStatement extends Statement { public final List expressionList; diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expression.java index 9ec2984874e2..15eb8bff9fd6 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expression.java @@ -19,7 +19,7 @@ import java.lang.reflect.Type; /** - *

                                                    Analogous to LINQ's System.Linq.Expression.

                                                    + *

                                                    Analogous to LINQ's System.Linq.Expression. */ public abstract class Expression extends AbstractNode { @@ -29,7 +29,7 @@ public abstract class Expression extends AbstractNode { *

                                                    The type of the expression may, at the caller's discretion, be a * regular class (because {@link Class} implements {@link Type}) or it may * be a different implementation that retains information about type - * parameters.

                                                    + * parameters. * * @param nodeType Node type * @param type Type of the expression diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ExpressionType.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ExpressionType.java index b532aba2c4bf..7b0dfe65d1d1 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ExpressionType.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ExpressionType.java @@ -18,9 +18,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; -/** - *

                                                    Analogous to LINQ's System.Linq.Expressions.ExpressionType.

                                                    - */ +/** Analogous to LINQ's System.Linq.Expressions.ExpressionType. */ public enum ExpressionType { // Operator precedence and associativity is as follows. diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expressions.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expressions.java index 9204ef047d57..79fa310e19db 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expressions.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Expressions.java @@ -382,10 +382,10 @@ public static MethodCallExpression call(@Nullable Expression expression, Method * method that takes arguments, with an explicit return type. * *

                                                    The return type must be consistent with the return type of the method, - * but may contain extra information, such as type parameters.

                                                    + * but may contain extra information, such as type parameters. * *

                                                    The {@code expression} argument may be null if and only if the method - * is static.

                                                    + * is static. */ public static MethodCallExpression call(Type returnType, @Nullable Expression expression, Method method, @@ -399,10 +399,10 @@ public static MethodCallExpression call(Type returnType, * method that takes arguments, with an explicit return type, with varargs. * *

                                                    The return type must be consistent with the return type of the method, - * but may contain extra information, such as type parameters.

                                                    + * but may contain extra information, such as type parameters. * *

                                                    The {@code expression} argument may be null if and only if the method - * is static.

                                                    + * is static. */ public static MethodCallExpression call(Type returnType, @Nullable Expression expression, Method method, @@ -519,7 +519,7 @@ public static boolean isConstantNull(Expression e) { * conditional expression in cases where the types of ifTrue and ifFalse * expressions are not equal. Types of both ifTrue and ifFalse must be * implicitly reference assignable to the result type. The type is allowed - * to be {@link Void#TYPE void}.

                                                    + * to be {@link Void#TYPE void}. */ public static ConditionalExpression condition(Expression test, Expression ifTrue, Expression ifFalse, Type type) { @@ -535,7 +535,7 @@ public static ConditionalExpression condition(Expression test, * short 12, double 3.14 and boolean false), boxed primitives * (e.g. Integer.valueOf(12)), enums, classes, BigDecimal, BigInteger, * classes that have a constructor with a parameter for each field, and - * arrays.

                                                    + * arrays. */ public static ConstantExpression constant(@Nullable Object value) { if (value == null) { diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/NewExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/NewExpression.java index f2d343ecdd32..5cbe06824c43 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/NewExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/NewExpression.java @@ -26,7 +26,7 @@ * Represents a constructor call. * *

                                                    If {@link #memberDeclarations} is not null (even if empty) represents - * an anonymous class.

                                                    + * an anonymous class. */ public class NewExpression extends Expression { @SuppressWarnings("HidingField") diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Node.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Node.java index 9159d85dbe59..6cbe9e508597 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Node.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Node.java @@ -16,9 +16,7 @@ */ package org.apache.calcite.linq4j.tree; -/** - *

                                                    Parse tree node.

                                                    - */ +/** Parse tree node. */ public interface Node { R accept(Visitor visitor); diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Primitive.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Primitive.java index 0e89bdeebed6..b27c48b043aa 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Primitive.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Primitive.java @@ -38,7 +38,7 @@ * *

                                                    There are fields for the native class (e.g. int, also * known as {@link Integer#TYPE}) and the boxing class - * (e.g. {@link Integer}).

                                                    + * (e.g. {@link Integer}). */ public enum Primitive { BOOLEAN(Boolean.TYPE, Boolean.class, 1, false, false, null, null, true, -1), diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Statement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Statement.java index c76ab5c213c0..8897ca11bef9 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Statement.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Statement.java @@ -19,7 +19,7 @@ import java.lang.reflect.Type; /** - *

                                                    Statement.

                                                    + *

                                                    Statement. */ public abstract class Statement extends AbstractNode { protected Statement(ExpressionType nodeType, Type type) { diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Types.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Types.java index 8db3a6994fa3..0be03c9fc08c 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Types.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/Types.java @@ -62,7 +62,7 @@ public static Type of(Type type, Type... typeArguments) { * {@link org.apache.calcite.linq4j.Enumerable Enumerable}), {@link Iterator}, * {@link Enumerator}, or an array. * - *

                                                    Returns null if the type is not one of these.

                                                    + *

                                                    Returns null if the type is not one of these. */ public static @Nullable Type getElementType(Type type) { if (type instanceof ArrayType) { diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/package-info.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/package-info.java index e3c6360a61ae..9c1eeda04dc5 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/package-info.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/package-info.java @@ -23,6 +23,6 @@ * {@link org.apache.calcite.linq4j.Queryable} interface. The system attempts * to understand the intent of the query and reorganize it for * efficiency; for example, it may attempt to push down filters to the - * source SQL system.

                                                    + * source SQL system. */ package org.apache.calcite.linq4j.tree; diff --git a/linq4j/src/test/java/org/apache/calcite/linq4j/test/BlockBuilderTest.java b/linq4j/src/test/java/org/apache/calcite/linq4j/test/BlockBuilderTest.java index 95ff073f4574..251f6f0b4190 100644 --- a/linq4j/src/test/java/org/apache/calcite/linq4j/test/BlockBuilderTest.java +++ b/linq4j/src/test/java/org/apache/calcite/linq4j/test/BlockBuilderTest.java @@ -165,6 +165,7 @@ private BlockBuilder appendBlockWithSameVariable( /** * Class with generics to validate if {@link Expressions#call(Method, Expression...)} works. + * * @param result type */ static class Identity implements Function { diff --git a/linq4j/src/test/java/org/apache/calcite/linq4j/test/JoinPreserveOrderTest.java b/linq4j/src/test/java/org/apache/calcite/linq4j/test/JoinPreserveOrderTest.java index d58e2e556caf..d77ae1782313 100644 --- a/linq4j/src/test/java/org/apache/calcite/linq4j/test/JoinPreserveOrderTest.java +++ b/linq4j/src/test/java/org/apache/calcite/linq4j/test/JoinPreserveOrderTest.java @@ -61,6 +61,7 @@ public final class JoinPreserveOrderTest { /** * A description holding which column must be sorted and how. + * * @param the type of the input relation */ private static class Field { diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoSchemaFactory.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoSchemaFactory.java index 1c6ca8e26b0c..cb1b9a7dda90 100644 --- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoSchemaFactory.java +++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoSchemaFactory.java @@ -29,7 +29,7 @@ /** * Factory that creates a {@link MongoSchema}. * - *

                                                    Allows a custom schema to be included in a model.json file.

                                                    + *

                                                    Allows a custom schema to be included in a model.json file. */ public class MongoSchemaFactory implements SchemaFactory { // public constructor, per factory contract diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java index e3d46e5c8b42..4a5694279bc0 100644 --- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java +++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java @@ -89,7 +89,7 @@ public class MongoTable extends AbstractQueryableTable /** Executes a "find" operation on the underlying collection. * *

                                                    For example, - * zipsTable.find("{state: 'OR'}", "{city: 1, zipcode: 1}")

                                                    + * zipsTable.find("{state: 'OR'}", "{city: 1, zipcode: 1}") * * @param mongoDb MongoDB connection * @param filterJson Filter JSON string, or null @@ -121,7 +121,7 @@ private Enumerable find(MongoDatabase mongoDb, String filterJson, * zipsTable.aggregate( * "{$filter: {state: 'OR'}", * "{$group: {_id: '$city', c: {$sum: 1}, p: {$sum: '$pop'}}}") - *

                                                    + * * * @param mongoDb MongoDB connection * @param fields List of fields to project; or null to return map diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTableScan.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTableScan.java index 8783c30f6876..17799e4b61da 100644 --- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTableScan.java +++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTableScan.java @@ -37,7 +37,7 @@ * Relational expression representing a scan of a MongoDB collection. * *

                                                    Additional operations might be applied, - * using the "find" or "aggregate" methods.

                                                    + * using the "find" or "aggregate" methods. */ public class MongoTableScan extends TableScan implements MongoRel { final MongoTable mongoTable; diff --git a/mongodb/src/test/java/org/apache/calcite/adapter/mongodb/MongoAdapterTest.java b/mongodb/src/test/java/org/apache/calcite/adapter/mongodb/MongoAdapterTest.java index d2e589985b70..738f093380d9 100644 --- a/mongodb/src/test/java/org/apache/calcite/adapter/mongodb/MongoAdapterTest.java +++ b/mongodb/src/test/java/org/apache/calcite/adapter/mongodb/MongoAdapterTest.java @@ -136,9 +136,7 @@ private static void populate(MongoCollection collection, URL resource) }); } - /** - * Returns always the same schema to avoid initialization costs. - */ + /** Returns always the same schema to avoid initialization costs. */ @Override public Schema create(SchemaPlus parentSchema, String name, Map operand) { return schema; diff --git a/pig/src/main/java/org/apache/calcite/adapter/pig/PigAggregate.java b/pig/src/main/java/org/apache/calcite/adapter/pig/PigAggregate.java index 5ba468c1b412..742c82816b5f 100644 --- a/pig/src/main/java/org/apache/calcite/adapter/pig/PigAggregate.java +++ b/pig/src/main/java/org/apache/calcite/adapter/pig/PigAggregate.java @@ -114,6 +114,7 @@ private String getPigGroupBy(Implementor implementor) { * Generates a FOREACH statement containing invocation of aggregate functions * and projection of grouped fields. e.g. * A = FOREACH A GENERATE group, SUM(A.pet_num); + * * @see Pig documentation for special meaning of the "group" field after GROUP * BY. */ diff --git a/pig/src/main/java/org/apache/calcite/adapter/pig/PigTableFactory.java b/pig/src/main/java/org/apache/calcite/adapter/pig/PigTableFactory.java index 70a5c5e8fdd7..6ebf30f0ad4c 100644 --- a/pig/src/main/java/org/apache/calcite/adapter/pig/PigTableFactory.java +++ b/pig/src/main/java/org/apache/calcite/adapter/pig/PigTableFactory.java @@ -30,7 +30,7 @@ /** * Factory that creates a {@link PigTable}. * - *

                                                    Allows a Pig table to be included in a model.json file.

                                                    + *

                                                    Allows a Pig table to be included in a model.json file. */ public class PigTableFactory implements TableFactory { // public constructor, per factory contract diff --git a/piglet/src/main/java/org/apache/calcite/piglet/DynamicTupleRecordType.java b/piglet/src/main/java/org/apache/calcite/piglet/DynamicTupleRecordType.java index 59575e7b6123..3b1511d8933d 100644 --- a/piglet/src/main/java/org/apache/calcite/piglet/DynamicTupleRecordType.java +++ b/piglet/src/main/java/org/apache/calcite/piglet/DynamicTupleRecordType.java @@ -62,6 +62,7 @@ void resize(int size) { /** * Gets index number from field name. + * * @param fieldName Field name, format example '$1' */ private static int nameToIndex(String fieldName) { diff --git a/plus/src/main/java/org/apache/calcite/adapter/tpcds/TpcdsSchemaFactory.java b/plus/src/main/java/org/apache/calcite/adapter/tpcds/TpcdsSchemaFactory.java index 07e8aab11068..1f6294bc2e9e 100644 --- a/plus/src/main/java/org/apache/calcite/adapter/tpcds/TpcdsSchemaFactory.java +++ b/plus/src/main/java/org/apache/calcite/adapter/tpcds/TpcdsSchemaFactory.java @@ -26,7 +26,7 @@ /** * Factory that creates a {@link TpcdsSchema}. * - *

                                                    Allows a custom schema to be included in a model.json file.

                                                    + *

                                                    Allows a custom schema to be included in a model.json file. */ @SuppressWarnings("UnusedDeclaration") public class TpcdsSchemaFactory implements SchemaFactory { diff --git a/plus/src/main/java/org/apache/calcite/adapter/tpch/TpchSchemaFactory.java b/plus/src/main/java/org/apache/calcite/adapter/tpch/TpchSchemaFactory.java index ab73c85d7bfb..039c381cb44c 100644 --- a/plus/src/main/java/org/apache/calcite/adapter/tpch/TpchSchemaFactory.java +++ b/plus/src/main/java/org/apache/calcite/adapter/tpch/TpchSchemaFactory.java @@ -26,7 +26,7 @@ /** * Factory that creates a {@link TpchSchema}. * - *

                                                    Allows a custom schema to be included in a model.json file.

                                                    + *

                                                    Allows a custom schema to be included in a model.json file. */ @SuppressWarnings("UnusedDeclaration") public class TpchSchemaFactory implements SchemaFactory { diff --git a/plus/src/test/java/org/apache/calcite/adapter/tpcds/TpcdsTest.java b/plus/src/test/java/org/apache/calcite/adapter/tpcds/TpcdsTest.java index de85c177cfe1..3d4595ca67bf 100644 --- a/plus/src/test/java/org/apache/calcite/adapter/tpcds/TpcdsTest.java +++ b/plus/src/test/java/org/apache/calcite/adapter/tpcds/TpcdsTest.java @@ -47,7 +47,7 @@ /** Unit test for {@link org.apache.calcite.adapter.tpcds.TpcdsSchema}. * - *

                                                    Only runs as part of slow test suite.

                                                    + *

                                                    Only runs as part of slow test suite. */ @Tag("slow") class TpcdsTest { @@ -319,7 +319,7 @@ public Frameworks.ConfigBuilder config() throws Exception { * Builder query 27 using {@link RelBuilder}. * *

                                                    -   *   select  i_item_id,
                                                    +   * select  i_item_id,
                                                        *         s_state, grouping(s_state) g_state,
                                                        *         avg(ss_quantity) agg1,
                                                        *         avg(ss_list_price) agg2,
                                                    @@ -340,10 +340,10 @@ public Frameworks.ConfigBuilder config() throws Exception {
                                                        *              'distmember(fips_county,[STATENUMBER.4], 3)',
                                                        *              'distmember(fips_county,[STATENUMBER.5], 3)',
                                                        *              'distmember(fips_county,[STATENUMBER.6], 3)')
                                                    -   *  group by rollup (i_item_id, s_state)
                                                    -   *  order by i_item_id
                                                    +   * group by rollup (i_item_id, s_state)
                                                    +   * order by i_item_id
                                                        *          ,s_state
                                                    -   *  LIMIT 100
                                                    +   * LIMIT 100
                                                        * 
                                                    */ @Test void testQuery27Builder() throws Exception { diff --git a/plus/src/test/java/org/apache/calcite/adapter/tpch/TpchTest.java b/plus/src/test/java/org/apache/calcite/adapter/tpch/TpchTest.java index 3db9dd3dd7c4..9ea5cd0ab7e1 100644 --- a/plus/src/test/java/org/apache/calcite/adapter/tpch/TpchTest.java +++ b/plus/src/test/java/org/apache/calcite/adapter/tpch/TpchTest.java @@ -36,7 +36,7 @@ /** Unit test for {@link org.apache.calcite.adapter.tpch.TpchSchema}. * *

                                                    Because the TPC-H data generator takes time and memory to instantiate, - * tests only run as part of slow tests.

                                                    + * tests only run as part of slow tests. */ class TpchTest { public static final boolean ENABLE = TestUtil.getJavaMajorVersion() >= 7; diff --git a/spark/src/main/java/org/apache/calcite/adapter/spark/EnumerableToSparkConverter.java b/spark/src/main/java/org/apache/calcite/adapter/spark/EnumerableToSparkConverter.java index 175426c372d2..e94f9ee8a4fe 100644 --- a/spark/src/main/java/org/apache/calcite/adapter/spark/EnumerableToSparkConverter.java +++ b/spark/src/main/java/org/apache/calcite/adapter/spark/EnumerableToSparkConverter.java @@ -42,7 +42,7 @@ * *

                                                    Concretely, this means iterating over the contents of an * {@link org.apache.calcite.linq4j.Enumerable}, storing them in a list, and - * building an {@link org.apache.spark.rdd.RDD} on top of it.

                                                    + * building an {@link org.apache.spark.rdd.RDD} on top of it. */ public class EnumerableToSparkConverter extends ConverterImpl diff --git a/spark/src/main/java/org/apache/calcite/adapter/spark/HttpServer.java b/spark/src/main/java/org/apache/calcite/adapter/spark/HttpServer.java index e3febdb7a224..44f6844a2bfb 100644 --- a/spark/src/main/java/org/apache/calcite/adapter/spark/HttpServer.java +++ b/spark/src/main/java/org/apache/calcite/adapter/spark/HttpServer.java @@ -36,7 +36,7 @@ /** * An HTTP server for static content used to allow worker nodes to access JARs. * - *

                                                    Based on Spark HttpServer, wraps a Jetty server.

                                                    + *

                                                    Based on Spark HttpServer, wraps a Jetty server. */ class HttpServer { private static String localIpAddress; diff --git a/spark/src/main/java/org/apache/calcite/adapter/spark/SparkRuntime.java b/spark/src/main/java/org/apache/calcite/adapter/spark/SparkRuntime.java index b5a54e97e904..922052cb2591 100644 --- a/spark/src/main/java/org/apache/calcite/adapter/spark/SparkRuntime.java +++ b/spark/src/main/java/org/apache/calcite/adapter/spark/SparkRuntime.java @@ -54,7 +54,7 @@ public static Enumerable asEnumerable(JavaRDD rdd) { /** Returns the Spark context for the current execution. * - *

                                                    Currently a global variable; maybe later held within {@code root}.

                                                    + *

                                                    Currently a global variable; maybe later held within {@code root}. */ public static JavaSparkContext getSparkContext(DataContext root) { return (JavaSparkContext) SparkHandlerImpl.instance().sparkContext(); diff --git a/spark/src/main/java/org/apache/calcite/adapter/spark/SparkToEnumerableConverter.java b/spark/src/main/java/org/apache/calcite/adapter/spark/SparkToEnumerableConverter.java index e4e48e686c5a..cfdc180ebaad 100644 --- a/spark/src/main/java/org/apache/calcite/adapter/spark/SparkToEnumerableConverter.java +++ b/spark/src/main/java/org/apache/calcite/adapter/spark/SparkToEnumerableConverter.java @@ -47,7 +47,7 @@ * *

                                                    Concretely, this means calling the * {@link org.apache.spark.api.java.JavaRDD#collect()} method of an RDD - * and converting it to enumerable.

                                                    + * and converting it to enumerable. */ public class SparkToEnumerableConverter extends ConverterImpl diff --git a/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkDriver.java b/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkDriver.java index 873823504651..13b37abe163f 100644 --- a/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkDriver.java +++ b/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkDriver.java @@ -34,7 +34,7 @@ /** * JDBC driver for Splunk. * - *

                                                    It accepts connect strings that start with "jdbc:splunk:".

                                                    + *

                                                    It accepts connect strings that start with "jdbc:splunk:". */ public class SplunkDriver extends org.apache.calcite.jdbc.Driver { protected SplunkDriver() { diff --git a/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkTableScan.java b/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkTableScan.java index 8a4012a07f53..aec1c30c3d0f 100644 --- a/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkTableScan.java +++ b/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkTableScan.java @@ -52,7 +52,7 @@ * instance is one large table. This "table" does not have a fixed set of * columns (Splunk calls them "fields") but each query specifies the fields that * it wants. It also specifies a search expression, and optionally earliest and - * latest dates.

                                                    + * latest dates. */ public class SplunkTableScan extends TableScan diff --git a/splunk/src/main/java/org/apache/calcite/adapter/splunk/package-info.java b/splunk/src/main/java/org/apache/calcite/adapter/splunk/package-info.java index d9b5ee195a77..cfead242ef1e 100644 --- a/splunk/src/main/java/org/apache/calcite/adapter/splunk/package-info.java +++ b/splunk/src/main/java/org/apache/calcite/adapter/splunk/package-info.java @@ -20,6 +20,6 @@ * *

                                                    There is a single table, called "Splunk". It has fixed columns * "host", "index", "source", "sourcetype". It has a variable type, so other - * fields are held in a map field called "_others".

                                                    + * fields are held in a map field called "_others". */ package org.apache.calcite.adapter.splunk; diff --git a/splunk/src/main/java/org/apache/calcite/adapter/splunk/search/SplunkConnectionImpl.java b/splunk/src/main/java/org/apache/calcite/adapter/splunk/search/SplunkConnectionImpl.java index f29196759173..9dcc92f5b2ac 100644 --- a/splunk/src/main/java/org/apache/calcite/adapter/splunk/search/SplunkConnectionImpl.java +++ b/splunk/src/main/java/org/apache/calcite/adapter/splunk/search/SplunkConnectionImpl.java @@ -329,7 +329,7 @@ public int getResultCount() { * results from a Splunk REST call. * *

                                                    The element type is either {@code String} or {@code String[]}, depending - * on the value of {@code source}.

                                                    */ + * on the value of {@code source}. */ public static class SplunkResultEnumerator implements Enumerator { private final CSVReader csvReader; private String[] fieldNames; diff --git a/testkit/src/main/java/org/apache/calcite/sql/test/AbstractSqlTester.java b/testkit/src/main/java/org/apache/calcite/sql/test/AbstractSqlTester.java index 5714621d183b..a0d1e19e23b2 100644 --- a/testkit/src/main/java/org/apache/calcite/sql/test/AbstractSqlTester.java +++ b/testkit/src/main/java/org/apache/calcite/sql/test/AbstractSqlTester.java @@ -307,18 +307,18 @@ public static String buildQueryAgg(String expression) { * Builds a query that extracts all literals as columns in an underlying * select. * - *

                                                    For example,

                                                    + *

                                                    For example, * *

                                                    {@code 1 < 5}
                                                    * - *

                                                    becomes

                                                    + *

                                                    becomes * *

                                                    {@code SELECT p0 < p1 * FROM (VALUES (1, 5)) AS t(p0, p1)}
                                                    * *

                                                    Null literals don't have enough type information to be extracted. * We push down {@code CAST(NULL AS type)} but raw nulls such as - * {@code CASE 1 WHEN 2 THEN 'a' ELSE NULL END} are left as is.

                                                    + * {@code CASE 1 WHEN 2 THEN 'a' ELSE NULL END} are left as is. * * @param factory Test factory * @param expression Scalar expression diff --git a/testkit/src/main/java/org/apache/calcite/sql/test/SqlOperatorFixture.java b/testkit/src/main/java/org/apache/calcite/sql/test/SqlOperatorFixture.java index a00a2d1f5237..5eb94dcbc171 100644 --- a/testkit/src/main/java/org/apache/calcite/sql/test/SqlOperatorFixture.java +++ b/testkit/src/main/java/org/apache/calcite/sql/test/SqlOperatorFixture.java @@ -503,6 +503,7 @@ void checkWinAgg( /** * Tests that an aggregate expression fails at run time. + * * @param expr An aggregate expression * @param inputValues Array of input values * @param expectedError Pattern for expected error diff --git a/testkit/src/main/java/org/apache/calcite/test/CalciteAssert.java b/testkit/src/main/java/org/apache/calcite/test/CalciteAssert.java index 2d72e4144788..1f0c0ee2cd3e 100644 --- a/testkit/src/main/java/org/apache/calcite/test/CalciteAssert.java +++ b/testkit/src/main/java/org/apache/calcite/test/CalciteAssert.java @@ -157,7 +157,7 @@ private CalciteAssert() {} * Which database to use for tests that require a JDBC data source. * * @see CalciteSystemProperty#TEST_DB - **/ + */ public static final DatabaseInstance DB = DatabaseInstance.valueOf(CalciteSystemProperty.TEST_DB.value()); @@ -233,7 +233,7 @@ public static AssertThat that(Config config) { } /** Short-hand for - * {@code CalciteAssert.that().with(Config.EMPTY).withModel(model)}. */ + * {@code CalciteAssert.that().with(Config.EMPTY).withModel(model)}. */ public static AssertThat model(String model) { return that().withModel(model); } @@ -1172,7 +1172,7 @@ public AssertThat with(ConnectionProperty property, Object value) { return with(connectionFactory.with(property, value)); } - /** Sets the Lex property. **/ + /** Sets the Lex property. */ public AssertThat with(Lex lex) { return with(CalciteConnectionProperty.LEX, lex); } @@ -1577,10 +1577,10 @@ public AssertQuery explainContains(String expected) { * *

                                                    Note: this API does NOT trigger the query, so you need to use something like * {@link #returns(String)}, or {@link #returnsUnordered(String...)} to trigger query - * execution

                                                    + * execution * *

                                                    Note: prefer using {@link #explainHookMatches(String)} if you assert - * the full plan tree as it produces slightly cleaner messages

                                                    + * the full plan tree as it produces slightly cleaner messages * * @param expectedPlan expected execution plan. The plan is normalized to LF line endings * @return updated assert query @@ -1597,10 +1597,10 @@ public AssertQuery explainHookContains(String expectedPlan) { * *

                                                    Note: this API does NOT trigger the query, so you need to use something like * {@link #returns(String)}, or {@link #returnsUnordered(String...)} to trigger query - * execution

                                                    + * execution * *

                                                    Note: prefer using {@link #explainHookMatches(SqlExplainLevel, Matcher)} if you assert - * the full plan tree as it produces slightly cleaner messages

                                                    + * the full plan tree as it produces slightly cleaner messages * * @param sqlExplainLevel the level of explain plan * @param expectedPlan expected execution plan. The plan is normalized to LF line endings @@ -1618,7 +1618,7 @@ public AssertQuery explainHookContains(SqlExplainLevel sqlExplainLevel, String e * *

                                                    Note: this API does NOT trigger the query, so you need to use something like * {@link #returns(String)}, or {@link #returnsUnordered(String...)} to trigger query - * execution

                                                    + * execution. * * @param expectedPlan expected execution plan. The plan is normalized to LF line endings * @return updated assert query @@ -1635,7 +1635,7 @@ public AssertQuery explainHookMatches(String expectedPlan) { * *

                                                    Note: this API does NOT trigger the query, so you need to use something like * {@link #returns(String)}, or {@link #returnsUnordered(String...)} to trigger query - * execution

                                                    + * execution. * * @param planMatcher execution plan matcher. The plan is normalized to LF line endings * @return updated assert query @@ -1652,7 +1652,7 @@ public AssertQuery explainHookMatches(Matcher planMatcher) { * *

                                                    Note: this API does NOT trigger the query, so you need to use something like * {@link #returns(String)}, or {@link #returnsUnordered(String...)} to trigger query - * execution

                                                    + * execution. * * @param sqlExplainLevel the level of explain plan * @param planMatcher execution plan matcher. The plan is normalized to LF line endings diff --git a/testkit/src/main/java/org/apache/calcite/test/DiffRepository.java b/testkit/src/main/java/org/apache/calcite/test/DiffRepository.java index 86cbc1b3016a..42af61dac30e 100644 --- a/testkit/src/main/java/org/apache/calcite/test/DiffRepository.java +++ b/testkit/src/main/java/org/apache/calcite/test/DiffRepository.java @@ -87,7 +87,7 @@ * * *

                                                    There is an accompanying reference file named after the class, - * src/test/resources/com/acme/test/MyTest.xml:

                                                    + * src/test/resources/com/acme/test/MyTest.xml: * *
                                                    
                                                      * <Root>
                                                    @@ -111,19 +111,19 @@
                                                      *
                                                      * 

                                                    If any of the test cases fails, a log file is generated, called * build/resources/test/com/acme/test/MyTest_actual.xml, containing the actual - * output.

                                                    + * output. * *

                                                    The log * file is otherwise identical to the reference log, so once the log file has * been verified, it can simply be copied over to become the new reference - * log:

                                                    + * log: * *
                                                    cp build/resources/test/com/acme/test/MyTest_actual.xml * src/test/resources/com/acme/test/MyTest.xml
                                                    * *

                                                    If a resource or test case does not exist, DiffRepository * creates them in the log file. Because DiffRepository is so forgiving, it is - * very easy to create new tests and test cases.

                                                    + * very easy to create new tests and test cases. * *

                                                    The {@link #lookup} method ensures that all test cases share the same * instance of the repository. This is important more than one test case fails. diff --git a/testkit/src/main/java/org/apache/calcite/test/DiffTestCase.java b/testkit/src/main/java/org/apache/calcite/test/DiffTestCase.java index e4f89183727c..9029bd95ce8d 100644 --- a/testkit/src/main/java/org/apache/calcite/test/DiffTestCase.java +++ b/testkit/src/main/java/org/apache/calcite/test/DiffTestCase.java @@ -177,7 +177,7 @@ protected OutputStream openTestLogOutputStream(File testFileSansExt) * *

                                                    NOTE: if you wrap the Writer returned by openTestLog() (e.g. with a * PrintWriter), be sure to flush the wrapping Writer before calling this - * method.

                                                    + * method. * * @see #diffFile(File, File) */ diff --git a/testkit/src/main/java/org/apache/calcite/test/Matchers.java b/testkit/src/main/java/org/apache/calcite/test/Matchers.java index e6975d985906..03553cecfe21 100644 --- a/testkit/src/main/java/org/apache/calcite/test/Matchers.java +++ b/testkit/src/main/java/org/apache/calcite/test/Matchers.java @@ -299,6 +299,7 @@ public static Matcher isRangeSet(final String value) { /** * Creates a {@link Matcher} that matches execution plan and trims {@code , id=123} node ids. * {@link RelNode#getId()} is not stable across runs, so this matcher enables to trim those. + * * @param value execpted execution plan * @return matcher */ diff --git a/testkit/src/main/java/org/apache/calcite/test/MockSqlOperatorTable.java b/testkit/src/main/java/org/apache/calcite/test/MockSqlOperatorTable.java index 60e9e2559e65..b4faea11c2b0 100644 --- a/testkit/src/main/java/org/apache/calcite/test/MockSqlOperatorTable.java +++ b/testkit/src/main/java/org/apache/calcite/test/MockSqlOperatorTable.java @@ -604,7 +604,7 @@ public static class StructuredFunction extends SqlFunction { } } - /** "COMPOSITE" user-defined scalar function. **/ + /** "COMPOSITE" user-defined scalar function. */ public static class CompositeFunction extends SqlFunction { public CompositeFunction() { super("COMPOSITE", diff --git a/testkit/src/main/java/org/apache/calcite/test/Unsafe.java b/testkit/src/main/java/org/apache/calcite/test/Unsafe.java index bde199936113..d5ca1d332cd5 100644 --- a/testkit/src/main/java/org/apache/calcite/test/Unsafe.java +++ b/testkit/src/main/java/org/apache/calcite/test/Unsafe.java @@ -33,6 +33,7 @@ private Unsafe() {} * {@link Matcher#matches(Object)} is forbidden in regular test code in favour of * {@link org.hamcrest.MatcherAssert#assertThat}. * Note: {@code Matcher#matches} is still useful when testing matcher implementations. + * * @param matcher matcher * @param actual actual value * @return the result of matcher.matches(actual) diff --git a/testkit/src/main/java/org/apache/calcite/test/catalog/CompoundNameColumnResolver.java b/testkit/src/main/java/org/apache/calcite/test/catalog/CompoundNameColumnResolver.java index f4a02717abc1..331b190f630d 100644 --- a/testkit/src/main/java/org/apache/calcite/test/catalog/CompoundNameColumnResolver.java +++ b/testkit/src/main/java/org/apache/calcite/test/catalog/CompoundNameColumnResolver.java @@ -32,7 +32,7 @@ import java.util.Map; /** ColumnResolver implementation that resolves CompoundNameColumn by simulating - * Phoenix behaviors. */ + * Phoenix behaviors. */ final class CompoundNameColumnResolver implements MockCatalogReader.ColumnResolver { private final Map nameMap = new HashMap<>(); private final Map> groupMap = new HashMap<>(); diff --git a/testkit/src/main/java/org/apache/calcite/util/Smalls.java b/testkit/src/main/java/org/apache/calcite/util/Smalls.java index deba6b01059b..6be22f3afec9 100644 --- a/testkit/src/main/java/org/apache/calcite/util/Smalls.java +++ b/testkit/src/main/java/org/apache/calcite/util/Smalls.java @@ -512,7 +512,7 @@ public int eval(@Parameter(name = "x") int x, } /** As {@link MyPlusFunction} but constructor has a - * {@link org.apache.calcite.schema.FunctionContext} parameter. */ + * {@link org.apache.calcite.schema.FunctionContext} parameter. */ public static class MyPlusInitFunction { public static final ThreadLocal INSTANCE_COUNT = new ThreadLocal<>().withInitial(() -> new AtomicInteger(0)); diff --git a/testkit/src/main/java/org/apache/calcite/util/TestUtil.java b/testkit/src/main/java/org/apache/calcite/util/TestUtil.java index 15c332c54e06..68f753d6b151 100644 --- a/testkit/src/main/java/org/apache/calcite/util/TestUtil.java +++ b/testkit/src/main/java/org/apache/calcite/util/TestUtil.java @@ -87,13 +87,16 @@ public static void assertEqualsVerbose( * literal. * *

                                                    For example, - *

                                                    string with "quotes" split
                                                    -   * across lines
                                                    + * + *
                                                    {@code
                                                    +   * string with "quotes" split
                                                    +   * across lines}
                                                    * *

                                                    becomes * - *

                                                    "string with \"quotes\" split" + NL +
                                                    -   *  "across lines"
                                                    + *
                                                    {@code
                                                    +   * "string with \"quotes\" split" + "\n"
                                                    +   *   + "across lines"}
                                                    */ public static String quoteForJava(String s) { s = Util.replace(s, "\\", "\\\\"); @@ -112,16 +115,17 @@ public static String quoteForJava(String s) { * Converts a string (which may contain quotes and newlines) into a java * literal. * - *

                                                    For example,

                                                    + *

                                                    For example, * - *

                                                    string with "quotes" split
                                                    -   * across lines
                                                    + *
                                                    {code
                                                    +   * string with "quotes" split
                                                    +   * across lines}
                                                    * - *

                                                    becomes

                                                    + *

                                                    becomes * - *

                                                    TestUtil.fold(
                                                    -   *  "string with \"quotes\" split\n",
                                                    -   *  + "across lines")
                                                    + *
                                                    {@code
                                                    +   * TestUtil.fold("string with \"quotes\" split\n",
                                                    +   *     + "across lines")}
                                                    */ public static String toJavaString(String s) { // Convert [string with "quotes" split