diff --git a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraEnumerator.java b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraEnumerator.java index a693db63092..e6a4be488d0 100644 --- a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraEnumerator.java +++ b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraEnumerator.java @@ -61,7 +61,7 @@ class CassandraEnumerator implements Enumerator { * * @return A new row from the results */ - public Object current() { + @Override public Object current() { if (fieldTypes.size() == 1) { // If we just have one field, produce it directly return currentRowField(0); @@ -123,7 +123,7 @@ private Object convertToEnumeratorObject(Object obj) { return obj; } - public boolean moveNext() { + @Override public boolean moveNext() { if (iterator.hasNext()) { current = iterator.next(); return true; @@ -132,11 +132,11 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { throw new UnsupportedOperationException(); } - public void close() { + @Override public void close() { // Nothing to do here } } diff --git a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraFilter.java b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraFilter.java index 46e56756a71..c6781904237 100644 --- a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraFilter.java +++ b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraFilter.java @@ -90,13 +90,13 @@ public CassandraFilter( return super.computeSelfCost(planner, mq).multiplyBy(0.1); } - public CassandraFilter copy(RelTraitSet traitSet, RelNode input, + @Override public CassandraFilter copy(RelTraitSet traitSet, RelNode input, RexNode condition) { return new CassandraFilter(getCluster(), traitSet, input, condition, partitionKeys, clusteringKeys, implicitFieldCollations); } - public void implement(Implementor implementor) { + @Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); implementor.add(null, Collections.singletonList(match)); } diff --git a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraLimit.java b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraLimit.java index 7627acb6ded..be6f42c30d0 100644 --- a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraLimit.java +++ b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraLimit.java @@ -54,7 +54,7 @@ public CassandraLimit(RelOptCluster cluster, RelTraitSet traitSet, return new CassandraLimit(getCluster(), traitSet, sole(newInputs), offset, fetch); } - public void implement(Implementor implementor) { + @Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); if (offset != null) { implementor.offset = RexLiteral.intValue(offset); @@ -64,7 +64,7 @@ public void implement(Implementor implementor) { } } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { super.explainTerms(pw); pw.itemIf("offset", offset, offset != null); pw.itemIf("fetch", fetch, fetch != null); diff --git a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraProject.java b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraProject.java index ca2367fb8e8..5c2424ebc20 100644 --- a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraProject.java +++ b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraProject.java @@ -57,7 +57,7 @@ public CassandraProject(RelOptCluster cluster, RelTraitSet traitSet, return super.computeSelfCost(planner, mq).multiplyBy(0.1); } - public void implement(Implementor implementor) { + @Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); final CassandraRules.RexToCassandraTranslator translator = new CassandraRules.RexToCassandraTranslator( diff --git a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraSchemaFactory.java b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraSchemaFactory.java index db64ac286a0..bed42e09371 100644 --- a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraSchemaFactory.java +++ b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraSchemaFactory.java @@ -30,7 +30,7 @@ public class CassandraSchemaFactory implements SchemaFactory { public CassandraSchemaFactory() { } - public Schema create(SchemaPlus parentSchema, String name, + @Override public Schema create(SchemaPlus parentSchema, String name, Map operand) { Map map = (Map) operand; String host = (String) map.get("host"); diff --git a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraSort.java b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraSort.java index b8a70e0728b..384e066ffeb 100644 --- a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraSort.java +++ b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraSort.java @@ -59,7 +59,7 @@ public CassandraSort(RelOptCluster cluster, RelTraitSet traitSet, return new CassandraSort(getCluster(), traitSet, input, collation); } - public void implement(Implementor implementor) { + @Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); List sortCollations = collation.getFieldCollations(); diff --git a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraTable.java b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraTable.java index ed652847836..cf60fcbbeaf 100644 --- a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraTable.java +++ b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraTable.java @@ -70,11 +70,11 @@ public CassandraTable(CassandraSchema schema, String columnFamily) { this(schema, columnFamily, false); } - public String toString() { + @Override public String toString() { return "CassandraTable {" + columnFamily + "}"; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { if (protoRowType == null) { protoRowType = schema.getRelDataType(columnFamily, view); } @@ -191,7 +191,7 @@ public Enumerable query(final Session session, List() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final ResultSet results = session.execute(query); // Skip results until we get to the right offset int skip = 0; @@ -204,12 +204,12 @@ public Enumerator enumerator() { }; } - public Queryable asQueryable(QueryProvider queryProvider, + @Override public Queryable asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { return new CassandraQueryable<>(queryProvider, schema, this, tableName); } - public RelNode toRel( + @Override public RelNode toRel( RelOptTable.ToRelContext context, RelOptTable relOptTable) { final RelOptCluster cluster = context.getCluster(); @@ -227,7 +227,7 @@ public CassandraQueryable(QueryProvider queryProvider, SchemaPlus schema, super(queryProvider, schema, table, tableName); } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { //noinspection unchecked final Enumerable enumerable = (Enumerable) getTable().query(getSession()); diff --git a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraTableScan.java b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraTableScan.java index d9a7936e66a..a2520693437 100644 --- a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraTableScan.java +++ b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraTableScan.java @@ -71,7 +71,7 @@ protected CassandraTableScan(RelOptCluster cluster, RelTraitSet traitSet, } } - public void implement(Implementor implementor) { + @Override public void implement(Implementor implementor) { implementor.cassandraTable = cassandraTable; implementor.table = table; } diff --git a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraToEnumerableConverter.java b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraToEnumerableConverter.java index 111d48ece9f..c26bf81eeca 100644 --- a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraToEnumerableConverter.java +++ b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraToEnumerableConverter.java @@ -68,7 +68,7 @@ protected CassandraToEnumerableConverter( return super.computeSelfCost(planner, mq).multiplyBy(.1); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { // Generates a call to "query" with the appropriate fields and predicates final BlockBuilder list = new BlockBuilder(); final CassandraRel.Implementor cassandraImplementor = new CassandraRel.Implementor(); 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 bc4560ed2b0..db045dbf632 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 @@ -67,11 +67,11 @@ class ArrayTable extends AbstractQueryableTable implements ScannableTable { this.supplier = supplier; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return protoRowType.apply(typeFactory); } - public Statistic getStatistic() { + @Override public Statistic getStatistic() { final List keys = new ArrayList<>(); final Content content = supplier.get(); for (Ord ord : Ord.zip(content.columns)) { @@ -82,21 +82,21 @@ public Statistic getStatistic() { return Statistics.of(content.size, keys, content.collations); } - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Content content = supplier.get(); return content.arrayEnumerator(); } }; } - public Queryable asQueryable(final QueryProvider queryProvider, + @Override public Queryable asQueryable(final QueryProvider queryProvider, SchemaPlus schema, String tableName) { return new AbstractTableQueryable(queryProvider, schema, this, tableName) { @SuppressWarnings("unchecked") - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Content content = supplier.get(); return content.enumerator(); } @@ -225,11 +225,11 @@ public static List asList(final Representation representation, // Cache size. It might be expensive to compute. final int size = representation.size(dataSet); return new AbstractList() { - public Object get(int index) { + @Override public Object get(int index) { return representation.getObject(dataSet, index); } - public int size() { + @Override public int size() { return size; } }; @@ -269,21 +269,21 @@ public static class ObjectArray implements Representation { this.ordinal = ordinal; } - public String toString() { + @Override public String toString() { return "ObjectArray(ordinal=" + ordinal + ")"; } - public RepresentationType getType() { + @Override public RepresentationType getType() { return RepresentationType.OBJECT_ARRAY; } - public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { + @Override public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { // We assume the values have been canonized. final List list = permuteList(valueSet.values, sources); return list.toArray(new Comparable[0]); } - public Object permute(Object dataSet, int[] sources) { + @Override public Object permute(Object dataSet, int[] sources) { Comparable[] list = (Comparable[]) dataSet; final int size = list.length; final Comparable[] comparables = new Comparable[size]; @@ -293,19 +293,19 @@ public Object permute(Object dataSet, int[] sources) { return comparables; } - public Object getObject(Object dataSet, int ordinal) { + @Override public Object getObject(Object dataSet, int ordinal) { return ((Comparable[]) dataSet)[ordinal]; } - public int getInt(Object dataSet, int ordinal) { + @Override public int getInt(Object dataSet, int ordinal) { return ((Number) getObject(dataSet, ordinal)).intValue(); } - public int size(Object dataSet) { + @Override public int size(Object dataSet) { return ((Comparable[]) dataSet).length; } - public String toString(Object dataSet) { + @Override public String toString(Object dataSet) { return Arrays.toString((Comparable[]) dataSet); } } @@ -323,40 +323,40 @@ public static class PrimitiveArray implements Representation { this.p = p; } - public String toString() { + @Override public String toString() { return "PrimitiveArray(ordinal=" + ordinal + ", primitive=" + primitive + ", p=" + p + ")"; } - public RepresentationType getType() { + @Override public RepresentationType getType() { return RepresentationType.PRIMITIVE_ARRAY; } - public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { + @Override public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { //noinspection unchecked return primitive.toArray2( permuteList((List) valueSet.values, sources)); } - public Object permute(Object dataSet, int[] sources) { + @Override public Object permute(Object dataSet, int[] sources) { return primitive.permute(dataSet, sources); } - public Object getObject(Object dataSet, int ordinal) { + @Override public Object getObject(Object dataSet, int ordinal) { return p.arrayItem(dataSet, ordinal); } - public int getInt(Object dataSet, int ordinal) { + @Override public int getInt(Object dataSet, int ordinal) { return Array.getInt(dataSet, ordinal); } - public int size(Object dataSet) { + @Override public int size(Object dataSet) { return Array.getLength(dataSet); } - public String toString(Object dataSet) { + @Override public String toString(Object dataSet) { return p.arrayToString(dataSet); } } @@ -367,35 +367,35 @@ public static class PrimitiveDictionary implements Representation { PrimitiveDictionary() { } - public String toString() { + @Override public String toString() { return "PrimitiveDictionary()"; } - public RepresentationType getType() { + @Override public RepresentationType getType() { return RepresentationType.PRIMITIVE_DICTIONARY; } - public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { + @Override public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { throw new UnsupportedOperationException(); // TODO: } - public Object permute(Object dataSet, int[] sources) { + @Override public Object permute(Object dataSet, int[] sources) { throw new UnsupportedOperationException(); // TODO: } - public Object getObject(Object dataSet, int ordinal) { + @Override public Object getObject(Object dataSet, int ordinal) { throw new UnsupportedOperationException(); // TODO: } - public int getInt(Object dataSet, int ordinal) { + @Override public int getInt(Object dataSet, int ordinal) { throw new UnsupportedOperationException(); // TODO: } - public int size(Object dataSet) { + @Override public int size(Object dataSet) { throw new UnsupportedOperationException(); // TODO: } - public String toString(Object dataSet) { + @Override public String toString(Object dataSet) { throw new UnsupportedOperationException(); // TODO: } } @@ -413,17 +413,17 @@ public static class ObjectDictionary implements Representation { this.representation = representation; } - public String toString() { + @Override public String toString() { return "ObjectDictionary(ordinal=" + ordinal + ", representation=" + representation + ")"; } - public RepresentationType getType() { + @Override public RepresentationType getType() { return RepresentationType.OBJECT_DICTIONARY; } - public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { + @Override public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { final int n = valueSet.map.keySet().size(); int extra = valueSet.containsNull ? 1 : 0; Comparable[] codeValues = @@ -446,29 +446,29 @@ public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { return Pair.of(codes, codeValues); } - public Object permute(Object dataSet, int[] sources) { + @Override public Object permute(Object dataSet, int[] sources) { final Pair pair = toPair(dataSet); Object codes = pair.left; Comparable[] codeValues = pair.right; return Pair.of(representation.permute(codes, sources), codeValues); } - public Object getObject(Object dataSet, int ordinal) { + @Override public Object getObject(Object dataSet, int ordinal) { final Pair pair = toPair(dataSet); int code = representation.getInt(pair.left, ordinal); return pair.right[code]; } - public int getInt(Object dataSet, int ordinal) { + @Override public int getInt(Object dataSet, int ordinal) { return ((Number) getObject(dataSet, ordinal)).intValue(); } - public int size(Object dataSet) { + @Override public int size(Object dataSet) { final Pair pair = toPair(dataSet); return representation.size(pair.left); } - public String toString(Object dataSet) { + @Override public String toString(Object dataSet) { return Column.asList(this, dataSet).toString(); } } @@ -482,31 +482,31 @@ public static class StringDictionary implements Representation { return "StringDictionary()"; } - public RepresentationType getType() { + @Override public RepresentationType getType() { return RepresentationType.STRING_DICTIONARY; } - public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { + @Override public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { throw new UnsupportedOperationException(); // TODO: } - public Object permute(Object dataSet, int[] sources) { + @Override public Object permute(Object dataSet, int[] sources) { throw new UnsupportedOperationException(); // TODO: } - public Object getObject(Object dataSet, int ordinal) { + @Override public Object getObject(Object dataSet, int ordinal) { throw new UnsupportedOperationException(); // TODO: } - public int getInt(Object dataSet, int ordinal) { + @Override public int getInt(Object dataSet, int ordinal) { throw new UnsupportedOperationException(); // TODO: } - public int size(Object dataSet) { + @Override public int size(Object dataSet) { throw new UnsupportedOperationException(); // TODO: } - public String toString(Object dataSet) { + @Override public String toString(Object dataSet) { return Column.asList(this, dataSet).toString(); } } @@ -516,35 +516,35 @@ public static class ByteStringDictionary implements Representation { ByteStringDictionary() { } - public String toString() { + @Override public String toString() { return "ByteStringDictionary()"; } - public RepresentationType getType() { + @Override public RepresentationType getType() { return RepresentationType.BYTE_STRING_DICTIONARY; } - public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { + @Override public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { throw new UnsupportedOperationException(); // TODO: } - public Object permute(Object dataSet, int[] sources) { + @Override public Object permute(Object dataSet, int[] sources) { throw new UnsupportedOperationException(); // TODO: } - public Object getObject(Object dataSet, int ordinal) { + @Override public Object getObject(Object dataSet, int ordinal) { throw new UnsupportedOperationException(); // TODO: } - public int getInt(Object dataSet, int ordinal) { + @Override public int getInt(Object dataSet, int ordinal) { throw new UnsupportedOperationException(); // TODO: } - public int size(Object dataSet) { + @Override public int size(Object dataSet) { throw new UnsupportedOperationException(); // TODO: } - public String toString(Object dataSet) { + @Override public String toString(Object dataSet) { return Column.asList(this, dataSet).toString(); } } @@ -557,39 +557,39 @@ public static class Constant implements Representation { this.ordinal = ordinal; } - public String toString() { + @Override public String toString() { return "Constant(ordinal=" + ordinal + ")"; } - public RepresentationType getType() { + @Override public RepresentationType getType() { return RepresentationType.CONSTANT; } - public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { + @Override public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { final int size = valueSet.values.size(); return Pair.of(size == 0 ? null : valueSet.values.get(0), size); } - public Object permute(Object dataSet, int[] sources) { + @Override public Object permute(Object dataSet, int[] sources) { return dataSet; } - public Object getObject(Object dataSet, int ordinal) { + @Override public Object getObject(Object dataSet, int ordinal) { Pair pair = toPair(dataSet); return pair.left; } - public int getInt(Object dataSet, int ordinal) { + @Override public int getInt(Object dataSet, int ordinal) { Pair pair = toPair(dataSet); return ((Number) pair.left).intValue(); } - public int size(Object dataSet) { + @Override public int size(Object dataSet) { Pair pair = toPair(dataSet); return pair.right; } - public String toString(Object dataSet) { + @Override public String toString(Object dataSet) { Pair pair = toPair(dataSet); return Collections.nCopies(pair.right, pair.left).toString(); } @@ -622,11 +622,11 @@ public static class BitSlicedPrimitiveArray implements Representation { + ", signed=" + signed + ")"; } - public RepresentationType getType() { + @Override public RepresentationType getType() { return RepresentationType.BIT_SLICED_PRIMITIVE_ARRAY; } - public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { + @Override public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { final int chunksPerWord = 64 / bitCount; final List valueList = permuteList(valueSet.values, sources); @@ -677,7 +677,7 @@ public Object freeze(ColumnLoader.ValueSet valueSet, int[] sources) { return longs; } - public Object permute(Object dataSet, int[] sources) { + @Override public Object permute(Object dataSet, int[] sources) { final long[] longs0 = (long[]) dataSet; int n = sources.length; final long[] longs = new long[longs0.length]; @@ -689,7 +689,7 @@ public Object permute(Object dataSet, int[] sources) { return longs; } - public Object getObject(Object dataSet, int ordinal) { + @Override public Object getObject(Object dataSet, int ordinal) { final long[] longs = (long[]) dataSet; final int chunksPerWord = 64 / bitCount; final int word = ordinal / chunksPerWord; @@ -721,7 +721,7 @@ public Object getObject(Object dataSet, int ordinal) { } } - public int getInt(Object dataSet, int ordinal) { + @Override public int getInt(Object dataSet, int ordinal) { final long[] longs = (long[]) dataSet; final int chunksPerWord = 64 / bitCount; final int word = ordinal / chunksPerWord; @@ -771,13 +771,13 @@ public static void orLong( values[word] |= value << shift; } - public int size(Object dataSet) { + @Override public int size(Object dataSet) { final long[] longs = (long[]) dataSet; final int chunksPerWord = 64 / bitCount; return longs.length * chunksPerWord; // may be slightly too high } - public String toString(Object dataSet) { + @Override public String toString(Object dataSet) { return Column.asList(this, dataSet).toString(); } } @@ -788,11 +788,11 @@ private static List permuteList( return list; } return new AbstractList() { - public E get(int index) { + @Override public E get(int index) { return list.get(sources[index]); } - public int size() { + @Override public int size() { return list.size(); } }; @@ -846,19 +846,19 @@ private static class ObjectEnumerator implements Enumerator { this.representation = column.representation; } - public Object current() { + @Override public Object current() { return representation.getObject(dataSet, i); } - public boolean moveNext() { + @Override public boolean moveNext() { return ++i < rowCount; } - public void reset() { + @Override public void reset() { i = -1; } - public void close() { + @Override public void close() { } } @@ -874,7 +874,7 @@ private static class ArrayEnumerator implements Enumerator { this.columns = columns; } - public Object[] current() { + @Override public Object[] current() { Object[] objects = new Object[columns.size()]; for (int j = 0; j < objects.length; j++) { final Column pair = columns.get(j); @@ -883,15 +883,15 @@ public Object[] current() { return objects; } - public boolean moveNext() { + @Override public boolean moveNext() { return ++i < rowCount; } - public void reset() { + @Override public void reset() { i = -1; } - public void close() { + @Override public void close() { } } } diff --git a/core/src/main/java/org/apache/calcite/adapter/clone/CloneSchema.java b/core/src/main/java/org/apache/calcite/adapter/clone/CloneSchema.java index 3f1f7eedcd6..2b82d387b12 100644 --- a/core/src/main/java/org/apache/calcite/adapter/clone/CloneSchema.java +++ b/core/src/main/java/org/apache/calcite/adapter/clone/CloneSchema.java @@ -152,7 +152,7 @@ public static Table createCloneTable(final JavaTypeFactory typeFactory, * } */ public static class Factory implements SchemaFactory { - public Schema create( + @Override public Schema create( SchemaPlus parentSchema, String name, Map operand) { diff --git a/core/src/main/java/org/apache/calcite/adapter/clone/ColumnLoader.java b/core/src/main/java/org/apache/calcite/adapter/clone/ColumnLoader.java index 3128b0d584c..1b89c46b398 100644 --- a/core/src/main/java/org/apache/calcite/adapter/clone/ColumnLoader.java +++ b/core/src/main/java/org/apache/calcite/adapter/clone/ColumnLoader.java @@ -151,12 +151,12 @@ private void load(final RelDataType elementType, new AbstractList() { final List fields = elementType.getFieldList(); - public Type get(int index) { + @Override public Type get(int index) { return typeFactory.getJavaClass( fields.get(index).getType()); } - public int size() { + @Override public int size() { return fields.size(); } }; @@ -169,11 +169,11 @@ public int size() { : new AbstractList() { final int slice = pair.i; - public Object get(int index) { + @Override public Object get(int index) { return ((Object[]) list.get(index))[slice]; } - public int size() { + @Override public int size() { return list.size(); } }; @@ -444,7 +444,7 @@ private static class Kev implements Comparable { this.key = key; } - public int compareTo(Kev o) { + @Override public int compareTo(Kev o) { //noinspection unchecked return key.compareTo(o.key); } diff --git a/core/src/main/java/org/apache/calcite/adapter/clone/ListTable.java b/core/src/main/java/org/apache/calcite/adapter/clone/ListTable.java index 8c6184636bc..b522df04998 100644 --- a/core/src/main/java/org/apache/calcite/adapter/clone/ListTable.java +++ b/core/src/main/java/org/apache/calcite/adapter/clone/ListTable.java @@ -58,35 +58,35 @@ class ListTable extends AbstractQueryableTable { this.list = list; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return protoRowType.apply(typeFactory); } - public Statistic getStatistic() { + @Override public Statistic getStatistic() { return Statistics.of(list.size(), ImmutableList.of()); } - public Queryable asQueryable(final QueryProvider queryProvider, + @Override public Queryable asQueryable(final QueryProvider queryProvider, SchemaPlus schema, String tableName) { return new AbstractQueryable() { - public Type getElementType() { + @Override public Type getElementType() { return elementType; } - public Expression getExpression() { + @Override public Expression getExpression() { return expression; } - public QueryProvider getProvider() { + @Override public QueryProvider getProvider() { return queryProvider; } - public Iterator iterator() { + @Override public Iterator iterator() { //noinspection unchecked return list.iterator(); } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { //noinspection unchecked return Linq4j.enumerator(list); } 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 d5e9a411283..0537aa4f942 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 @@ -111,10 +111,10 @@ static List fieldTypes( final JavaTypeFactory typeFactory, final List inputTypes) { return new AbstractList() { - public Type get(int index) { + @Override public Type get(int index) { return EnumUtils.javaClass(typeFactory, inputTypes.get(index)); } - public int size() { + @Override public int size() { return inputTypes.size(); } }; @@ -126,13 +126,13 @@ static List fieldRowTypes( final List argList) { final List inputFields = inputRowType.getFieldList(); return new AbstractList() { - public RelDataType get(int index) { + @Override public RelDataType get(int index) { final int arg = argList.get(index); return arg < inputFields.size() ? inputFields.get(arg).getType() : extraInputs.get(arg - inputFields.size()).getType(); } - public int size() { + @Override public int size() { return argList.size(); } }; @@ -1020,7 +1020,7 @@ private static class HopEnumerator implements Enumerator { list = new ArrayDeque<>(); } - public Object[] current() { + @Override public Object[] current() { if (list.size() > 0) { return takeOne(); } else { @@ -1038,16 +1038,16 @@ public Object[] current() { } } - public boolean moveNext() { + @Override public boolean moveNext() { return list.size() > 0 || inputEnumerator.moveNext(); } - public void reset() { + @Override public void reset() { inputEnumerator.reset(); list.clear(); } - public void close() { + @Override public void close() { } private Object[] takeOne() { @@ -1080,19 +1080,19 @@ public static Enumerable tumbling( return new Enumerator() { Enumerator inputs = inputEnumerable.enumerator(); - public TResult current() { + @Override public TResult current() { return outSelector.apply(inputs.current()); } - public boolean moveNext() { + @Override public boolean moveNext() { return inputs.moveNext(); } - public void reset() { + @Override public void reset() { inputs.reset(); } - public void close() { + @Override public void close() { } }; } diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableAggregate.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableAggregate.java index 03f3192b3c3..8a4d4992106 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableAggregate.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableAggregate.java @@ -90,7 +90,7 @@ public EnumerableAggregate(RelOptCluster cluster, RelTraitSet traitSet, } } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final JavaTypeFactory typeFactory = implementor.getTypeFactory(); final BlockBuilder builder = new BlockBuilder(); final EnumerableRel child = (EnumerableRel) getInput(); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableAggregateBase.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableAggregateBase.java index ffb26d4b37a..da6741128ea 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableAggregateBase.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableAggregateBase.java @@ -188,43 +188,43 @@ protected class AggContextImpl implements AggContext { this.typeFactory = typeFactory; } - public SqlAggFunction aggregation() { + @Override public SqlAggFunction aggregation() { return agg.call.getAggregation(); } - public RelDataType returnRelType() { + @Override public RelDataType returnRelType() { return agg.call.type; } - public Type returnType() { + @Override public Type returnType() { return EnumUtils.javaClass(typeFactory, returnRelType()); } - public List parameterRelTypes() { + @Override public List parameterRelTypes() { return EnumUtils.fieldRowTypes(getInput().getRowType(), null, agg.call.getArgList()); } - public List parameterTypes() { + @Override public List parameterTypes() { return EnumUtils.fieldTypes( typeFactory, parameterRelTypes()); } - public List groupSets() { + @Override public List groupSets() { return groupSets; } - public List keyOrdinals() { + @Override public List keyOrdinals() { return groupSet.asList(); } - public List keyRelTypes() { + @Override public List keyRelTypes() { return EnumUtils.fieldRowTypes(getInput().getRowType(), null, groupSet.asList()); } - public List keyTypes() { + @Override public List keyTypes() { return EnumUtils.fieldTypes(typeFactory, keyRelTypes()); } } @@ -253,7 +253,7 @@ protected void createAccumulatorAdders( AggAddContext addContext = new AggAddContextImpl(builder2, accumulator) { - public List rexArguments() { + @Override public List rexArguments() { List inputTypes = inputPhysType.getRowType().getFieldList(); List args = new ArrayList<>(); @@ -263,14 +263,14 @@ public List rexArguments() { return args; } - public RexNode rexFilterArgument() { + @Override public RexNode rexFilterArgument() { return agg.call.filterArg < 0 ? null : RexInputRef.of(agg.call.filterArg, inputPhysType.getRowType()); } - public RexToLixTranslator rowTranslator() { + @Override public RexToLixTranslator rowTranslator() { return RexToLixTranslator.forAggregation(typeFactory, currentBlock(), new RexToLixTranslator.InputGetterImpl( diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableBindable.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableBindable.java index fc2223ff0ab..9ee7ec81aad 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableBindable.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableBindable.java @@ -55,11 +55,11 @@ protected EnumerableBindable(RelOptCluster cluster, RelNode input) { return new EnumerableBindable(getCluster(), sole(inputs)); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { final ImmutableMap map = ImmutableMap.of(); final Bindable bindable = EnumerableInterpretable.toBindable(map, null, (EnumerableRel) getInput(), EnumerableRel.Prefer.ARRAY); @@ -67,7 +67,7 @@ public Enumerable bind(DataContext dataContext) { return arrayBindable.bind(dataContext); } - public Node implement(final InterpreterImplementor implementor) { + @Override public Node implement(final InterpreterImplementor implementor) { return () -> { final Sink sink = implementor.relSinks.get(EnumerableBindable.this).get(0); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCalc.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCalc.java index a09d9fa3e90..fbf0b0a054b 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCalc.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCalc.java @@ -108,7 +108,7 @@ public static EnumerableCalc create(final RelNode input, return new EnumerableCalc(getCluster(), traitSet, child, program); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final JavaTypeFactory typeFactory = implementor.getTypeFactory(); final BlockBuilder builder = new BlockBuilder(); final EnumerableRel child = (EnumerableRel) getInput(); @@ -284,7 +284,7 @@ public Result implement(EnumerableRelImplementor implementor, Prefer pref) { input.getRowType(), input.getCluster().getTypeFactory(), traitSet); } - public RexProgram getProgram() { + @Override public RexProgram getProgram() { return program; } } diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCollect.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCollect.java index 625748dd4cf..ff7bf0539fa 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCollect.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCollect.java @@ -40,7 +40,7 @@ public EnumerableCollect(RelOptCluster cluster, RelTraitSet traitSet, return new EnumerableCollect(getCluster(), traitSet, newInput, fieldName); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final BlockBuilder builder = new BlockBuilder(); final EnumerableRel child = (EnumerableRel) getInput(); // REVIEW zabetak January 7, 2019: Even if we ask the implementor to provide a result diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableConvention.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableConvention.java index 6acc25da01f..3cbffaf0c1e 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableConvention.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableConvention.java @@ -43,11 +43,11 @@ public enum EnumerableConvention implements Convention { return getName(); } - public Class getInterface() { + @Override public Class getInterface() { return EnumerableRel.class; } - public String getName() { + @Override public String getName() { return "ENUMERABLE"; } @@ -67,26 +67,26 @@ public String getName() { return rel; } - public RelTraitDef getTraitDef() { + @Override public RelTraitDef getTraitDef() { return ConventionTraitDef.INSTANCE; } - public boolean satisfies(RelTrait trait) { + @Override public boolean satisfies(RelTrait trait) { return this == trait; } - public void register(RelOptPlanner planner) {} + @Override public void register(RelOptPlanner planner) {} - public boolean canConvertConvention(Convention toConvention) { + @Override public boolean canConvertConvention(Convention toConvention) { return false; } - public boolean useAbstractConvertersForConversion(RelTraitSet fromTraits, + @Override public boolean useAbstractConvertersForConversion(RelTraitSet fromTraits, RelTraitSet toTraits) { return true; } - public RelFactories.Struct getRelFactories() { + @Override public RelFactories.Struct getRelFactories() { return RelFactories.Struct.fromContext( Contexts.of( EnumerableRelFactories.ENUMERABLE_TABLE_SCAN_FACTORY, diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCorrelate.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCorrelate.java index 86bc0420733..666d84417b0 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCorrelate.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCorrelate.java @@ -104,7 +104,7 @@ public static EnumerableCorrelate create( return DeriveMode.LEFT_FIRST; } - public Result implement(EnumerableRelImplementor implementor, + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final BlockBuilder builder = new BlockBuilder(); final Result leftResult = diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableFilter.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableFilter.java index 5af195c826f..4a2075ca81c 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableFilter.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableFilter.java @@ -66,12 +66,12 @@ public static EnumerableFilter create(final RelNode input, return new EnumerableFilter(cluster, traitSet, input, condition); } - public EnumerableFilter copy(RelTraitSet traitSet, RelNode input, + @Override public EnumerableFilter copy(RelTraitSet traitSet, RelNode input, RexNode condition) { return new EnumerableFilter(getCluster(), traitSet, input, condition); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { // EnumerableCalc is always better throw new UnsupportedOperationException(); } diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableInterpretable.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableInterpretable.java index ee74a5302f0..44c992e5720 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableInterpretable.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableInterpretable.java @@ -79,7 +79,7 @@ protected EnumerableInterpretable(RelOptCluster cluster, RelNode input) { return new EnumerableInterpretable(getCluster(), sole(inputs)); } - public Node implement(final InterpreterImplementor implementor) { + @Override public Node implement(final InterpreterImplementor implementor) { final Bindable bindable = toBindable(implementor.internalParameters, implementor.spark, (EnumerableRel) getInput(), EnumerableRel.Prefer.ARRAY); @@ -181,29 +181,29 @@ static ArrayBindable box(final Bindable bindable) { return (ArrayBindable) bindable; } return new ArrayBindable() { - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { final Enumerable enumerable = bindable.bind(dataContext); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Enumerator enumerator = enumerable.enumerator(); return new Enumerator() { - public Object[] current() { + @Override public Object[] current() { return new Object[] {enumerator.current()}; } - public boolean moveNext() { + @Override public boolean moveNext() { return enumerator.moveNext(); } - public void reset() { + @Override public void reset() { enumerator.reset(); } - public void close() { + @Override public void close() { enumerator.close(); } }; @@ -226,7 +226,7 @@ private static class EnumerableNode implements Node { this.sink = compiler.sink(rel); } - public void run() throws InterruptedException { + @Override public void run() throws InterruptedException { final Enumerator enumerator = enumerable.enumerator(); while (enumerator.moveNext()) { Object[] values = enumerator.current(); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableInterpreter.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableInterpreter.java index 4e8f63336d3..7ad2465b453 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableInterpreter.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableInterpreter.java @@ -83,7 +83,7 @@ public static EnumerableInterpreter create(RelNode input, double factor) { factor); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final JavaTypeFactory typeFactory = implementor.getTypeFactory(); final BlockBuilder builder = new BlockBuilder(); final PhysType physType = diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableIntersect.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableIntersect.java index a18c5c4a1a8..ab95359709e 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableIntersect.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableIntersect.java @@ -36,12 +36,12 @@ public EnumerableIntersect(RelOptCluster cluster, RelTraitSet traitSet, super(cluster, traitSet, inputs, all); } - public EnumerableIntersect copy(RelTraitSet traitSet, List inputs, + @Override public EnumerableIntersect copy(RelTraitSet traitSet, List inputs, boolean all) { return new EnumerableIntersect(getCluster(), traitSet, inputs, all); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final BlockBuilder builder = new BlockBuilder(); Expression intersectExp = null; for (Ord ord : Ord.zip(inputs)) { diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableLimit.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableLimit.java index b7eae2023a8..fb0836eb237 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableLimit.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableLimit.java @@ -90,7 +90,7 @@ public static EnumerableLimit create(final RelNode input, RexNode offset, .itemIf("fetch", fetch, fetch != null); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final BlockBuilder builder = new BlockBuilder(); final EnumerableRel child = (EnumerableRel) getInput(); final Result result = implementor.visitChild(this, 0, child, pref); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMatch.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMatch.java index 85bfaedbfe3..bb0d09539ea 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMatch.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMatch.java @@ -102,7 +102,7 @@ public static EnumerableMatch create(RelNode input, RelDataType rowType, subsets, allRows, partitionKeys, orderKeys, interval); } - public EnumerableRel.Result implement(EnumerableRelImplementor implementor, + @Override public EnumerableRel.Result implement(EnumerableRelImplementor implementor, EnumerableRel.Prefer pref) { final BlockBuilder builder = new BlockBuilder(); final EnumerableRel input = (EnumerableRel) getInput(); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMergeJoin.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMergeJoin.java index 8a16be08019..10c253b1a38 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMergeJoin.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMergeJoin.java @@ -393,7 +393,7 @@ public static EnumerableMergeJoin create(RelNode left, RelNode right, return planner.getCostFactory().makeCost(d, 0, 0); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { BlockBuilder builder = new BlockBuilder(); final Result leftResult = implementor.visitChild(this, 0, (EnumerableRel) left, pref); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMinus.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMinus.java index 1bbda3f66e9..656c9a43715 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMinus.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMinus.java @@ -36,12 +36,12 @@ public EnumerableMinus(RelOptCluster cluster, RelTraitSet traitSet, super(cluster, traitSet, inputs, all); } - public EnumerableMinus copy(RelTraitSet traitSet, List inputs, + @Override public EnumerableMinus copy(RelTraitSet traitSet, List inputs, boolean all) { return new EnumerableMinus(getCluster(), traitSet, inputs, all); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final BlockBuilder builder = new BlockBuilder(); Expression minusExp = null; for (Ord ord : Ord.zip(inputs)) { diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableNestedLoopJoin.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableNestedLoopJoin.java index 1561d8fb2f4..fce87e51e0e 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableNestedLoopJoin.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableNestedLoopJoin.java @@ -148,7 +148,7 @@ public static EnumerableNestedLoopJoin create( return DeriveMode.LEFT_FIRST; } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final BlockBuilder builder = new BlockBuilder(); final Result leftResult = implementor.visitChild(this, 0, (EnumerableRel) left, pref); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableProject.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableProject.java index 7c62e2f3a88..4c718833dd3 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableProject.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableProject.java @@ -78,13 +78,13 @@ public static EnumerableProject create(final RelNode input, return new EnumerableProject(cluster, traitSet, input, projects, rowType); } - public EnumerableProject copy(RelTraitSet traitSet, RelNode input, + @Override public EnumerableProject copy(RelTraitSet traitSet, RelNode input, List projects, RelDataType rowType) { return new EnumerableProject(getCluster(), traitSet, input, projects, rowType); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { // EnumerableCalcRel is always better throw new UnsupportedOperationException(); } diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRelFactories.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRelFactories.java index ab9cdd08c84..8dcff99be32 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRelFactories.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRelFactories.java @@ -53,7 +53,7 @@ public class EnumerableRelFactories { */ private static class TableScanFactoryImpl implements org.apache.calcite.rel.core.RelFactories.TableScanFactory { - public RelNode createScan(RelOptTable.ToRelContext toRelContext, RelOptTable table) { + @Override public RelNode createScan(RelOptTable.ToRelContext toRelContext, RelOptTable table) { return EnumerableTableScan.create(toRelContext.getCluster(), table); } } @@ -64,7 +64,7 @@ public RelNode createScan(RelOptTable.ToRelContext toRelContext, RelOptTable tab */ private static class ProjectFactoryImpl implements org.apache.calcite.rel.core.RelFactories.ProjectFactory { - public RelNode createProject(RelNode input, List hints, + @Override public RelNode createProject(RelNode input, List hints, List childExprs, List fieldNames) { final RelDataType rowType = RexUtil.createStructType(input.getCluster().getTypeFactory(), childExprs, @@ -79,7 +79,7 @@ public RelNode createProject(RelNode input, List hints, */ private static class FilterFactoryImpl implements org.apache.calcite.rel.core.RelFactories.FilterFactory { - public RelNode createFilter(RelNode input, RexNode condition, + @Override public RelNode createFilter(RelNode input, RexNode condition, Set variablesSet) { return EnumerableFilter.create(input, condition); } @@ -91,7 +91,7 @@ public RelNode createFilter(RelNode input, RexNode condition, */ private static class SortFactoryImpl implements org.apache.calcite.rel.core.RelFactories.SortFactory { - public RelNode createSort(RelNode input, RelCollation collation, + @Override public RelNode createSort(RelNode input, RelCollation collation, RexNode offset, RexNode fetch) { return EnumerableSort.create(input, collation, offset, fetch); } diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRelImplementor.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRelImplementor.java index eafd642a216..0a6a02c4145 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRelImplementor.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRelImplementor.java @@ -472,7 +472,7 @@ public EnumerableRel.Result result(PhysType physType, BlockStatement block) { block, physType, ((PhysTypeImpl) physType).format); } - public SqlConformance getConformance() { + @Override public SqlConformance getConformance() { return (SqlConformance) map.getOrDefault("_conformance", SqlConformanceEnum.DEFAULT); } diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSort.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSort.java index 568a4ee6f28..559e1c89a25 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSort.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSort.java @@ -68,7 +68,7 @@ public static EnumerableSort create(RelNode child, RelCollation collation, offset, fetch); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final BlockBuilder builder = new BlockBuilder(); final EnumerableRel child = (EnumerableRel) getInput(); final Result result = implementor.visitChild(this, 0, child, pref); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSortRule.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSortRule.java index 84ef93c8eec..a449c8bec7a 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSortRule.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSortRule.java @@ -39,7 +39,7 @@ protected EnumerableSortRule(Config config) { super(config); } - public RelNode convert(RelNode rel) { + @Override public RelNode convert(RelNode rel) { final Sort sort = (Sort) rel; if (sort.offset != null || sort.fetch != null) { return null; diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSortedAggregate.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSortedAggregate.java index 1bb5fd31a28..77041dfccbe 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSortedAggregate.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSortedAggregate.java @@ -100,7 +100,7 @@ public EnumerableSortedAggregate( return null; } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { if (!Aggregate.isSimple(this)) { throw Util.needToImplement("EnumerableSortedAggregate"); } diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSortedAggregateRule.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSortedAggregateRule.java index 06577c2a18a..cfc3660af43 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSortedAggregateRule.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableSortedAggregateRule.java @@ -44,7 +44,7 @@ protected EnumerableSortedAggregateRule(Config config) { super(config); } - public RelNode convert(RelNode rel) { + @Override public RelNode convert(RelNode rel) { final LogicalAggregate agg = (LogicalAggregate) rel; if (!Aggregate.isSimple(agg)) { return null; diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableFunctionScan.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableFunctionScan.java index bd3c7ff5d4c..7e2b507a328 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableFunctionScan.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableFunctionScan.java @@ -65,7 +65,7 @@ public EnumerableTableFunctionScan(RelOptCluster cluster, elementType, rowType, rexCall, columnMappings); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { if (isImplementorDefined((RexCall) getCall())) { return tvfImplementorBasedImplement(implementor, pref); } else { diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableModify.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableModify.java index f49ba7cc1b0..b40c809f679 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableModify.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableModify.java @@ -70,7 +70,7 @@ public EnumerableTableModify(RelOptCluster cluster, RelTraitSet traits, isFlattened()); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final BlockBuilder builder = new BlockBuilder(); final Result result = implementor.visitChild( this, 0, (EnumerableRel) getInput(), pref); 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 13814639e89..1fbee99d429 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 @@ -317,7 +317,7 @@ private boolean hasCollectionField(RelDataType rowType) { return new EnumerableTableScan(getCluster(), traitSet, table, elementType); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { // Note that representation is ARRAY. This assumes that the table // returns a Object[] for each record. Actually a Table can // return any type T. And, if it is a JdbcTable, we'd like to be diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableUncollect.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableUncollect.java index 0f7d709c507..18add9cc4eb 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableUncollect.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableUncollect.java @@ -76,7 +76,7 @@ public static EnumerableUncollect create(RelTraitSet traitSet, RelNode input, withOrdinality); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final BlockBuilder builder = new BlockBuilder(); final EnumerableRel child = (EnumerableRel) getInput(); final Result result = implementor.visitChild(this, 0, child, pref); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableUnion.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableUnion.java index be1f4d3d21d..701cbd2a051 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableUnion.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableUnion.java @@ -36,12 +36,12 @@ public EnumerableUnion(RelOptCluster cluster, RelTraitSet traitSet, super(cluster, traitSet, inputs, all); } - public EnumerableUnion copy(RelTraitSet traitSet, List inputs, + @Override public EnumerableUnion copy(RelTraitSet traitSet, List inputs, boolean all) { return new EnumerableUnion(getCluster(), traitSet, inputs, all); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final BlockBuilder builder = new BlockBuilder(); Expression unionExp = null; for (Ord ord : Ord.zip(inputs)) { diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableValues.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableValues.java index 8c6fa5cae51..4a624a8a4da 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableValues.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableValues.java @@ -107,7 +107,7 @@ public static EnumerableValues create(RelOptCluster cluster, return DeriveMode.PROHIBITED; } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { /* return Linq4j.asEnumerable( new Object[][] { diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableWindow.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableWindow.java index 0e8cc219aac..900349ff30a 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableWindow.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableWindow.java @@ -78,7 +78,7 @@ public class EnumerableWindow extends Window implements EnumerableRel { constants, rowType, groups); } - public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { + @Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { return super.computeSelfCost(planner, mq) .multiplyBy(EnumerableConvention.COST_MULTIPLIER); } @@ -102,7 +102,7 @@ private WindowRelInputGetter(Expression row, this.constants = constants; } - public Expression field(BlockBuilder list, int index, Type storageType) { + @Override public Expression field(BlockBuilder list, int index, Type storageType) { if (index < actualInputFieldCount) { Expression current = list.append("current", row); return rowPhysType.fieldReference(current, index, storageType); @@ -159,7 +159,7 @@ private void sampleOfTheGeneratedWindowedAggregate() { // source = Linq4j.asEnumerable(list); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final JavaTypeFactory typeFactory = implementor.getTypeFactory(); final EnumerableRel child = (EnumerableRel) getInput(); final BlockBuilder builder = new BlockBuilder(); @@ -533,7 +533,7 @@ public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final DeclarationStatement jDecl, final PhysType inputPhysType) { return block -> new WinAggFrameResultContext() { - public RexToLixTranslator rowTranslator(Expression rowIndex) { + @Override public RexToLixTranslator rowTranslator(Expression rowIndex) { Expression row = getRow(rowIndex); final RexToLixTranslator.InputGetter inputGetter = @@ -545,7 +545,7 @@ public RexToLixTranslator rowTranslator(Expression rowIndex) { block, inputGetter, conformance); } - public Expression computeIndex(Expression offset, + @Override public Expression computeIndex(Expression offset, WinAggImplementor.SeekType seekType) { Expression index; if (seekType == WinAggImplementor.SeekType.AGG_INDEX) { @@ -583,15 +583,15 @@ private Expression checkBounds(Expression rowIndex, return res; } - public Expression rowInFrame(Expression rowIndex) { + @Override public Expression rowInFrame(Expression rowIndex) { return checkBounds(rowIndex, startX, endX); } - public Expression rowInPartition(Expression rowIndex) { + @Override public Expression rowInPartition(Expression rowIndex) { return checkBounds(rowIndex, minX, maxX); } - public Expression compareRows(Expression a, Expression b) { + @Override public Expression compareRows(Expression a, Expression b) { return Expressions.call(comparator_, BuiltInMethod.COMPARATOR_COMPARE.method, getRow(a), getRow(b)); @@ -605,27 +605,27 @@ public Expression getRow(Expression rowIndex) { inputPhysType.getJavaRowType())); } - public Expression index() { + @Override public Expression index() { return i_; } - public Expression startIndex() { + @Override public Expression startIndex() { return startX; } - public Expression endIndex() { + @Override public Expression endIndex() { return endX; } - public Expression hasRows() { + @Override public Expression hasRows() { return hasRows; } - public Expression getFrameRowCount() { + @Override public Expression getFrameRowCount() { return frameRowCount; } - public Expression getPartitionRowCount() { + @Override public Expression getPartitionRowCount() { return partitionRowCount; } }; @@ -762,41 +762,41 @@ private void declareAndResetState(final JavaTypeFactory typeFactory, for (final AggImpState agg : aggs) { agg.context = new WinAggContext() { - public SqlAggFunction aggregation() { + @Override public SqlAggFunction aggregation() { return agg.call.getAggregation(); } - public RelDataType returnRelType() { + @Override public RelDataType returnRelType() { return agg.call.type; } - public Type returnType() { + @Override public Type returnType() { return EnumUtils.javaClass(typeFactory, returnRelType()); } - public List parameterTypes() { + @Override public List parameterTypes() { return EnumUtils.fieldTypes(typeFactory, parameterRelTypes()); } - public List parameterRelTypes() { + @Override public List parameterRelTypes() { return EnumUtils.fieldRowTypes(result.physType.getRowType(), constants, agg.call.getArgList()); } - public List groupSets() { + @Override public List groupSets() { throw new UnsupportedOperationException(); } - public List keyOrdinals() { + @Override public List keyOrdinals() { throw new UnsupportedOperationException(); } - public List keyRelTypes() { + @Override public List keyRelTypes() { throw new UnsupportedOperationException(); } - public List keyTypes() { + @Override public List keyTypes() { throw new UnsupportedOperationException(); } }; @@ -849,15 +849,15 @@ private void implementAdd(List aggs, for (final AggImpState agg : aggs) { final WinAggAddContext addContext = new WinAggAddContextImpl(builder7, agg.state, frame) { - public Expression currentPosition() { + @Override public Expression currentPosition() { return jDecl.parameter; } - public List rexArguments() { + @Override public List rexArguments() { return rexArguments.apply(agg); } - public RexNode rexFilterArgument() { + @Override public RexNode rexFilterArgument() { return null; // REVIEW } }; @@ -885,7 +885,7 @@ private boolean implementResult(List aggs, nonEmpty = true; Expression res = agg.implementor.implementResult(agg.context, new WinAggResultContextImpl(builder, agg.state, frame) { - public List rexArguments() { + @Override public List rexArguments() { return rexArguments.apply(agg); } }); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/JavaRowFormat.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/JavaRowFormat.java index eb3192340c1..cebe0a6228e 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/JavaRowFormat.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/JavaRowFormat.java @@ -37,7 +37,7 @@ */ public enum JavaRowFormat { CUSTOM { - Type javaRowClass( + @Override Type javaRowClass( JavaTypeFactory typeFactory, RelDataType type) { assert type.getFieldCount() > 1; @@ -49,7 +49,7 @@ Type javaRowClass( return typeFactory.getJavaClass(type.getFieldList().get(index).getType()); } - public Expression record( + @Override public Expression record( Type javaRowClass, List expressions) { switch (expressions.size()) { case 0: @@ -60,7 +60,7 @@ public Expression record( } } - public MemberExpression field(Expression expression, int field, + @Override public MemberExpression field(Expression expression, int field, Type fromType, Type fieldType) { final Type type = expression.getType(); if (type instanceof Types.RecordType) { @@ -76,7 +76,7 @@ public MemberExpression field(Expression expression, int field, }, SCALAR { - Type javaRowClass( + @Override Type javaRowClass( JavaTypeFactory typeFactory, RelDataType type) { assert type.getFieldCount() == 1; @@ -89,12 +89,12 @@ Type javaRowClass( return javaRowClass(typeFactory, type); } - public Expression record(Type javaRowClass, List expressions) { + @Override public Expression record(Type javaRowClass, List expressions) { assert expressions.size() == 1; return expressions.get(0); } - public Expression field(Expression expression, int field, Type fromType, + @Override public Expression field(Expression expression, int field, Type fromType, Type fieldType) { assert field == 0; return expression; @@ -105,7 +105,7 @@ public Expression field(Expression expression, int field, Type fromType, * (empty list is a good singleton) but sometimes also for records with 2 or * more fields that you need to be comparable, say as a key in a lookup. */ LIST { - Type javaRowClass( + @Override Type javaRowClass( JavaTypeFactory typeFactory, RelDataType type) { return FlatLists.ComparableList.class; @@ -116,7 +116,7 @@ Type javaRowClass( return Object.class; } - public Expression record( + @Override public Expression record( Type javaRowClass, List expressions) { switch (expressions.size()) { case 0: @@ -177,7 +177,7 @@ public Expression record( } } - public Expression field(Expression expression, int field, Type fromType, + @Override public Expression field(Expression expression, int field, Type fromType, Type fieldType) { final MethodCallExpression e = Expressions.call(expression, BuiltInMethod.LIST_GET.method, Expressions.constant(field)); @@ -206,7 +206,7 @@ public Expression field(Expression expression, int field, Type fromType, return Expressions.call(BuiltInMethod.ROW_AS_COPY.method, expressions); } - public Expression field(Expression expression, int field, Type fromType, + @Override public Expression field(Expression expression, int field, Type fromType, Type fieldType) { final Expression e = Expressions.call(expression, BuiltInMethod.ROW_VALUE.method, Expressions.constant(field)); @@ -218,7 +218,7 @@ public Expression field(Expression expression, int field, Type fromType, }, ARRAY { - Type javaRowClass( + @Override Type javaRowClass( JavaTypeFactory typeFactory, RelDataType type) { return Object[].class; @@ -229,7 +229,7 @@ Type javaRowClass( return Object.class; } - public Expression record(Type javaRowClass, List expressions) { + @Override public Expression record(Type javaRowClass, List expressions) { return Expressions.newArrayInit(Object.class, expressions); } @@ -237,7 +237,7 @@ public Expression record(Type javaRowClass, List expressions) { return Expressions.call(BuiltInMethod.ARRAY_COMPARER.method); } - public Expression field(Expression expression, int field, Type fromType, + @Override public Expression field(Expression expression, int field, Type fromType, Type fieldType) { final IndexExpression e = Expressions.arrayIndex(expression, Expressions.constant(field)); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/LazyAggregateLambdaFactory.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/LazyAggregateLambdaFactory.java index b83423bd6ae..7ecc880cee7 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/LazyAggregateLambdaFactory.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/LazyAggregateLambdaFactory.java @@ -48,11 +48,11 @@ public LazyAggregateLambdaFactory( this.accumulators = accumulators; } - public Function0> accumulatorInitializer() { + @Override public Function0> accumulatorInitializer() { return LazySource::new; } - public Function2, + @Override public Function2, TSource, LazySource> accumulatorAdder() { return (lazySource, source) -> { lazySource.add(source); @@ -60,7 +60,7 @@ TSource, LazySource> accumulatorAdder() { }; } - public Function1, TResult> singleGroupResultSelector( + @Override public Function1, TResult> singleGroupResultSelector( Function1 resultSelector) { return lazySource -> { final TOrigAccumulate accumulator = accumulatorInitializer.apply(); @@ -71,7 +71,7 @@ public Function1, TResult> singleGroupResultSelector( }; } - public Function2, TResult> resultSelector( + @Override public Function2, TResult> resultSelector( Function2 resultSelector) { return (groupByKey, lazySource) -> { final TOrigAccumulate accumulator = accumulatorInitializer.apply(); 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 abc186ea265..036943c5f81 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 @@ -43,7 +43,7 @@ public NestedBlockBuilderImpl(BlockBuilder block) { * @return new code block that can optimize expressions and reuse already * calculated values from the parent blocks. */ - public final BlockBuilder nestBlock() { + @Override public final BlockBuilder nestBlock() { BlockBuilder block = new BlockBuilder(true, currentBlock()); nestBlock(block); return block; @@ -55,14 +55,14 @@ public final BlockBuilder nestBlock() { * @param block new code block * @see #exitBlock() */ - public final void nestBlock(BlockBuilder block) { + @Override public final void nestBlock(BlockBuilder block) { blocks.add(block); } /** * Returns the current code block. */ - public final BlockBuilder currentBlock() { + @Override public final BlockBuilder currentBlock() { return blocks.get(blocks.size() - 1); } @@ -70,7 +70,7 @@ public final BlockBuilder currentBlock() { * Leaves the current code block. * @see #nestBlock() */ - public final void exitBlock() { + @Override public final void exitBlock() { blocks.remove(blocks.size() - 1); } } diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysTypeImpl.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysTypeImpl.java index d6f23b3562f..47f6c4649b3 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysTypeImpl.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysTypeImpl.java @@ -109,15 +109,15 @@ static PhysType of( JavaRowFormat.CUSTOM); } - public JavaRowFormat getFormat() { + @Override public JavaRowFormat getFormat() { return format; } - public PhysType project(List integers, JavaRowFormat format) { + @Override public PhysType project(List integers, JavaRowFormat format) { return project(integers, false, format); } - public PhysType project(List integers, boolean indicator, + @Override public PhysType project(List integers, boolean indicator, JavaRowFormat format) { final RelDataTypeFactory.Builder builder = typeFactory.builder(); for (int index : integers) { @@ -136,13 +136,13 @@ public PhysType project(List integers, boolean indicator, return of(typeFactory, projectedRowType, format.optimize(projectedRowType)); } - public Expression generateSelector( + @Override public Expression generateSelector( ParameterExpression parameter, List fields) { return generateSelector(parameter, fields, format); } - public Expression generateSelector( + @Override public Expression generateSelector( ParameterExpression parameter, List fields, JavaRowFormat targetFormat) { @@ -166,7 +166,7 @@ public Expression generateSelector( } } - public Expression generateSelector(final ParameterExpression parameter, + @Override public Expression generateSelector(final ParameterExpression parameter, final List fields, List usedFields, JavaRowFormat targetFormat) { final PhysType targetPhysType = @@ -191,7 +191,7 @@ public Expression generateSelector(final ParameterExpression parameter, targetPhysType.record(expressions), parameter); } - public Pair> selector( + @Override public Pair> selector( ParameterExpression parameter, List fields, JavaRowFormat targetFormat) { @@ -215,7 +215,7 @@ public Pair> selector( } } - public List accessors(Expression v1, List argList) { + @Override public List accessors(Expression v1, List argList) { final List expressions = new ArrayList<>(); for (int field : argList) { expressions.add( @@ -226,7 +226,7 @@ public List accessors(Expression v1, List argList) { return expressions; } - public PhysType makeNullable(boolean nullable) { + @Override public PhysType makeNullable(boolean nullable) { if (!nullable) { return this; } @@ -236,11 +236,11 @@ public PhysType makeNullable(boolean nullable) { } @SuppressWarnings("deprecation") - public Expression convertTo(Expression exp, PhysType targetPhysType) { + @Override public Expression convertTo(Expression exp, PhysType targetPhysType) { return convertTo(exp, targetPhysType.getFormat()); } - public Expression convertTo(Expression exp, JavaRowFormat targetFormat) { + @Override public Expression convertTo(Expression exp, JavaRowFormat targetFormat) { if (format == targetFormat) { return exp; } @@ -256,7 +256,7 @@ public Expression convertTo(Expression exp, JavaRowFormat targetFormat) { return Expressions.call(exp, BuiltInMethod.SELECT.method, selector); } - public Pair generateCollationKey( + @Override public Pair generateCollationKey( final List collations) { final Expression selector; if (collations.size() == 1) { @@ -388,7 +388,7 @@ public Pair generateCollationKey( memberDeclarations)); } - public Expression generateComparator(RelCollation collation) { + @Override public Expression generateComparator(RelCollation collation) { // int c; // c = Utilities.compare(v0, v1); // if (c != 0) return c; // or -c if descending @@ -490,29 +490,29 @@ public Expression generateComparator(RelCollation collation) { memberDeclarations); } - public RelDataType getRowType() { + @Override public RelDataType getRowType() { return rowType; } - public Expression record(List expressions) { + @Override public Expression record(List expressions) { return format.record(javaRowClass, expressions); } - public Type getJavaRowType() { + @Override public Type getJavaRowType() { return javaRowClass; } - public Type getJavaFieldType(int index) { + @Override public Type getJavaFieldType(int index) { return format.javaFieldClass(typeFactory, rowType, index); } - public PhysType component(int fieldOrdinal) { + @Override public PhysType component(int fieldOrdinal) { final RelDataTypeField field = rowType.getFieldList().get(fieldOrdinal); return PhysTypeImpl.of(typeFactory, toStruct(field.getType().getComponentType()), format, false); } - public PhysType field(int ordinal) { + @Override public PhysType field(int ordinal) { final RelDataTypeField field = rowType.getFieldList().get(ordinal); final RelDataType type = field.getType(); return PhysTypeImpl.of(typeFactory, toStruct(type), format, false); @@ -527,32 +527,32 @@ private RelDataType toStruct(RelDataType type) { .build(); } - public Expression comparer() { + @Override public Expression comparer() { return format.comparer(); } private List fieldReferences( final Expression parameter, final List fields) { return new AbstractList() { - public Expression get(int index) { + @Override public Expression get(int index) { return fieldReference(parameter, fields.get(index)); } - public int size() { + @Override public int size() { return fields.size(); } }; } - public Class fieldClass(int field) { + @Override public Class fieldClass(int field) { return fieldClasses.get(field); } - public boolean fieldNullable(int field) { + @Override public boolean fieldNullable(int field) { return rowType.getFieldList().get(field).getType().isNullable(); } - public Expression generateAccessor( + @Override public Expression generateAccessor( List fields) { ParameterExpression v1 = Expressions.parameter(javaRowClass, "v1"); @@ -653,12 +653,12 @@ public Expression generateAccessor( } } - public Expression fieldReference( + @Override public Expression fieldReference( Expression expression, int field) { return fieldReference(expression, field, null); } - public Expression fieldReference( + @Override public Expression fieldReference( Expression expression, int field, Type storageType) { Type fieldType; if (storageType == null) { diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/ReflectiveCallNotNullImplementor.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/ReflectiveCallNotNullImplementor.java index 1a97467e7dd..21fb69be9e7 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/ReflectiveCallNotNullImplementor.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/ReflectiveCallNotNullImplementor.java @@ -44,7 +44,7 @@ public ReflectiveCallNotNullImplementor(Method method) { this.method = method; } - public Expression implement(RexToLixTranslator translator, + @Override public Expression implement(RexToLixTranslator translator, RexCall call, List translatedOperands) { translatedOperands = EnumUtils.fromInternal(method.getParameterTypes(), translatedOperands); diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java index 176ed1abc34..6203bdb010e 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java @@ -1085,11 +1085,11 @@ static class MinMaxImplementor extends StrictAggImplementor { /** Implementor for the {@code SINGLE_VALUE} aggregate function. */ static class SingleValueImplementor implements AggImplementor { - public List getStateType(AggContext info) { + @Override public List getStateType(AggContext info) { return Arrays.asList(boolean.class, info.returnType()); } - public void implementReset(AggContext info, AggResetContext reset) { + @Override public void implementReset(AggContext info, AggResetContext reset) { List acc = reset.accumulator(); reset.currentBlock().add( Expressions.statement( @@ -1100,7 +1100,7 @@ public void implementReset(AggContext info, AggResetContext reset) { getDefaultValue(acc.get(1).getType())))); } - public void implementAdd(AggContext info, AggAddContext add) { + @Override public void implementAdd(AggContext info, AggAddContext add) { List acc = add.accumulator(); Expression flag = acc.get(0); add.currentBlock().add( @@ -1117,7 +1117,7 @@ public void implementAdd(AggContext info, AggAddContext add) { Expressions.assign(acc.get(1), add.arguments().get(0)))); } - public Expression implementResult(AggContext info, + @Override public Expression implementResult(AggContext info, AggResultContext result) { return EnumUtils.convert(result.accumulator().get(1), info.returnType()); @@ -1278,17 +1278,17 @@ static class BitOpImplementor extends StrictAggImplementor { /** Implementor for the {@code GROUPING} aggregate function. */ static class GroupingImplementor implements AggImplementor { - public List getStateType(AggContext info) { + @Override public List getStateType(AggContext info) { return ImmutableList.of(); } - public void implementReset(AggContext info, AggResetContext reset) { + @Override public void implementReset(AggContext info, AggResetContext reset) { } - public void implementAdd(AggContext info, AggAddContext add) { + @Override public void implementAdd(AggContext info, AggAddContext add) { } - public Expression implementResult(AggContext info, + @Override public Expression implementResult(AggContext info, AggResultContext result) { final List keys; switch (info.aggregation().kind) { @@ -1452,23 +1452,23 @@ protected FirstLastValueImplementor(SeekType seekType) { this.seekType = seekType; } - public List getStateType(AggContext info) { + @Override public List getStateType(AggContext info) { return Collections.emptyList(); } - public void implementReset(AggContext info, AggResetContext reset) { + @Override public void implementReset(AggContext info, AggResetContext reset) { // no op } - public void implementAdd(AggContext info, AggAddContext add) { + @Override public void implementAdd(AggContext info, AggAddContext add) { // no op } - public boolean needCacheWhenFrameIntact() { + @Override public boolean needCacheWhenFrameIntact() { return true; } - public Expression implementResult(AggContext info, + @Override public Expression implementResult(AggContext info, AggResultContext result) { WinAggResultContext winResult = (WinAggResultContext) result; @@ -1497,23 +1497,23 @@ protected LastValueImplementor() { /** Implementor for the {@code NTH_VALUE} * windowed aggregate function. */ static class NthValueImplementor implements WinAggImplementor { - public List getStateType(AggContext info) { + @Override public List getStateType(AggContext info) { return Collections.emptyList(); } - public void implementReset(AggContext info, AggResetContext reset) { + @Override public void implementReset(AggContext info, AggResetContext reset) { // no op } - public void implementAdd(AggContext info, AggAddContext add) { + @Override public void implementAdd(AggContext info, AggAddContext add) { // no op } - public boolean needCacheWhenFrameIntact() { + @Override public boolean needCacheWhenFrameIntact() { return true; } - public Expression implementResult(AggContext info, + @Override public Expression implementResult(AggContext info, AggResultContext result) { WinAggResultContext winResult = (WinAggResultContext) result; @@ -1559,23 +1559,23 @@ protected LeadLagImplementor(boolean isLead) { this.isLead = isLead; } - public List getStateType(AggContext info) { + @Override public List getStateType(AggContext info) { return Collections.emptyList(); } - public void implementReset(AggContext info, AggResetContext reset) { + @Override public void implementReset(AggContext info, AggResetContext reset) { // no op } - public void implementAdd(AggContext info, AggAddContext add) { + @Override public void implementAdd(AggContext info, AggAddContext add) { // no op } - public boolean needCacheWhenFrameIntact() { + @Override public boolean needCacheWhenFrameIntact() { return false; } - public Expression implementResult(AggContext info, + @Override public Expression implementResult(AggContext info, AggResultContext result) { WinAggResultContext winResult = (WinAggResultContext) result; @@ -1637,23 +1637,23 @@ protected LagImplementor() { /** Implementor for the {@code NTILE} windowed aggregate function. */ static class NtileImplementor implements WinAggImplementor { - public List getStateType(AggContext info) { + @Override public List getStateType(AggContext info) { return Collections.emptyList(); } - public void implementReset(AggContext info, AggResetContext reset) { + @Override public void implementReset(AggContext info, AggResetContext reset) { // no op } - public void implementAdd(AggContext info, AggAddContext add) { + @Override public void implementAdd(AggContext info, AggAddContext add) { // no op } - public boolean needCacheWhenFrameIntact() { + @Override public boolean needCacheWhenFrameIntact() { return false; } - public Expression implementResult(AggContext info, + @Override public Expression implementResult(AggContext info, AggResultContext result) { WinAggResultContext winResult = (WinAggResultContext) result; 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 d7ecad3baa9..0a908f457a0 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 @@ -1389,7 +1389,7 @@ public InputGetterImpl(List> inputs) { this.inputs = inputs; } - public Expression field(BlockBuilder list, int index, Type storageType) { + @Override public Expression field(BlockBuilder list, int index, Type storageType) { int offset = 0; for (Pair input : inputs) { final PhysType physType = input.right; 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 f5db70854b5..3b77c3c50f8 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 @@ -55,7 +55,7 @@ protected final void accAdvance(AggAddContext add, Expression acc, Expressions.assign(acc, EnumUtils.convert(next, acc.type)))); } - public final List getStateType(AggContext info) { + @Override public final List getStateType(AggContext info) { List subState = getNotNullState(info); stateSize = subState.size(); needTrackEmptySet = nonDefaultOnEmptySet(info); @@ -87,7 +87,7 @@ public List getNotNullState(AggContext info) { return Collections.singletonList(type); } - public final void implementReset(AggContext info, AggResetContext reset) { + @Override public final void implementReset(AggContext info, AggResetContext reset) { if (trackNullsPerRow) { List acc = reset.accumulator(); Expression flag = acc.get(acc.size() - 1); @@ -113,7 +113,7 @@ protected void implementNotNullReset(AggContext info, } } - public final void implementAdd(AggContext info, final AggAddContext add) { + @Override public final void implementAdd(AggContext info, final AggAddContext add) { final List args = add.rexArguments(); final RexToLixTranslator translator = add.rowTranslator(); final List conditions = new ArrayList<>(); @@ -155,7 +155,7 @@ public final void implementAdd(AggContext info, final AggAddContext add) { protected abstract void implementNotNullAdd(AggContext info, AggAddContext add); - public final Expression implementResult(AggContext info, + @Override public final Expression implementResult(AggContext info, final AggResultContext result) { if (!needTrackEmptySet) { return EnumUtils.convert( 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 ecc1c2a6a18..cd27b9da2db 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 @@ -74,7 +74,7 @@ protected Expression implementNotNullResult(WinAggContext info, (WinAggResultContext) result); } - public boolean needCacheWhenFrameIntact() { + @Override public boolean needCacheWhenFrameIntact() { return true; } } diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/AggAddContextImpl.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/AggAddContextImpl.java index 8e53369fd4a..fb70c133706 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/AggAddContextImpl.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/AggAddContextImpl.java @@ -32,7 +32,7 @@ public AggAddContextImpl(BlockBuilder block, List accumulator) { super(block, null, accumulator, null, null); } - public final List arguments() { + @Override public final List arguments() { return rowTranslator().translateList(rexArguments()); } } diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/AggResetContextImpl.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/AggResetContextImpl.java index 51e6f6124cb..28d56c8fda4 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/AggResetContextImpl.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/AggResetContextImpl.java @@ -44,7 +44,7 @@ public AggResetContextImpl(BlockBuilder block, List accumulator) { this.accumulator = accumulator; } - public List accumulator() { + @Override public List accumulator() { return accumulator; } diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/AggResultContextImpl.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/AggResultContextImpl.java index ecf03b75fdc..c146706f6fa 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/AggResultContextImpl.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/AggResultContextImpl.java @@ -53,11 +53,11 @@ public AggResultContextImpl(BlockBuilder block, AggregateCall call, this.keyPhysType = keyPhysType; } - public Expression key() { + @Override public Expression key() { return key; } - public Expression keyField(int i) { + @Override public Expression keyField(int i) { return keyPhysType.fieldReference(key, i); } diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggAddContextImpl.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggAddContextImpl.java index aa8d7e3612a..05a624aa329 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggAddContextImpl.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggAddContextImpl.java @@ -45,13 +45,13 @@ public WinAggAddContextImpl(BlockBuilder block, List accumulator, this(block, accumulator, (Function) frame::apply); } - public final RexToLixTranslator rowTranslator() { + @Override public final RexToLixTranslator rowTranslator() { return rowTranslator( computeIndex(Expressions.constant(0), WinAggImplementor.SeekType.AGG_INDEX)); } - public final List arguments() { + @Override public final List arguments() { return rowTranslator().translateList(rexArguments()); } } 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 7478f4e8df5..f1e83cda163 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 @@ -61,27 +61,27 @@ public WinAggResetContextImpl(BlockBuilder block, this.hasRows = hasRows; } - public Expression index() { + @Override public Expression index() { return index; } - public Expression startIndex() { + @Override public Expression startIndex() { return startIndex; } - public Expression endIndex() { + @Override public Expression endIndex() { return endIndex; } - public Expression hasRows() { + @Override public Expression hasRows() { return hasRows; } - public Expression getFrameRowCount() { + @Override public Expression getFrameRowCount() { return frameRowCount; } - public Expression getPartitionRowCount() { + @Override public Expression getPartitionRowCount() { return partitionRowCount; } } diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggResultContextImpl.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggResultContextImpl.java index 1f0b2180bf0..6e466416353 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggResultContextImpl.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/impl/WinAggResultContextImpl.java @@ -62,52 +62,52 @@ private WinAggFrameResultContext getFrame() { return frame.apply(currentBlock()); } - public final List arguments(Expression rowIndex) { + @Override public final List arguments(Expression rowIndex) { return rowTranslator(rowIndex).translateList(rexArguments()); } - public Expression computeIndex(Expression offset, + @Override public Expression computeIndex(Expression offset, WinAggImplementor.SeekType seekType) { return getFrame().computeIndex(offset, seekType); } - public Expression rowInFrame(Expression rowIndex) { + @Override public Expression rowInFrame(Expression rowIndex) { return getFrame().rowInFrame(rowIndex); } - public Expression rowInPartition(Expression rowIndex) { + @Override public Expression rowInPartition(Expression rowIndex) { return getFrame().rowInPartition(rowIndex); } - public RexToLixTranslator rowTranslator(Expression rowIndex) { + @Override public RexToLixTranslator rowTranslator(Expression rowIndex) { return getFrame().rowTranslator(rowIndex); } - public Expression compareRows(Expression a, Expression b) { + @Override public Expression compareRows(Expression a, Expression b) { return getFrame().compareRows(a, b); } - public Expression index() { + @Override public Expression index() { return getFrame().index(); } - public Expression startIndex() { + @Override public Expression startIndex() { return getFrame().startIndex(); } - public Expression endIndex() { + @Override public Expression endIndex() { return getFrame().endIndex(); } - public Expression hasRows() { + @Override public Expression hasRows() { return getFrame().hasRows(); } - public Expression getFrameRowCount() { + @Override public Expression getFrameRowCount() { return getFrame().getFrameRowCount(); } - public Expression getPartitionRowCount() { + @Override public Expression getPartitionRowCount() { return getFrame().getPartitionRowCount(); } } diff --git a/core/src/main/java/org/apache/calcite/adapter/java/AbstractQueryableTable.java b/core/src/main/java/org/apache/calcite/adapter/java/AbstractQueryableTable.java index deaf4027d51..4edcc184925 100644 --- a/core/src/main/java/org/apache/calcite/adapter/java/AbstractQueryableTable.java +++ b/core/src/main/java/org/apache/calcite/adapter/java/AbstractQueryableTable.java @@ -36,11 +36,11 @@ protected AbstractQueryableTable(Type elementType) { this.elementType = elementType; } - public Type getElementType() { + @Override public Type getElementType() { return elementType; } - public Expression getExpression(SchemaPlus schema, String tableName, + @Override public Expression getExpression(SchemaPlus schema, String tableName, Class clazz) { return Schemas.tableExpression(schema, elementType, tableName, clazz); } diff --git a/core/src/main/java/org/apache/calcite/adapter/java/ReflectiveSchema.java b/core/src/main/java/org/apache/calcite/adapter/java/ReflectiveSchema.java index c8e6cbfc819..7aa306a41d5 100644 --- a/core/src/main/java/org/apache/calcite/adapter/java/ReflectiveSchema.java +++ b/core/src/main/java/org/apache/calcite/adapter/java/ReflectiveSchema.java @@ -241,15 +241,15 @@ private static class ReflectiveTable this.enumerable = enumerable; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return ((JavaTypeFactory) typeFactory).createType(elementType); } - public Statistic getStatistic() { + @Override public Statistic getStatistic() { return Statistics.UNKNOWN; } - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { if (elementType == Object[].class) { //noinspection unchecked return enumerable; @@ -259,12 +259,12 @@ public Enumerable scan(DataContext root) { } } - public Queryable asQueryable(QueryProvider queryProvider, + @Override public Queryable asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { return new AbstractTableQueryable(queryProvider, schema, this, tableName) { @SuppressWarnings("unchecked") - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return (Enumerator) enumerable.enumerator(); } }; @@ -301,7 +301,7 @@ public Enumerator enumerator() { * } */ public static class Factory implements SchemaFactory { - public Schema create(SchemaPlus parentSchema, String name, + @Override public Schema create(SchemaPlus parentSchema, String name, Map operand) { Class clazz; Object target; @@ -350,11 +350,11 @@ private static class MethodTableMacro extends ReflectiveFunctionBase + "expanded"; } - public String toString() { + @Override public String toString() { return "Member {method=" + method + "}"; } - public TranslatableTable apply(final List arguments) { + @Override public TranslatableTable apply(final List arguments) { try { final Object o = method.invoke(schema.getTarget(), arguments.toArray()); return (TranslatableTable) o; @@ -382,7 +382,7 @@ private static class FieldTable extends ReflectiveTable { this.statistic = statistic; } - public String toString() { + @Override public String toString() { return "Relation {field=" + field.getName() + "}"; } @@ -406,7 +406,7 @@ private static class FieldSelector implements Function1 { this.fields = elementType.getFields(); } - public Object[] apply(Object o) { + @Override public Object[] apply(Object o) { try { final Object[] objects = new Object[fields.length]; for (int i = 0; i < fields.length; i++) { diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcQueryProvider.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcQueryProvider.java index b516d8d3983..f58e25015e3 100644 --- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcQueryProvider.java +++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcQueryProvider.java @@ -30,7 +30,7 @@ public final class JdbcQueryProvider extends QueryProviderImpl { private JdbcQueryProvider() { } - public Enumerator executeQuery(Queryable queryable) { + @Override public Enumerator executeQuery(Queryable queryable) { return null; } } diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcRules.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcRules.java index 5a46990bc87..23fcd43272a 100644 --- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcRules.java +++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcRules.java @@ -409,7 +409,7 @@ protected JdbcJoin( return Math.max(leftRowCount, rightRowCount); } - public JdbcImplementor.Result implement(JdbcImplementor implementor) { + @Override public JdbcImplementor.Result implement(JdbcImplementor implementor) { return implementor.implement(this); } } @@ -432,7 +432,7 @@ protected JdbcCalcRule(Config config) { super(config); } - public RelNode convert(RelNode rel) { + @Override public RelNode convert(RelNode rel) { final Calc calc = (Calc) rel; // If there's a multiset, let FarragoMultisetSplitter work on it @@ -470,7 +470,7 @@ public JdbcCalc(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, Util.discard(flags); } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { return program.explainCalc(super.explainTerms(pw)); } @@ -478,7 +478,7 @@ public RelWriter explainTerms(RelWriter pw) { return RelMdUtil.estimateFilteredRows(getInput(), program, mq); } - public RelOptCost computeSelfCost(RelOptPlanner planner, + @Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { double dRows = mq.getRowCount(this); double dCpu = mq.getRowCount(getInput()) @@ -487,11 +487,11 @@ public RelOptCost computeSelfCost(RelOptPlanner planner, return planner.getCostFactory().makeCost(dRows, dCpu, dIo); } - public RelNode copy(RelTraitSet traitSet, List inputs) { + @Override public RelNode copy(RelTraitSet traitSet, List inputs) { return new JdbcCalc(getCluster(), traitSet, sole(inputs), program); } - public JdbcImplementor.Result implement(JdbcImplementor implementor) { + @Override public JdbcImplementor.Result implement(JdbcImplementor implementor) { return implementor.implement(this); } } @@ -576,7 +576,7 @@ public JdbcProject(RelOptCluster cluster, RelTraitSet traitSet, .multiplyBy(JdbcConvention.COST_MULTIPLIER); } - public JdbcImplementor.Result implement(JdbcImplementor implementor) { + @Override public JdbcImplementor.Result implement(JdbcImplementor implementor) { return implementor.implement(this); } } @@ -630,12 +630,12 @@ public JdbcFilter( assert getConvention() instanceof JdbcConvention; } - public JdbcFilter copy(RelTraitSet traitSet, RelNode input, + @Override public JdbcFilter copy(RelTraitSet traitSet, RelNode input, RexNode condition) { return new JdbcFilter(getCluster(), traitSet, input, condition); } - public JdbcImplementor.Result implement(JdbcImplementor implementor) { + @Override public JdbcImplementor.Result implement(JdbcImplementor implementor) { return implementor.implement(this); } } @@ -729,7 +729,7 @@ public JdbcAggregate(RelOptCluster cluster, RelTraitSet traitSet, } } - public JdbcImplementor.Result implement(JdbcImplementor implementor) { + @Override public JdbcImplementor.Result implement(JdbcImplementor implementor) { return implementor.implement(this); } } @@ -807,7 +807,7 @@ public JdbcSort( return super.computeSelfCost(planner, mq).multiplyBy(0.9); } - public JdbcImplementor.Result implement(JdbcImplementor implementor) { + @Override public JdbcImplementor.Result implement(JdbcImplementor implementor) { return implementor.implement(this); } } @@ -849,7 +849,7 @@ public JdbcUnion( super(cluster, traitSet, inputs, all); } - public JdbcUnion copy( + @Override public JdbcUnion copy( RelTraitSet traitSet, List inputs, boolean all) { return new JdbcUnion(getCluster(), traitSet, inputs, all); } @@ -859,7 +859,7 @@ public JdbcUnion copy( return super.computeSelfCost(planner, mq).multiplyBy(.1); } - public JdbcImplementor.Result implement(JdbcImplementor implementor) { + @Override public JdbcImplementor.Result implement(JdbcImplementor implementor) { return implementor.implement(this); } } @@ -908,12 +908,12 @@ public JdbcIntersect( assert !all; } - public JdbcIntersect copy( + @Override public JdbcIntersect copy( RelTraitSet traitSet, List inputs, boolean all) { return new JdbcIntersect(getCluster(), traitSet, inputs, all); } - public JdbcImplementor.Result implement(JdbcImplementor implementor) { + @Override public JdbcImplementor.Result implement(JdbcImplementor implementor) { return implementor.implement(this); } } @@ -956,12 +956,12 @@ public JdbcMinus(RelOptCluster cluster, RelTraitSet traitSet, assert !all; } - public JdbcMinus copy(RelTraitSet traitSet, List inputs, + @Override public JdbcMinus copy(RelTraitSet traitSet, List inputs, boolean all) { return new JdbcMinus(getCluster(), traitSet, inputs, all); } - public JdbcImplementor.Result implement(JdbcImplementor implementor) { + @Override public JdbcImplementor.Result implement(JdbcImplementor implementor) { return implementor.implement(this); } } @@ -1044,7 +1044,7 @@ public JdbcTableModify(RelOptCluster cluster, getSourceExpressionList(), isFlattened()); } - public JdbcImplementor.Result implement(JdbcImplementor implementor) { + @Override public JdbcImplementor.Result implement(JdbcImplementor implementor) { return implementor.implement(this); } } @@ -1083,7 +1083,7 @@ public static class JdbcValues extends Values implements JdbcRel { return new JdbcValues(getCluster(), rowType, tuples, traitSet); } - public JdbcImplementor.Result implement(JdbcImplementor implementor) { + @Override public JdbcImplementor.Result implement(JdbcImplementor implementor) { return implementor.implement(this); } } 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 90ce7226598..03dbc770b19 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 @@ -208,11 +208,11 @@ public static DataSource dataSource(String url, String driverClassName, password); } - public boolean isMutable() { + @Override public boolean isMutable() { return false; } - public Schema snapshot(SchemaVersion version) { + @Override public Schema snapshot(SchemaVersion version) { return new JdbcSchema(dataSource, dialect, convention, catalog, schema, tableMap); } @@ -222,7 +222,7 @@ public DataSource getDataSource() { return dataSource; } - public Expression getExpression(SchemaPlus parentSchema, String name) { + @Override public Expression getExpression(SchemaPlus parentSchema, String name) { return Schemas.subSchemaExpression(parentSchema, name, JdbcSchema.class); } @@ -231,11 +231,11 @@ protected Multimap getFunctions() { return ImmutableMultimap.of(); } - public final Collection getFunctions(String name) { + @Override public final Collection getFunctions(String name) { return getFunctions().get(name); // never null } - public final Set getFunctionNames() { + @Override public final Set getFunctionNames() { return getFunctions().keySet(); } @@ -341,7 +341,7 @@ private Pair getCatalogSchema(Connection connection) return Pair.of(catalog, schema); } - public Table getTable(String name) { + @Override public Table getTable(String name) { return getTableMap(false).get(name); } @@ -470,7 +470,7 @@ private RelDataType parseTypeString(RelDataTypeFactory typeFactory, } } - public Set getTableNames() { + @Override public Set getTableNames() { // This method is called during a cache refresh. We can take it as a signal // that we need to re-build our own cache. return getTableMap(!snapshot).keySet(); @@ -489,12 +489,12 @@ protected Map getTypes() { return getTypes().keySet(); } - public Schema getSubSchema(String name) { + @Override public Schema getSubSchema(String name) { // JDBC does not support sub-schemas. return null; } - public Set getSubSchemaNames() { + @Override public Set getSubSchemaNames() { return ImmutableSet.of(); } @@ -553,7 +553,7 @@ public static class Factory implements SchemaFactory { private Factory() {} - public Schema create( + @Override public Schema create( SchemaPlus parentSchema, String name, Map operand) { 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 7e85d5b943b..71d58c52962 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 @@ -90,7 +90,7 @@ public class JdbcTable extends AbstractQueryableTable this.jdbcTableType = Objects.requireNonNull(jdbcTableType); } - public String toString() { + @Override public String toString() { return "JdbcTable {" + jdbcTableName + "}"; } @@ -108,7 +108,7 @@ public String toString() { } } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { if (protoRowType == null) { try { protoRowType = @@ -165,18 +165,18 @@ public SqlIdentifier tableName() { return new SqlIdentifier(names, SqlParserPos.ZERO); } - public RelNode toRel(RelOptTable.ToRelContext context, + @Override public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable) { return new JdbcTableScan(context.getCluster(), relOptTable, this, jdbcSchema.convention); } - public Queryable asQueryable(QueryProvider queryProvider, + @Override public Queryable asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { return new JdbcTableQueryable<>(queryProvider, schema, tableName); } - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { final JavaTypeFactory typeFactory = root.getTypeFactory(); final SqlString sql = generateSql(); return ResultSetEnumerable.of(jdbcSchema.getDataSource(), sql.getSql(), @@ -212,7 +212,7 @@ private class JdbcTableQueryable extends AbstractTableQueryable { return "JdbcTableQueryable {table: " + tableName + "}"; } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final JavaTypeFactory typeFactory = ((CalciteConnection) queryProvider).getTypeFactory(); final SqlString sql = generateSql(); diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcTableScan.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcTableScan.java index a138089b5f7..25d8a145bca 100644 --- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcTableScan.java +++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcTableScan.java @@ -48,7 +48,7 @@ protected JdbcTableScan( getCluster(), table, jdbcTable, (JdbcConvention) getConvention()); } - public JdbcImplementor.Result implement(JdbcImplementor implementor) { + @Override public JdbcImplementor.Result implement(JdbcImplementor implementor) { return implementor.result(jdbcTable.tableName(), ImmutableList.of(JdbcImplementor.Clause.FROM), this, null); } diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcToEnumerableConverter.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcToEnumerableConverter.java index e9eb6a6dc14..d2750a2b243 100644 --- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcToEnumerableConverter.java +++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcToEnumerableConverter.java @@ -82,7 +82,7 @@ protected JdbcToEnumerableConverter( return super.computeSelfCost(planner, mq).multiplyBy(.1); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { // Generate: // ResultSetEnumerable.of(schema.getDataSource(), "select ...") final BlockBuilder builder0 = new BlockBuilder(false); diff --git a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcUtils.java b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcUtils.java index b104b73179f..15630cd90ee 100644 --- a/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcUtils.java +++ b/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcUtils.java @@ -125,7 +125,7 @@ public static Function1> factory( }; } - public Object[] apply() { + @Override public Object[] apply() { try { final Object[] values = new Object[columnCount]; for (int i = 0; i < columnCount; i++) { diff --git a/core/src/main/java/org/apache/calcite/config/CalciteConnectionConfigImpl.java b/core/src/main/java/org/apache/calcite/config/CalciteConnectionConfigImpl.java index 93f6ea319fa..d7dc2f84d76 100644 --- a/core/src/main/java/org/apache/calcite/config/CalciteConnectionConfigImpl.java +++ b/core/src/main/java/org/apache/calcite/config/CalciteConnectionConfigImpl.java @@ -65,17 +65,17 @@ public boolean isSet(CalciteConnectionProperty property) { return properties.containsKey(property.camelName()); } - public boolean approximateDistinctCount() { + @Override public boolean approximateDistinctCount() { return CalciteConnectionProperty.APPROXIMATE_DISTINCT_COUNT.wrap(properties) .getBoolean(); } - public boolean approximateTopN() { + @Override public boolean approximateTopN() { return CalciteConnectionProperty.APPROXIMATE_TOP_N.wrap(properties) .getBoolean(); } - public boolean approximateDecimal() { + @Override public boolean approximateDecimal() { return CalciteConnectionProperty.APPROXIMATE_DECIMAL.wrap(properties) .getBoolean(); } @@ -84,26 +84,26 @@ public boolean approximateDecimal() { return CalciteConnectionProperty.NULL_EQUAL_TO_EMPTY.wrap(properties).getBoolean(); } - public boolean autoTemp() { + @Override public boolean autoTemp() { return CalciteConnectionProperty.AUTO_TEMP.wrap(properties).getBoolean(); } - public boolean materializationsEnabled() { + @Override public boolean materializationsEnabled() { return CalciteConnectionProperty.MATERIALIZATIONS_ENABLED.wrap(properties) .getBoolean(); } - public boolean createMaterializations() { + @Override public boolean createMaterializations() { return CalciteConnectionProperty.CREATE_MATERIALIZATIONS.wrap(properties) .getBoolean(); } - public NullCollation defaultNullCollation() { + @Override public NullCollation defaultNullCollation() { return CalciteConnectionProperty.DEFAULT_NULL_COLLATION.wrap(properties) .getEnum(NullCollation.class, NullCollation.HIGH); } - public T fun(Class operatorTableClass, T defaultOperatorTable) { + @Override public T fun(Class operatorTableClass, T defaultOperatorTable) { final String fun = CalciteConnectionProperty.FUN.wrap(properties).getString(); if (fun == null || fun.equals("") || fun.equals("standard")) { @@ -116,66 +116,66 @@ public T fun(Class operatorTableClass, T defaultOperatorTable) { return operatorTableClass.cast(operatorTable); } - public String model() { + @Override public String model() { return CalciteConnectionProperty.MODEL.wrap(properties).getString(); } - public Lex lex() { + @Override public Lex lex() { return CalciteConnectionProperty.LEX.wrap(properties).getEnum(Lex.class); } - public Quoting quoting() { + @Override public Quoting quoting() { return CalciteConnectionProperty.QUOTING.wrap(properties) .getEnum(Quoting.class, lex().quoting); } - public Casing unquotedCasing() { + @Override public Casing unquotedCasing() { return CalciteConnectionProperty.UNQUOTED_CASING.wrap(properties) .getEnum(Casing.class, lex().unquotedCasing); } - public Casing quotedCasing() { + @Override public Casing quotedCasing() { return CalciteConnectionProperty.QUOTED_CASING.wrap(properties) .getEnum(Casing.class, lex().quotedCasing); } - public boolean caseSensitive() { + @Override public boolean caseSensitive() { return CalciteConnectionProperty.CASE_SENSITIVE.wrap(properties) .getBoolean(lex().caseSensitive); } - public T parserFactory(Class parserFactoryClass, + @Override public T parserFactory(Class parserFactoryClass, T defaultParserFactory) { return CalciteConnectionProperty.PARSER_FACTORY.wrap(properties) .getPlugin(parserFactoryClass, defaultParserFactory); } - public T schemaFactory(Class schemaFactoryClass, + @Override public T schemaFactory(Class schemaFactoryClass, T defaultSchemaFactory) { return CalciteConnectionProperty.SCHEMA_FACTORY.wrap(properties) .getPlugin(schemaFactoryClass, defaultSchemaFactory); } - public JsonSchema.Type schemaType() { + @Override public JsonSchema.Type schemaType() { return CalciteConnectionProperty.SCHEMA_TYPE.wrap(properties) .getEnum(JsonSchema.Type.class); } - public boolean spark() { + @Override public boolean spark() { return CalciteConnectionProperty.SPARK.wrap(properties).getBoolean(); } - public boolean forceDecorrelate() { + @Override public boolean forceDecorrelate() { return CalciteConnectionProperty.FORCE_DECORRELATE.wrap(properties) .getBoolean(); } - public T typeSystem(Class typeSystemClass, T defaultTypeSystem) { + @Override public T typeSystem(Class typeSystemClass, T defaultTypeSystem) { return CalciteConnectionProperty.TYPE_SYSTEM.wrap(properties) .getPlugin(typeSystemClass, defaultTypeSystem); } - public SqlConformance conformance() { + @Override public SqlConformance conformance() { return CalciteConnectionProperty.CONFORMANCE.wrap(properties) .getEnum(SqlConformanceEnum.class); } @@ -185,22 +185,22 @@ public SqlConformance conformance() { .getString(); } - public String locale() { + @Override public String locale() { return CalciteConnectionProperty.LOCALE.wrap(properties) .getString(); } - public boolean typeCoercion() { + @Override public boolean typeCoercion() { return CalciteConnectionProperty.TYPE_COERCION.wrap(properties) .getBoolean(); } - public boolean lenientOperatorLookup() { + @Override public boolean lenientOperatorLookup() { return CalciteConnectionProperty.LENIENT_OPERATOR_LOOKUP.wrap(properties) .getBoolean(); } - public boolean topDownOpt() { + @Override public boolean topDownOpt() { return CalciteConnectionProperty.TOPDOWN_OPT.wrap(properties).getBoolean(); } } 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 adb9833c7f0..6f2cc17ea32 100644 --- a/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java +++ b/core/src/main/java/org/apache/calcite/config/CalciteConnectionProperty.java @@ -200,27 +200,27 @@ public enum CalciteConnectionProperty implements ConnectionProperty { } } - public String camelName() { + @Override public String camelName() { return camelName; } - public Object defaultValue() { + @Override public Object defaultValue() { return defaultValue; } - public Type type() { + @Override public Type type() { return type; } - public Class valueClass() { + @Override public Class valueClass() { return valueClass; } - public boolean required() { + @Override public boolean required() { return required; } - public PropEnv wrap(Properties properties) { + @Override public PropEnv wrap(Properties properties) { return new PropEnv(parse(properties, NAME_TO_PROPS), this); } } 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 9936c151a28..1f1e042374e 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java +++ b/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java @@ -90,7 +90,7 @@ public AggregateNode(Compiler compiler, Aggregate rel) { accumulatorFactories = builder.build(); } - public void run() throws InterruptedException { + @Override public void run() throws InterruptedException { Row r; while ((r = source.receive()) != null) { for (Grouping group : groups) { @@ -219,7 +219,7 @@ private AccumulatorFactory getAccumulator(final AggregateCall call, AggAddContext addContext = new AggAddContextImpl(builder2, accumulator) { - public List rexArguments() { + @Override public List rexArguments() { List args = new ArrayList<>(); for (int index : agg.call.getArgList()) { args.add(RexInputRef.of(index, inputPhysType.getRowType())); @@ -227,14 +227,14 @@ public List rexArguments() { return args; } - public RexNode rexFilterArgument() { + @Override public RexNode rexFilterArgument() { return agg.call.filterArg < 0 ? null : RexInputRef.of(agg.call.filterArg, inputPhysType.getRowType()); } - public RexToLixTranslator rowTranslator() { + @Override public RexToLixTranslator rowTranslator() { final SqlConformance conformance = SqlConformanceEnum.DEFAULT; // TODO: get this from implementor return RexToLixTranslator.forAggregation(typeFactory, @@ -269,7 +269,7 @@ private static class CountAccumulator implements Accumulator { cnt = 0; } - public void send(Row row) { + @Override public void send(Row row) { boolean notNull = true; for (Integer i : call.getArgList()) { if (row.getObject(i) == null) { @@ -282,7 +282,7 @@ public void send(Row row) { } } - public Object end() { + @Override public Object end() { return cnt; } } @@ -315,7 +315,7 @@ private ScalarAccumulatorDef(Scalar initScalar, Scalar addScalar, this.endContext.values = new Object[accumulatorLength]; } - public Accumulator get() { + @Override public Accumulator get() { return new ScalarAccumulator(this, new Object[accumulatorLength]); } } @@ -330,7 +330,7 @@ private ScalarAccumulator(ScalarAccumulatorDef def, Object[] values) { this.values = values; } - public void send(Row row) { + @Override public void send(Row row) { System.arraycopy(row.getValues(), 0, def.sendContext.values, 0, def.rowLength); System.arraycopy(values, 0, def.sendContext.values, def.rowLength, @@ -338,7 +338,7 @@ public void send(Row row) { def.addScalar.execute(def.sendContext, values); } - public Object end() { + @Override public Object end() { System.arraycopy(values, 0, def.endContext.values, 0, values.length); return def.endScalar.execute(def.endContext); } @@ -686,7 +686,7 @@ private static class UdaAccumulatorFactory implements AccumulatorFactory { this.nullIfEmpty = nullIfEmpty; } - public Accumulator get() { + @Override public Accumulator get() { return new UdaAccumulator(this); } } @@ -707,7 +707,7 @@ private static class UdaAccumulator implements Accumulator { this.empty = true; } - public void send(Row row) { + @Override public void send(Row row) { final Object[] args = {value, row.getValues()[factory.argOrdinal]}; for (int i = 1; i < args.length; i++) { if (args[i] == null) { @@ -722,7 +722,7 @@ public void send(Row row) { empty = false; } - public Object end() { + @Override public Object end() { if (factory.nullIfEmpty && empty) { return null; } @@ -746,13 +746,13 @@ private static class FilterAccumulator implements Accumulator { this.filterArg = filterArg; } - public void send(Row row) { + @Override public void send(Row row) { if (row.getValues()[filterArg] == Boolean.TRUE) { accumulator.send(row); } } - public Object end() { + @Override public Object end() { return accumulator.end(); } } diff --git a/core/src/main/java/org/apache/calcite/interpreter/BindableConvention.java b/core/src/main/java/org/apache/calcite/interpreter/BindableConvention.java index 31a4cba1963..1c66e4de36a 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/BindableConvention.java +++ b/core/src/main/java/org/apache/calcite/interpreter/BindableConvention.java @@ -44,11 +44,11 @@ public enum BindableConvention implements Convention { return getName(); } - public Class getInterface() { + @Override public Class getInterface() { return BindableRel.class; } - public String getName() { + @Override public String getName() { return "BINDABLE"; } @@ -56,21 +56,21 @@ public String getName() { return null; } - public RelTraitDef getTraitDef() { + @Override public RelTraitDef getTraitDef() { return ConventionTraitDef.INSTANCE; } - public boolean satisfies(RelTrait trait) { + @Override public boolean satisfies(RelTrait trait) { return this == trait; } - public void register(RelOptPlanner planner) {} + @Override public void register(RelOptPlanner planner) {} - public boolean canConvertConvention(Convention toConvention) { + @Override public boolean canConvertConvention(Convention toConvention) { return false; } - public boolean useAbstractConvertersForConversion(RelTraitSet fromTraits, + @Override public boolean useAbstractConvertersForConversion(RelTraitSet fromTraits, RelTraitSet toTraits) { return false; } diff --git a/core/src/main/java/org/apache/calcite/interpreter/Bindables.java b/core/src/main/java/org/apache/calcite/interpreter/Bindables.java index d75de31da75..20e7921783d 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/Bindables.java +++ b/core/src/main/java/org/apache/calcite/interpreter/Bindables.java @@ -251,7 +251,7 @@ public static BindableTableScan create(RelOptCluster cluster, return builder.build(); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } @@ -288,11 +288,11 @@ public static boolean canHandle(RelOptTable table) { || table.unwrap(ProjectableFilterableTable.class) != null; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return help(dataContext, this); } - public Node implement(InterpreterImplementor implementor) { + @Override public Node implement(InterpreterImplementor implementor) { throw new UnsupportedOperationException(); // TODO: } } @@ -344,20 +344,20 @@ public static BindableFilter create(final RelNode input, return new BindableFilter(cluster, traitSet, input, condition); } - public BindableFilter copy(RelTraitSet traitSet, RelNode input, + @Override public BindableFilter copy(RelTraitSet traitSet, RelNode input, RexNode condition) { return new BindableFilter(getCluster(), traitSet, input, condition); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return help(dataContext, this); } - public Node implement(InterpreterImplementor implementor) { + @Override public Node implement(InterpreterImplementor implementor) { return new FilterNode(implementor.compiler, this); } } @@ -402,21 +402,21 @@ public BindableProject(RelOptCluster cluster, RelTraitSet traitSet, assert getConvention() instanceof BindableConvention; } - public BindableProject copy(RelTraitSet traitSet, RelNode input, + @Override public BindableProject copy(RelTraitSet traitSet, RelNode input, List projects, RelDataType rowType) { return new BindableProject(getCluster(), traitSet, input, projects, rowType); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return help(dataContext, this); } - public Node implement(InterpreterImplementor implementor) { + @Override public Node implement(InterpreterImplementor implementor) { return new ProjectNode(implementor.compiler, this); } } @@ -466,15 +466,15 @@ public BindableSort(RelOptCluster cluster, RelTraitSet traitSet, offset, fetch); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return help(dataContext, this); } - public Node implement(InterpreterImplementor implementor) { + @Override public Node implement(InterpreterImplementor implementor) { return new SortNode(implementor.compiler, this); } } @@ -531,22 +531,22 @@ protected BindableJoin(RelOptCluster cluster, RelTraitSet traitSet, CorrelationId.setOf(variablesStopped), joinType); } - public BindableJoin copy(RelTraitSet traitSet, RexNode conditionExpr, + @Override public BindableJoin copy(RelTraitSet traitSet, RexNode conditionExpr, RelNode left, RelNode right, JoinRelType joinType, boolean semiJoinDone) { return new BindableJoin(getCluster(), traitSet, left, right, conditionExpr, variablesSet, joinType); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return help(dataContext, this); } - public Node implement(InterpreterImplementor implementor) { + @Override public Node implement(InterpreterImplementor implementor) { return new JoinNode(implementor.compiler, this); } } @@ -594,20 +594,20 @@ public BindableUnion(RelOptCluster cluster, RelTraitSet traitSet, super(cluster, traitSet, inputs, all); } - public BindableUnion copy(RelTraitSet traitSet, List inputs, + @Override public BindableUnion copy(RelTraitSet traitSet, List inputs, boolean all) { return new BindableUnion(getCluster(), traitSet, inputs, all); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return help(dataContext, this); } - public Node implement(InterpreterImplementor implementor) { + @Override public Node implement(InterpreterImplementor implementor) { return new SetOpNode(implementor.compiler, this); } } @@ -620,19 +620,20 @@ public BindableIntersect(RelOptCluster cluster, RelTraitSet traitSet, super(cluster, traitSet, inputs, all); } - public BindableIntersect copy(RelTraitSet traitSet, List inputs, boolean all) { + @Override public BindableIntersect copy(RelTraitSet traitSet, List inputs, + boolean all) { return new BindableIntersect(getCluster(), traitSet, inputs, all); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return help(dataContext, this); } - public Node implement(InterpreterImplementor implementor) { + @Override public Node implement(InterpreterImplementor implementor) { return new SetOpNode(implementor.compiler, this); } } @@ -645,19 +646,19 @@ public BindableMinus(RelOptCluster cluster, RelTraitSet traitSet, super(cluster, traitSet, inputs, all); } - public BindableMinus copy(RelTraitSet traitSet, List inputs, boolean all) { + @Override public BindableMinus copy(RelTraitSet traitSet, List inputs, boolean all) { return new BindableMinus(getCluster(), traitSet, inputs, all); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return help(dataContext, this); } - public Node implement(InterpreterImplementor implementor) { + @Override public Node implement(InterpreterImplementor implementor) { return new SetOpNode(implementor.compiler, this); } } @@ -675,15 +676,15 @@ public static class BindableValues extends Values implements BindableRel { return new BindableValues(getCluster(), rowType, tuples, traitSet); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return help(dataContext, this); } - public Node implement(InterpreterImplementor implementor) { + @Override public Node implement(InterpreterImplementor implementor) { return new ValuesNode(implementor.compiler, this); } } @@ -762,15 +763,15 @@ public BindableAggregate(RelOptCluster cluster, RelTraitSet traitSet, } } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return help(dataContext, this); } - public Node implement(InterpreterImplementor implementor) { + @Override public Node implement(InterpreterImplementor implementor) { return new AggregateNode(implementor.compiler, this); } } @@ -825,15 +826,15 @@ public static class BindableWindow extends Window implements BindableRel { .multiplyBy(BindableConvention.COST_MULTIPLIER); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return help(dataContext, this); } - public Node implement(InterpreterImplementor implementor) { + @Override public Node implement(InterpreterImplementor implementor) { return new WindowNode(implementor.compiler, this); } } @@ -889,15 +890,15 @@ public static class BindableMatch extends Match implements BindableRel { subsets, allRows, partitionKeys, orderKeys, interval); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return help(dataContext, this); } - public Node implement(InterpreterImplementor implementor) { + @Override public Node implement(InterpreterImplementor implementor) { return new MatchNode(implementor.compiler, this); } } diff --git a/core/src/main/java/org/apache/calcite/interpreter/FilterNode.java b/core/src/main/java/org/apache/calcite/interpreter/FilterNode.java index c60ebf41ac8..4cd95890760 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/FilterNode.java +++ b/core/src/main/java/org/apache/calcite/interpreter/FilterNode.java @@ -36,7 +36,7 @@ public FilterNode(Compiler compiler, Filter rel) { this.context = compiler.createContext(); } - public void run() throws InterruptedException { + @Override public void run() throws InterruptedException { Row row; while ((row = source.receive()) != null) { context.values = row.getValues(); diff --git a/core/src/main/java/org/apache/calcite/interpreter/InterpretableConvention.java b/core/src/main/java/org/apache/calcite/interpreter/InterpretableConvention.java index e6169261f4c..17446c53d7e 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/InterpretableConvention.java +++ b/core/src/main/java/org/apache/calcite/interpreter/InterpretableConvention.java @@ -37,29 +37,29 @@ public enum InterpretableConvention implements Convention { return getName(); } - public Class getInterface() { + @Override public Class getInterface() { return EnumerableRel.class; } - public String getName() { + @Override public String getName() { return "INTERPRETABLE"; } - public RelTraitDef getTraitDef() { + @Override public RelTraitDef getTraitDef() { return ConventionTraitDef.INSTANCE; } - public boolean satisfies(RelTrait trait) { + @Override public boolean satisfies(RelTrait trait) { return this == trait; } - public void register(RelOptPlanner planner) {} + @Override public void register(RelOptPlanner planner) {} - public boolean canConvertConvention(Convention toConvention) { + @Override public boolean canConvertConvention(Convention toConvention) { return false; } - public boolean useAbstractConvertersForConversion(RelTraitSet fromTraits, + @Override public boolean useAbstractConvertersForConversion(RelTraitSet fromTraits, RelTraitSet toTraits) { return false; } diff --git a/core/src/main/java/org/apache/calcite/interpreter/InterpretableConverter.java b/core/src/main/java/org/apache/calcite/interpreter/InterpretableConverter.java index e5d1356942a..a7c84ba427e 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/InterpretableConverter.java +++ b/core/src/main/java/org/apache/calcite/interpreter/InterpretableConverter.java @@ -43,11 +43,11 @@ protected InterpretableConverter(RelOptCluster cluster, RelTraitSet traits, return new InterpretableConverter(getCluster(), traitSet, sole(inputs)); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return new Interpreter(dataContext, getInput()); } } diff --git a/core/src/main/java/org/apache/calcite/interpreter/Interpreter.java b/core/src/main/java/org/apache/calcite/interpreter/Interpreter.java index d482e6afe29..ce34edbf68b 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/Interpreter.java +++ b/core/src/main/java/org/apache/calcite/interpreter/Interpreter.java @@ -103,7 +103,7 @@ private RelNode optimize(RelNode rootRel) { return rootRel; } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { start(); final NodeInfo nodeInfo = nodes.get(rootRel); final Enumerator rows; @@ -116,7 +116,7 @@ public Enumerator enumerator() { } return new TransformedEnumerator(rows) { - protected Object[] transform(Row row) { + @Override protected Object[] transform(Row row) { return row.getValues(); } }; @@ -134,12 +134,12 @@ private void start() { } } - public void close() { + @Override public void close() { } /** Not used. */ private class FooCompiler implements ScalarCompiler { - public Scalar compile(List nodes, RelDataType inputRowType) { + @Override public Scalar compile(List nodes, RelDataType inputRowType) { final RexNode node = nodes.get(0); if (node instanceof RexCall) { final RexCall call = (RexCall) node; @@ -147,11 +147,11 @@ public Scalar compile(List nodes, RelDataType inputRowType) { return new Scalar() { final Object[] args = new Object[call.getOperands().size()]; - public void execute(final Context context, Object[] results) { + @Override public void execute(final Context context, Object[] results) { results[0] = execute(context); } - public Object execute(Context context) { + @Override public Object execute(Context context) { Comparable o0; Comparable o1; switch (call.getKind()) { @@ -227,11 +227,11 @@ public Object execute(Context context) { }; } return new Scalar() { - public void execute(Context context, Object[] results) { + @Override public void execute(Context context, Object[] results) { results[0] = execute(context); } - public Object execute(Context context) { + @Override public Object execute(Context context) { switch (node.getKind()) { case LITERAL: return ((RexLiteral) node).getValueAs(Comparable.class); @@ -291,11 +291,11 @@ private ListSink(ArrayDeque list) { this.list = list; } - public void send(Row row) throws InterruptedException { + @Override public void send(Row row) throws InterruptedException { list.add(row); } - public void end() throws InterruptedException { + @Override public void end() throws InterruptedException { } @SuppressWarnings("deprecation") @@ -319,7 +319,7 @@ private static class ListSource implements Source { this.list = list; } - public Row receive() { + @Override public Row receive() { try { if (iterator == null) { iterator = list.iterator(); @@ -344,13 +344,13 @@ private DuplicatingSink(List> queues) { this.queues = ImmutableList.copyOf(queues); } - public void send(Row row) throws InterruptedException { + @Override public void send(Row row) throws InterruptedException { for (ArrayDeque queue : queues) { queue.add(row); } } - public void end() throws InterruptedException { + @Override public void end() throws InterruptedException { } @SuppressWarnings("deprecation") @@ -479,7 +479,7 @@ Pair> visitRoot(RelNode p) { public void rewrite(RelNode r) { } - public Scalar compile(List nodes, RelDataType inputRowType) { + @Override public Scalar compile(List nodes, RelDataType inputRowType) { if (inputRowType == null) { inputRowType = interpreter.dataContext.getTypeFactory().builder() .build(); @@ -487,7 +487,7 @@ public Scalar compile(List nodes, RelDataType inputRowType) { return scalarCompiler.compile(nodes, inputRowType); } - public RelDataType combinedRowType(List inputs) { + @Override public RelDataType combinedRowType(List inputs) { final RelDataTypeFactory.Builder builder = interpreter.dataContext.getTypeFactory().builder(); for (RelNode input : inputs) { @@ -496,7 +496,7 @@ public RelDataType combinedRowType(List inputs) { return builder.build(); } - public Source source(RelNode rel, int ordinal) { + @Override public Source source(RelNode rel, int ordinal) { final RelNode input = getInput(rel, ordinal); final Edge edge = new Edge(rel, ordinal); final Collection edges = outEdges.get(input); @@ -524,7 +524,7 @@ private RelNode getInput(RelNode rel, int ordinal) { return rel.getInput(ordinal); } - public Sink sink(RelNode rel) { + @Override public Sink sink(RelNode rel) { final Collection edges = outEdges.get(rel); final Collection edges2 = edges.isEmpty() ? ImmutableList.of(new Edge(null, 0)) @@ -555,16 +555,16 @@ public Sink sink(RelNode rel) { } } - public void enumerable(RelNode rel, Enumerable rowEnumerable) { + @Override public void enumerable(RelNode rel, Enumerable rowEnumerable) { NodeInfo nodeInfo = new NodeInfo(rel, rowEnumerable); nodes.put(rel, nodeInfo); } - public Context createContext() { + @Override public Context createContext() { return new Context(getDataContext()); } - public DataContext getDataContext() { + @Override public DataContext getDataContext() { return interpreter.dataContext; } } diff --git a/core/src/main/java/org/apache/calcite/interpreter/Interpreters.java b/core/src/main/java/org/apache/calcite/interpreter/Interpreters.java index 255c0687918..2ae81a3ca66 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/Interpreters.java +++ b/core/src/main/java/org/apache/calcite/interpreter/Interpreters.java @@ -36,11 +36,11 @@ public static ArrayBindable bindable(final RelNode rel) { return (ArrayBindable) rel; } return new ArrayBindable() { - public Enumerable bind(DataContext dataContext) { + @Override public Enumerable bind(DataContext dataContext) { return new Interpreter(dataContext, rel); } - public Class getElementType() { + @Override public Class getElementType() { return Object[].class; } }; diff --git a/core/src/main/java/org/apache/calcite/interpreter/JaninoRexCompiler.java b/core/src/main/java/org/apache/calcite/interpreter/JaninoRexCompiler.java index da95be4efd2..a259683ce46 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/JaninoRexCompiler.java +++ b/core/src/main/java/org/apache/calcite/interpreter/JaninoRexCompiler.java @@ -65,7 +65,7 @@ public JaninoRexCompiler(RexBuilder rexBuilder) { this.rexBuilder = rexBuilder; } - public Scalar compile(List nodes, RelDataType inputRowType) { + @Override public Scalar compile(List nodes, RelDataType inputRowType) { final RexProgramBuilder programBuilder = new RexProgramBuilder(inputRowType, rexBuilder); for (RexNode node : nodes) { diff --git a/core/src/main/java/org/apache/calcite/interpreter/JoinNode.java b/core/src/main/java/org/apache/calcite/interpreter/JoinNode.java index e7cfdeaddd6..2df06c45b65 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/JoinNode.java +++ b/core/src/main/java/org/apache/calcite/interpreter/JoinNode.java @@ -49,7 +49,7 @@ public JoinNode(Compiler compiler, Join rel) { } - public void run() throws InterruptedException { + @Override public void run() throws InterruptedException { final int fieldCount = rel.getLeft().getRowType().getFieldCount() + rel.getRight().getRowType().getFieldCount(); diff --git a/core/src/main/java/org/apache/calcite/interpreter/MatchNode.java b/core/src/main/java/org/apache/calcite/interpreter/MatchNode.java index 0f98a524964..f330a86038b 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/MatchNode.java +++ b/core/src/main/java/org/apache/calcite/interpreter/MatchNode.java @@ -27,7 +27,7 @@ public class MatchNode extends AbstractSingleNode { super(compiler, rel); } - public void run() throws InterruptedException { + @Override public void run() throws InterruptedException { Row row; while ((row = source.receive()) != null) { sink.send(row); diff --git a/core/src/main/java/org/apache/calcite/interpreter/ProjectNode.java b/core/src/main/java/org/apache/calcite/interpreter/ProjectNode.java index 8a61f446cfb..dda0d9fe270 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/ProjectNode.java +++ b/core/src/main/java/org/apache/calcite/interpreter/ProjectNode.java @@ -35,7 +35,7 @@ public ProjectNode(Compiler compiler, Project rel) { this.context = compiler.createContext(); } - public void run() throws InterruptedException { + @Override public void run() throws InterruptedException { Row row; while ((row = source.receive()) != null) { context.values = row.getValues(); diff --git a/core/src/main/java/org/apache/calcite/interpreter/SortNode.java b/core/src/main/java/org/apache/calcite/interpreter/SortNode.java index ae71482a04f..9c4dc3e4f00 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/SortNode.java +++ b/core/src/main/java/org/apache/calcite/interpreter/SortNode.java @@ -36,7 +36,7 @@ public SortNode(Compiler compiler, Sort rel) { super(compiler, rel); } - public void run() throws InterruptedException { + @Override public void run() throws InterruptedException { final int offset = rel.offset == null ? 0 diff --git a/core/src/main/java/org/apache/calcite/interpreter/Source.java b/core/src/main/java/org/apache/calcite/interpreter/Source.java index 6606f1974e3..4543e6206b4 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/Source.java +++ b/core/src/main/java/org/apache/calcite/interpreter/Source.java @@ -25,5 +25,5 @@ public interface Source extends AutoCloseable { /** Reads a row. Null means end of data. */ Row receive(); - void close(); + @Override void close(); } diff --git a/core/src/main/java/org/apache/calcite/interpreter/TableScanNode.java b/core/src/main/java/org/apache/calcite/interpreter/TableScanNode.java index a56505fdac2..427f0e6c47e 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/TableScanNode.java +++ b/core/src/main/java/org/apache/calcite/interpreter/TableScanNode.java @@ -63,7 +63,7 @@ private TableScanNode(Compiler compiler, TableScan rel, compiler.enumerable(rel, enumerable); } - public void run() { + @Override public void run() { // nothing to do } diff --git a/core/src/main/java/org/apache/calcite/interpreter/UnionNode.java b/core/src/main/java/org/apache/calcite/interpreter/UnionNode.java index 520130c9812..55fc12a4952 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/UnionNode.java +++ b/core/src/main/java/org/apache/calcite/interpreter/UnionNode.java @@ -45,7 +45,7 @@ public UnionNode(Compiler compiler, Union rel) { this.rel = rel; } - public void run() throws InterruptedException { + @Override public void run() throws InterruptedException { final Set rows = rel.all ? null : new HashSet<>(); for (Source source : sources) { Row row; diff --git a/core/src/main/java/org/apache/calcite/interpreter/ValuesNode.java b/core/src/main/java/org/apache/calcite/interpreter/ValuesNode.java index c7d41721791..ac399a6dfde 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/ValuesNode.java +++ b/core/src/main/java/org/apache/calcite/interpreter/ValuesNode.java @@ -59,7 +59,7 @@ private ImmutableList createRows(Compiler compiler, return rows.build(); } - public void run() throws InterruptedException { + @Override public void run() throws InterruptedException { for (Row row : rows) { sink.send(row); } diff --git a/core/src/main/java/org/apache/calcite/interpreter/WindowNode.java b/core/src/main/java/org/apache/calcite/interpreter/WindowNode.java index 8bd67e2cf0f..c01f97b4c3c 100644 --- a/core/src/main/java/org/apache/calcite/interpreter/WindowNode.java +++ b/core/src/main/java/org/apache/calcite/interpreter/WindowNode.java @@ -27,7 +27,7 @@ public class WindowNode extends AbstractSingleNode { super(compiler, rel); } - public void run() throws InterruptedException { + @Override public void run() throws InterruptedException { Row row; while ((row = source.receive()) != null) { sink.send(row); diff --git a/core/src/main/java/org/apache/calcite/jdbc/CachingCalciteSchema.java b/core/src/main/java/org/apache/calcite/jdbc/CachingCalciteSchema.java index 57494bd4114..23e144552a5 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/CachingCalciteSchema.java +++ b/core/src/main/java/org/apache/calcite/jdbc/CachingCalciteSchema.java @@ -64,35 +64,35 @@ private CachingCalciteSchema(CalciteSchema parent, Schema schema, functionMap, functionNames, nullaryFunctionMap, path); this.implicitSubSchemaCache = new AbstractCached() { - public SubSchemaCache build() { + @Override public SubSchemaCache build() { return new SubSchemaCache(CachingCalciteSchema.this, CachingCalciteSchema.this.schema.getSubSchemaNames()); } }; this.implicitTableCache = new AbstractCached() { - public NameSet build() { + @Override public NameSet build() { return NameSet.immutableCopyOf( CachingCalciteSchema.this.schema.getTableNames()); } }; this.implicitFunctionCache = new AbstractCached() { - public NameSet build() { + @Override public NameSet build() { return NameSet.immutableCopyOf( CachingCalciteSchema.this.schema.getFunctionNames()); } }; this.implicitTypeCache = new AbstractCached() { - public NameSet build() { + @Override public NameSet build() { return NameSet.immutableCopyOf( CachingCalciteSchema.this.schema.getTypeNames()); } }; } - public void setCache(boolean cache) { + @Override public void setCache(boolean cache) { if (cache == this.cache) { return; } @@ -103,11 +103,11 @@ public void setCache(boolean cache) { this.cache = cache; } - protected boolean isCacheEnabled() { + @Override protected boolean isCacheEnabled() { return this.cache; } - protected CalciteSchema getImplicitSubSchema(String schemaName, + @Override protected CalciteSchema getImplicitSubSchema(String schemaName, boolean caseSensitive) { final long now = System.currentTimeMillis(); final SubSchemaCache subSchemaCache = @@ -121,14 +121,14 @@ protected CalciteSchema getImplicitSubSchema(String schemaName, } /** Adds a child schema of this schema. */ - public CalciteSchema add(String name, Schema schema) { + @Override public CalciteSchema add(String name, Schema schema) { final CalciteSchema calciteSchema = new CachingCalciteSchema(this, schema, name); subSchemaMap.put(name, calciteSchema); return calciteSchema; } - protected TableEntry getImplicitTable(String tableName, + @Override protected TableEntry getImplicitTable(String tableName, boolean caseSensitive) { final long now = System.currentTimeMillis(); final NameSet implicitTableNames = implicitTableCache.get(now); @@ -142,7 +142,7 @@ protected TableEntry getImplicitTable(String tableName, return null; } - protected TypeEntry getImplicitType(String name, boolean caseSensitive) { + @Override protected TypeEntry getImplicitType(String name, boolean caseSensitive) { final long now = System.currentTimeMillis(); final NameSet implicitTypeNames = implicitTypeCache.get(now); for (String typeName @@ -155,7 +155,7 @@ protected TypeEntry getImplicitType(String name, boolean caseSensitive) { return null; } - protected void addImplicitSubSchemaToBuilder( + @Override protected void addImplicitSubSchemaToBuilder( ImmutableSortedMap.Builder builder) { ImmutableSortedMap explicitSubSchemas = builder.build(); final long now = System.currentTimeMillis(); @@ -169,7 +169,7 @@ protected void addImplicitSubSchemaToBuilder( } } - protected void addImplicitTableToBuilder( + @Override protected void addImplicitTableToBuilder( ImmutableSortedSet.Builder builder) { // Add implicit tables, case-sensitive. final long now = System.currentTimeMillis(); @@ -177,7 +177,7 @@ protected void addImplicitTableToBuilder( builder.addAll(set.iterable()); } - protected void addImplicitFunctionsToBuilder( + @Override protected void addImplicitFunctionsToBuilder( ImmutableList.Builder builder, String name, boolean caseSensitive) { // Add implicit functions, case-insensitive. @@ -191,7 +191,7 @@ protected void addImplicitFunctionsToBuilder( } } - protected void addImplicitFuncNamesToBuilder( + @Override protected void addImplicitFuncNamesToBuilder( ImmutableSortedSet.Builder builder) { // Add implicit functions, case-sensitive. final long now = System.currentTimeMillis(); @@ -199,14 +199,15 @@ protected void addImplicitFuncNamesToBuilder( builder.addAll(set.iterable()); } - protected void addImplicitTypeNamesToBuilder(ImmutableSortedSet.Builder builder) { + @Override protected void addImplicitTypeNamesToBuilder( + ImmutableSortedSet.Builder builder) { // Add implicit types, case-sensitive. final long now = System.currentTimeMillis(); final NameSet set = implicitTypeCache.get(now); builder.addAll(set.iterable()); } - protected void addImplicitTablesBasedOnNullaryFunctionsToBuilder( + @Override protected void addImplicitTablesBasedOnNullaryFunctionsToBuilder( ImmutableSortedMap.Builder builder) { ImmutableSortedMap explicitTables = builder.build(); @@ -227,7 +228,7 @@ protected void addImplicitTablesBasedOnNullaryFunctionsToBuilder( } } - protected TableEntry getImplicitTableBasedOnNullaryFunction(String tableName, + @Override protected TableEntry getImplicitTableBasedOnNullaryFunction(String tableName, boolean caseSensitive) { final long now = System.currentTimeMillis(); final NameSet set = implicitFunctionCache.get(now); @@ -244,7 +245,7 @@ protected TableEntry getImplicitTableBasedOnNullaryFunction(String tableName, return null; } - protected CalciteSchema snapshot(CalciteSchema parent, SchemaVersion version) { + @Override protected CalciteSchema snapshot(CalciteSchema parent, SchemaVersion version) { CalciteSchema snapshot = new CachingCalciteSchema(parent, schema.snapshot(version), name, null, tableMap, latticeMap, typeMap, functionMap, functionNames, nullaryFunctionMap, getPath()); @@ -297,7 +298,7 @@ private abstract class AbstractCached implements Cached { T t; boolean built = false; - public T get(long now) { + @Override public T get(long now) { if (!CachingCalciteSchema.this.cache) { return build(); } @@ -308,7 +309,7 @@ public T get(long now) { return t; } - public void enable(long now, boolean enabled) { + @Override public void enable(long now, boolean enabled) { if (!enabled) { t = null; } 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 115d6755076..7706cae4b9b 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/CalciteConnection.java +++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteConnection.java @@ -71,10 +71,10 @@ public interface CalciteConnection extends Connection, QueryProvider { Properties getProperties(); // in java.sql.Connection from JDK 1.7, but declare here to allow other JDKs - void setSchema(String schema) throws SQLException; + @Override void setSchema(String schema) throws SQLException; // in java.sql.Connection from JDK 1.7, but declare here to allow other JDKs - String getSchema() throws SQLException; + @Override String getSchema() throws SQLException; CalciteConnectionConfig config(); diff --git a/core/src/main/java/org/apache/calcite/jdbc/CalciteConnectionImpl.java b/core/src/main/java/org/apache/calcite/jdbc/CalciteConnectionImpl.java index 9c3e7243c2e..3bac79c1c6a 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/CalciteConnectionImpl.java +++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteConnectionImpl.java @@ -151,11 +151,11 @@ CalciteMetaImpl meta() { return (CalciteMetaImpl) meta; } - public CalciteConnectionConfig config() { + @Override public CalciteConnectionConfig config() { return new CalciteConnectionConfigImpl(info); } - public Context createPrepareContext() { + @Override public Context createPrepareContext() { return new ContextImpl(this); } @@ -243,38 +243,38 @@ CalcitePrepare.CalciteSignature parseQuery( // CalciteConnection methods - public SchemaPlus getRootSchema() { + @Override public SchemaPlus getRootSchema() { return rootSchema.plus(); } - public JavaTypeFactory getTypeFactory() { + @Override public JavaTypeFactory getTypeFactory() { return typeFactory; } - public Properties getProperties() { + @Override public Properties getProperties() { return info; } // QueryProvider methods - public Queryable createQuery( + @Override public Queryable createQuery( Expression expression, Class rowType) { return new CalciteQueryable<>(this, rowType, expression); } - public Queryable createQuery(Expression expression, Type rowType) { + @Override public Queryable createQuery(Expression expression, Type rowType) { return new CalciteQueryable<>(this, rowType, expression); } - public T execute(Expression expression, Type type) { + @Override public T execute(Expression expression, Type type) { return null; // TODO: } - public T execute(Expression expression, Class type) { + @Override public T execute(Expression expression, Class type) { return null; // TODO: } - public Enumerator executeQuery(Queryable queryable) { + @Override public Enumerator executeQuery(Queryable queryable) { try { CalciteStatement statement = (CalciteStatement) createStatement(); CalcitePrepare.CalciteSignature signature = @@ -351,11 +351,11 @@ public CalciteConnection getConnection() { private static class CalciteServerImpl implements CalciteServer { final Map statementMap = new HashMap<>(); - public void removeStatement(Meta.StatementHandle h) { + @Override public void removeStatement(Meta.StatementHandle h) { statementMap.remove(h.id); } - public void addStatement(CalciteConnection connection, + @Override public void addStatement(CalciteConnection connection, Meta.StatementHandle h) { final CalciteConnectionImpl c = (CalciteConnectionImpl) connection; final CalciteServerStatement previous = @@ -365,7 +365,7 @@ public void addStatement(CalciteConnection connection, } } - public CalciteServerStatement getStatement(Meta.StatementHandle h) + @Override public CalciteServerStatement getStatement(Meta.StatementHandle h) throws NoSuchStatementException { CalciteServerStatement statement = statementMap.get(h.id); if (statement == null) { @@ -445,7 +445,7 @@ static class DataContextImpl implements DataContext { map = builder.build(); } - public synchronized Object get(String name) { + @Override public synchronized Object get(String name) { Object o = map.get(name); if (o == AvaticaSite.DUMMY_VALUE) { return null; @@ -484,15 +484,15 @@ private SqlAdvisor getSqlAdvisor() { return new SqlAdvisor(validator, parserConfig); } - public SchemaPlus getRootSchema() { + @Override public SchemaPlus getRootSchema() { return rootSchema == null ? null : rootSchema.plus(); } - public JavaTypeFactory getTypeFactory() { + @Override public JavaTypeFactory getTypeFactory() { return typeFactory; } - public QueryProvider getQueryProvider() { + @Override public QueryProvider getQueryProvider() { return queryProvider; } } @@ -511,19 +511,19 @@ static class ContextImpl implements CalcitePrepare.Context { this.rootSchema = mutableRootSchema.createSnapshot(schemaVersion); } - public JavaTypeFactory getTypeFactory() { + @Override public JavaTypeFactory getTypeFactory() { return connection.typeFactory; } - public CalciteSchema getRootSchema() { + @Override public CalciteSchema getRootSchema() { return rootSchema; } - public CalciteSchema getMutableRootSchema() { + @Override public CalciteSchema getMutableRootSchema() { return mutableRootSchema; } - public List getDefaultSchemaPath() { + @Override public List getDefaultSchemaPath() { final String schemaName; try { schemaName = connection.getSchema(); @@ -535,20 +535,20 @@ public List getDefaultSchemaPath() { : ImmutableList.of(schemaName); } - public List getObjectPath() { + @Override public List getObjectPath() { return null; } - public CalciteConnectionConfig config() { + @Override public CalciteConnectionConfig config() { return connection.config(); } - public DataContext getDataContext() { + @Override public DataContext getDataContext() { return connection.createDataContext(ImmutableMap.of(), rootSchema); } - public RelRunner getRelRunner() { + @Override public RelRunner getRelRunner() { final RelRunner runner; try { runner = connection.unwrap(RelRunner.class); @@ -561,7 +561,7 @@ public RelRunner getRelRunner() { return runner; } - public CalcitePrepare.SparkHandler spark() { + @Override public CalcitePrepare.SparkHandler spark() { final boolean enable = config().spark(); return CalcitePrepare.Dummy.getSparkHandler(enable); } @@ -570,19 +570,19 @@ public CalcitePrepare.SparkHandler spark() { /** Implementation of {@link DataContext} that has few variables and is * {@link Serializable}. For Spark. */ private static class SlimDataContext implements DataContext, Serializable { - public SchemaPlus getRootSchema() { + @Override public SchemaPlus getRootSchema() { return null; } - public JavaTypeFactory getTypeFactory() { + @Override public JavaTypeFactory getTypeFactory() { return null; } - public QueryProvider getQueryProvider() { + @Override public QueryProvider getQueryProvider() { return null; } - public Object get(String name) { + @Override public Object get(String name) { return null; } } @@ -599,27 +599,27 @@ static class CalciteServerStatementImpl this.connection = Objects.requireNonNull(connection); } - public Context createPrepareContext() { + @Override public Context createPrepareContext() { return connection.createPrepareContext(); } - public CalciteConnection getConnection() { + @Override public CalciteConnection getConnection() { return connection; } - public void setSignature(Meta.Signature signature) { + @Override public void setSignature(Meta.Signature signature) { this.signature = signature; } - public Meta.Signature getSignature() { + @Override public Meta.Signature getSignature() { return signature; } - public Iterator getResultSet() { + @Override public Iterator getResultSet() { return iterator; } - public void setResultSet(Iterator iterator) { + @Override public void setResultSet(Iterator iterator) { this.iterator = iterator; } } diff --git a/core/src/main/java/org/apache/calcite/jdbc/CalciteFactory.java b/core/src/main/java/org/apache/calcite/jdbc/CalciteFactory.java index b13e4d76b49..1485d118f9c 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/CalciteFactory.java +++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteFactory.java @@ -37,15 +37,15 @@ protected CalciteFactory(int major, int minor) { this.minor = minor; } - public int getJdbcMajorVersion() { + @Override public int getJdbcMajorVersion() { return major; } - public int getJdbcMinorVersion() { + @Override public int getJdbcMinorVersion() { return minor; } - public final AvaticaConnection newConnection( + @Override public final AvaticaConnection newConnection( UnregisteredDriver driver, AvaticaFactory factory, String url, diff --git a/core/src/main/java/org/apache/calcite/jdbc/CalciteJdbc41Factory.java b/core/src/main/java/org/apache/calcite/jdbc/CalciteJdbc41Factory.java index d4ba467c7fe..c71ae842316 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/CalciteJdbc41Factory.java +++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteJdbc41Factory.java @@ -53,20 +53,20 @@ protected CalciteJdbc41Factory(int major, int minor) { super(major, minor); } - public CalciteJdbc41Connection newConnection(UnregisteredDriver driver, + @Override public CalciteJdbc41Connection newConnection(UnregisteredDriver driver, AvaticaFactory factory, String url, Properties info, CalciteSchema rootSchema, JavaTypeFactory typeFactory) { return new CalciteJdbc41Connection( (Driver) driver, factory, url, info, rootSchema, typeFactory); } - public CalciteJdbc41DatabaseMetaData newDatabaseMetaData( + @Override public CalciteJdbc41DatabaseMetaData newDatabaseMetaData( AvaticaConnection connection) { return new CalciteJdbc41DatabaseMetaData( (CalciteConnectionImpl) connection); } - public CalciteJdbc41Statement newStatement(AvaticaConnection connection, + @Override public CalciteJdbc41Statement newStatement(AvaticaConnection connection, Meta.StatementHandle h, int resultSetType, int resultSetConcurrency, @@ -78,7 +78,7 @@ public CalciteJdbc41Statement newStatement(AvaticaConnection connection, resultSetHoldability); } - public AvaticaPreparedStatement newPreparedStatement( + @Override public AvaticaPreparedStatement newPreparedStatement( AvaticaConnection connection, Meta.StatementHandle h, Meta.Signature signature, @@ -91,7 +91,7 @@ public AvaticaPreparedStatement newPreparedStatement( resultSetConcurrency, resultSetHoldability); } - public CalciteResultSet newResultSet(AvaticaStatement statement, QueryState state, + @Override public CalciteResultSet newResultSet(AvaticaStatement statement, QueryState state, Meta.Signature signature, TimeZone timeZone, Meta.Frame firstFrame) throws SQLException { final ResultSetMetaData metaData = @@ -102,7 +102,7 @@ public CalciteResultSet newResultSet(AvaticaStatement statement, QueryState stat firstFrame); } - public ResultSetMetaData newResultSetMetaData(AvaticaStatement statement, + @Override public ResultSetMetaData newResultSetMetaData(AvaticaStatement statement, Meta.Signature signature) { return new AvaticaResultSetMetaData(statement, null, signature); } @@ -137,18 +137,18 @@ private static class CalciteJdbc41PreparedStatement resultSetHoldability); } - public void setRowId( + @Override public void setRowId( int parameterIndex, RowId x) throws SQLException { getSite(parameterIndex).setRowId(x); } - public void setNString( + @Override public void setNString( int parameterIndex, String value) throws SQLException { getSite(parameterIndex).setNString(value); } - public void setNCharacterStream( + @Override public void setNCharacterStream( int parameterIndex, Reader value, long length) throws SQLException { @@ -156,13 +156,13 @@ public void setNCharacterStream( .setNCharacterStream(value, length); } - public void setNClob( + @Override public void setNClob( int parameterIndex, NClob value) throws SQLException { getSite(parameterIndex).setNClob(value); } - public void setClob( + @Override public void setClob( int parameterIndex, Reader reader, long length) throws SQLException { @@ -170,7 +170,7 @@ public void setClob( .setClob(reader, length); } - public void setBlob( + @Override public void setBlob( int parameterIndex, InputStream inputStream, long length) throws SQLException { @@ -178,19 +178,19 @@ public void setBlob( .setBlob(inputStream, length); } - public void setNClob( + @Override public void setNClob( int parameterIndex, Reader reader, long length) throws SQLException { getSite(parameterIndex).setNClob(reader, length); } - public void setSQLXML( + @Override public void setSQLXML( int parameterIndex, SQLXML xmlObject) throws SQLException { getSite(parameterIndex).setSQLXML(xmlObject); } - public void setAsciiStream( + @Override public void setAsciiStream( int parameterIndex, InputStream x, long length) throws SQLException { @@ -198,7 +198,7 @@ public void setAsciiStream( .setAsciiStream(x, length); } - public void setBinaryStream( + @Override public void setBinaryStream( int parameterIndex, InputStream x, long length) throws SQLException { @@ -206,7 +206,7 @@ public void setBinaryStream( .setBinaryStream(x, length); } - public void setCharacterStream( + @Override public void setCharacterStream( int parameterIndex, Reader reader, long length) throws SQLException { @@ -214,41 +214,41 @@ public void setCharacterStream( .setCharacterStream(reader, length); } - public void setAsciiStream( + @Override public void setAsciiStream( int parameterIndex, InputStream x) throws SQLException { getSite(parameterIndex).setAsciiStream(x); } - public void setBinaryStream( + @Override public void setBinaryStream( int parameterIndex, InputStream x) throws SQLException { getSite(parameterIndex).setBinaryStream(x); } - public void setCharacterStream( + @Override public void setCharacterStream( int parameterIndex, Reader reader) throws SQLException { getSite(parameterIndex) .setCharacterStream(reader); } - public void setNCharacterStream( + @Override public void setNCharacterStream( int parameterIndex, Reader value) throws SQLException { getSite(parameterIndex) .setNCharacterStream(value); } - public void setClob( + @Override public void setClob( int parameterIndex, Reader reader) throws SQLException { getSite(parameterIndex).setClob(reader); } - public void setBlob( + @Override public void setBlob( int parameterIndex, InputStream inputStream) throws SQLException { getSite(parameterIndex) .setBlob(inputStream); } - public void setNClob( + @Override public void setNClob( int parameterIndex, Reader reader) throws SQLException { getSite(parameterIndex) .setNClob(reader); diff --git a/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java b/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java index ccbb2e97b17..320ea5c6a72 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java +++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java @@ -193,7 +193,7 @@ private MetaResultSet createResultSet(Enumerable enumerable, cursorFactory, Frame.EMPTY); } - protected MetaResultSet createResultSet( + @Override protected MetaResultSet createResultSet( Map internalParameters, List columns, CursorFactory cursorFactory, final Frame firstFrame) { try { @@ -249,7 +249,7 @@ private ImmutableMap.Builder addProperty( } } - public MetaResultSet getTables(ConnectionHandle ch, + @Override public MetaResultSet getTables(ConnectionHandle ch, String catalog, final Pat schemaPattern, final Pat tableNamePattern, @@ -278,7 +278,7 @@ public MetaResultSet getTables(ConnectionHandle ch, "REF_GENERATION"); } - public MetaResultSet getTypeInfo(ConnectionHandle ch) { + @Override public MetaResultSet getTypeInfo(ConnectionHandle ch) { return createResultSet(allTypeInfo(), MetaTypeInfo.class, "TYPE_NAME", @@ -301,7 +301,7 @@ public MetaResultSet getTypeInfo(ConnectionHandle ch) { "NUM_PREC_RADIX"); } - public MetaResultSet getColumns(ConnectionHandle ch, + @Override public MetaResultSet getColumns(ConnectionHandle ch, String catalog, Pat schemaPattern, Pat tableNamePattern, @@ -476,7 +476,8 @@ public Enumerable columns(final MetaTable table_) { }); } - public MetaResultSet getSchemas(ConnectionHandle ch, String catalog, Pat schemaPattern) { + @Override public MetaResultSet getSchemas(ConnectionHandle ch, String catalog, + Pat schemaPattern) { final Predicate1 schemaMatcher = namedMatcher(schemaPattern); return createResultSet(schemas(catalog).where(schemaMatcher), MetaSchema.class, @@ -484,13 +485,13 @@ public MetaResultSet getSchemas(ConnectionHandle ch, String catalog, Pat schemaP "TABLE_CATALOG"); } - public MetaResultSet getCatalogs(ConnectionHandle ch) { + @Override public MetaResultSet getCatalogs(ConnectionHandle ch) { return createResultSet(catalogs(), MetaCatalog.class, "TABLE_CAT"); } - public MetaResultSet getTableTypes(ConnectionHandle ch) { + @Override public MetaResultSet getTableTypes(ConnectionHandle ch) { return createResultSet(tableTypes(), MetaTableType.class, "TABLE_TYPE"); @@ -676,19 +677,19 @@ private CalcitePrepare.Query toQuery( long updateCount; Signature signature; - public Object getMonitor() { + @Override public Object getMonitor() { return statement; } - public void clear() throws SQLException {} + @Override public void clear() throws SQLException {} - public void assign(Meta.Signature signature, Meta.Frame firstFrame, + @Override public void assign(Meta.Signature signature, Meta.Frame firstFrame, long updateCount) throws SQLException { this.signature = signature; this.updateCount = updateCount; } - public void execute() throws SQLException { + @Override public void execute() throws SQLException { if (signature.statementType.canUpdate()) { final Iterable iterable = _createIterable(h, signature, ImmutableList.of(), @@ -720,7 +721,7 @@ public static CalciteConnection connect(CalciteSchema schema, return DRIVER.connect(schema, typeFactory); } - public boolean syncResults(StatementHandle h, QueryState state, long offset) + @Override public boolean syncResults(StatementHandle h, QueryState state, long offset) throws NoSuchStatementException { // Doesn't have application in Calcite itself. throw new UnsupportedOperationException(); @@ -765,7 +766,7 @@ abstract static class MetadataTable extends AbstractQueryableTable { super(clazz); } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return ((JavaTypeFactory) typeFactory).createType(elementType); } @@ -780,12 +781,12 @@ public RelDataType getRowType(RelDataTypeFactory typeFactory) { protected abstract Enumerator enumerator(CalciteMetaImpl connection); - public Queryable asQueryable(QueryProvider queryProvider, + @Override public Queryable asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { return new AbstractTableQueryable(queryProvider, schema, this, tableName) { @SuppressWarnings("unchecked") - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return (Enumerator) MetadataTable.this.enumerator( ((CalciteConnectionImpl) queryProvider).meta()); } @@ -814,16 +815,16 @@ static Iterator of(Iterator iterator, long limit) { return new LimitIterator<>(iterator, limit); } - public boolean hasNext() { + @Override public boolean hasNext() { return iterator.hasNext() && i < limit; } - public E next() { + @Override public E next() { ++i; return iterator.next(); } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } } diff --git a/core/src/main/java/org/apache/calcite/jdbc/CalcitePrepare.java b/core/src/main/java/org/apache/calcite/jdbc/CalcitePrepare.java index 638f6251992..26e9eeb8b9f 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/CalcitePrepare.java +++ b/core/src/main/java/org/apache/calcite/jdbc/CalcitePrepare.java @@ -209,23 +209,23 @@ public static void pop(Context context) { /** Implementation of {@link SparkHandler} that either does nothing or * throws for each method. Use this if Spark is not installed. */ private static class TrivialSparkHandler implements SparkHandler { - public RelNode flattenTypes(RelOptPlanner planner, RelNode rootRel, + @Override public RelNode flattenTypes(RelOptPlanner planner, RelNode rootRel, boolean restructure) { return rootRel; } - public void registerRules(RuleSetBuilder builder) { + @Override public void registerRules(RuleSetBuilder builder) { } - public boolean enabled() { + @Override public boolean enabled() { return false; } - public ArrayBindable compile(ClassDeclaration expr, String s) { + @Override public ArrayBindable compile(ClassDeclaration expr, String s) { throw new UnsupportedOperationException(); } - public Object sparkContext() { + @Override public Object sparkContext() { throw new UnsupportedOperationException(); } } 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 88f8f41ca5b..1a3a496e589 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/CalciteSchema.java +++ b/core/src/main/java/org/apache/calcite/jdbc/CalciteSchema.java @@ -625,40 +625,40 @@ CalciteSchema calciteSchema() { return CalciteSchema.this; } - public SchemaPlus getParentSchema() { + @Override public SchemaPlus getParentSchema() { return parent == null ? null : parent.plus(); } - public String getName() { + @Override public String getName() { return CalciteSchema.this.getName(); } - public boolean isMutable() { + @Override public boolean isMutable() { return schema.isMutable(); } - public void setCacheEnabled(boolean cache) { + @Override public void setCacheEnabled(boolean cache) { CalciteSchema.this.setCache(cache); } - public boolean isCacheEnabled() { + @Override public boolean isCacheEnabled() { return CalciteSchema.this.isCacheEnabled(); } - public Schema snapshot(SchemaVersion version) { + @Override public Schema snapshot(SchemaVersion version) { throw new UnsupportedOperationException(); } - public Expression getExpression(SchemaPlus parentSchema, String name) { + @Override public Expression getExpression(SchemaPlus parentSchema, String name) { return schema.getExpression(parentSchema, name); } - public Table getTable(String name) { + @Override public Table getTable(String name) { final TableEntry entry = CalciteSchema.this.getTable(name, true); return entry == null ? null : entry.getTable(); } - public NavigableSet getTableNames() { + @Override public NavigableSet getTableNames() { return CalciteSchema.this.getTableNames(); } @@ -671,30 +671,30 @@ public NavigableSet getTableNames() { return CalciteSchema.this.getTypeNames(); } - public Collection getFunctions(String name) { + @Override public Collection getFunctions(String name) { return CalciteSchema.this.getFunctions(name, true); } - public NavigableSet getFunctionNames() { + @Override public NavigableSet getFunctionNames() { return CalciteSchema.this.getFunctionNames(); } - public SchemaPlus getSubSchema(String name) { + @Override public SchemaPlus getSubSchema(String name) { final CalciteSchema subSchema = CalciteSchema.this.getSubSchema(name, true); return subSchema == null ? null : subSchema.plus(); } - public Set getSubSchemaNames() { + @Override public Set getSubSchemaNames() { return CalciteSchema.this.getSubSchemaMap().keySet(); } - public SchemaPlus add(String name, Schema schema) { + @Override public SchemaPlus add(String name, Schema schema) { final CalciteSchema calciteSchema = CalciteSchema.this.add(name, schema); return calciteSchema.plus(); } - public T unwrap(Class clazz) { + @Override public T unwrap(Class clazz) { if (clazz.isInstance(this)) { return clazz.cast(this); } @@ -715,23 +715,23 @@ public T unwrap(Class clazz) { throw new ClassCastException("not a " + clazz); } - public void setPath(ImmutableList> path) { + @Override public void setPath(ImmutableList> path) { CalciteSchema.this.path = path; } - public void add(String name, Table table) { + @Override public void add(String name, Table table) { CalciteSchema.this.add(name, table); } - public void add(String name, Function function) { + @Override public void add(String name, Function function) { CalciteSchema.this.add(name, function); } - public void add(String name, RelProtoDataType type) { + @Override public void add(String name, RelProtoDataType type) { CalciteSchema.this.add(name, type); } - public void add(String name, Lattice lattice) { + @Override public void add(String name, Lattice lattice) { CalciteSchema.this.add(name, lattice); } } @@ -750,7 +750,7 @@ public TableEntryImpl(CalciteSchema schema, String name, Table table, this.table = Objects.requireNonNull(table); } - public Table getTable() { + @Override public Table getTable() { return table; } } @@ -768,7 +768,7 @@ public TypeEntryImpl(CalciteSchema schema, String name, RelProtoDataType protoDa this.protoDataType = protoDataType; } - public RelProtoDataType getType() { + @Override public RelProtoDataType getType() { return protoDataType; } } @@ -787,11 +787,11 @@ public FunctionEntryImpl(CalciteSchema schema, String name, this.function = function; } - public Function getFunction() { + @Override public Function getFunction() { return function; } - public boolean isMaterialization() { + @Override public boolean isMaterialization() { return function instanceof MaterializedViewTable.MaterializedViewTableMacro; } @@ -816,11 +816,11 @@ public LatticeEntryImpl(CalciteSchema schema, String name, starTableEntry = schema.add(name, starTable); } - public Lattice getLattice() { + @Override public Lattice getLattice() { return lattice; } - public TableEntry getStarTable() { + @Override public TableEntry getStarTable() { return starTableEntry; } } 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 8b2c6f686da..9aaef357493 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/JavaTypeFactoryImpl.java +++ b/core/src/main/java/org/apache/calcite/jdbc/JavaTypeFactoryImpl.java @@ -70,7 +70,7 @@ public JavaTypeFactoryImpl(RelDataTypeSystem typeSystem) { super(typeSystem); } - public RelDataType createStructType(Class type) { + @Override public RelDataType createStructType(Class type) { final List list = new ArrayList<>(); for (Field field : type.getFields()) { if (!Modifier.isStatic(field.getModifiers())) { @@ -108,7 +108,7 @@ private Type fieldType(Field field) { return klass; } - public RelDataType createType(Type type) { + @Override public RelDataType createType(Type type) { if (type instanceof RelDataType) { return (RelDataType) type; } @@ -160,7 +160,7 @@ public RelDataType createType(Type type) { } } - public Type getJavaClass(RelDataType type) { + @Override public Type getJavaClass(RelDataType type) { if (type instanceof JavaType) { JavaType javaType = (JavaType) type; return javaType.getJavaClass(); @@ -235,7 +235,7 @@ public Type getJavaClass(RelDataType type) { return null; } - public RelDataType toSql(RelDataType type) { + @Override public RelDataType toSql(RelDataType type) { return toSql(this, type); } @@ -284,7 +284,7 @@ private static RelDataType toSqlTypeWithNullToAny( return toSql(typeFactory, type); } - public Type createSyntheticType(List types) { + @Override public Type createSyntheticType(List types) { if (types.isEmpty()) { // Unit is a pre-defined synthetic type to be used when there are 0 // fields. Because all instances are the same, we use a singleton. @@ -310,13 +310,13 @@ private SyntheticRecordType register( final SyntheticRecordType syntheticType) { final List> key = new AbstractList>() { - public Pair get(int index) { + @Override public Pair get(int index) { final Types.RecordField field = syntheticType.getRecordFields().get(index); return Pair.of(field.getType(), field.nullable()); } - public int size() { + @Override public int size() { return syntheticType.getRecordFields().size(); } }; @@ -364,15 +364,15 @@ private SyntheticRecordType(RelDataType relType, String name) { : "field names not distinct: " + relType; } - public String getName() { + @Override public String getName() { return name; } - public List getRecordFields() { + @Override public List getRecordFields() { return fields; } - public String toString() { + @Override public String toString() { return name; } } @@ -400,27 +400,27 @@ private static class RecordFieldImpl implements Types.RecordField { : "type [" + type + "] can never be null"; } - public Type getType() { + @Override public Type getType() { return type; } - public String getName() { + @Override public String getName() { return name; } - public int getModifiers() { + @Override public int getModifiers() { return modifiers; } - public boolean nullable() { + @Override public boolean nullable() { return nullable; } - public Object get(Object o) { + @Override public Object get(Object o) { throw new UnsupportedOperationException(); } - public Type getDeclaringClass() { + @Override public Type getDeclaringClass() { return syntheticType; } } diff --git a/core/src/main/java/org/apache/calcite/jdbc/MetadataSchema.java b/core/src/main/java/org/apache/calcite/jdbc/MetadataSchema.java index 6f7664f7782..000c7180c7c 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/MetadataSchema.java +++ b/core/src/main/java/org/apache/calcite/jdbc/MetadataSchema.java @@ -35,7 +35,7 @@ class MetadataSchema extends AbstractSchema { ImmutableMap.of( "COLUMNS", new CalciteMetaImpl.MetadataTable(MetaColumn.class) { - public Enumerator enumerator( + @Override public Enumerator enumerator( final CalciteMetaImpl meta) { final String catalog; try { @@ -49,7 +49,7 @@ public Enumerator enumerator( }, "TABLES", new CalciteMetaImpl.MetadataTable(MetaTable.class) { - public Enumerator enumerator(CalciteMetaImpl meta) { + @Override public Enumerator enumerator(CalciteMetaImpl meta) { final String catalog; try { catalog = meta.getConnection().getCatalog(); diff --git a/core/src/main/java/org/apache/calcite/jdbc/SimpleCalciteSchema.java b/core/src/main/java/org/apache/calcite/jdbc/SimpleCalciteSchema.java index 7e50886cf1f..ab08915b408 100644 --- a/core/src/main/java/org/apache/calcite/jdbc/SimpleCalciteSchema.java +++ b/core/src/main/java/org/apache/calcite/jdbc/SimpleCalciteSchema.java @@ -56,18 +56,18 @@ private SimpleCalciteSchema(CalciteSchema parent, Schema schema, functionMap, functionNames, nullaryFunctionMap, path); } - public void setCache(boolean cache) { + @Override public void setCache(boolean cache) { throw new UnsupportedOperationException(); } - public CalciteSchema add(String name, Schema schema) { + @Override public CalciteSchema add(String name, Schema schema) { final CalciteSchema calciteSchema = new SimpleCalciteSchema(this, schema, name); subSchemaMap.put(name, calciteSchema); return calciteSchema; } - protected CalciteSchema getImplicitSubSchema(String schemaName, + @Override protected CalciteSchema getImplicitSubSchema(String schemaName, boolean caseSensitive) { // Check implicit schemas. Schema s = schema.getSubSchema(schemaName); @@ -77,7 +77,7 @@ protected CalciteSchema getImplicitSubSchema(String schemaName, return null; } - protected TableEntry getImplicitTable(String tableName, + @Override protected TableEntry getImplicitTable(String tableName, boolean caseSensitive) { // Check implicit tables. Table table = schema.getTable(tableName); @@ -87,7 +87,7 @@ protected TableEntry getImplicitTable(String tableName, return null; } - protected TypeEntry getImplicitType(String name, boolean caseSensitive) { + @Override protected TypeEntry getImplicitType(String name, boolean caseSensitive) { // Check implicit types. RelProtoDataType type = schema.getType(name); if (type != null) { @@ -96,7 +96,7 @@ protected TypeEntry getImplicitType(String name, boolean caseSensitive) { return null; } - protected void addImplicitSubSchemaToBuilder( + @Override protected void addImplicitSubSchemaToBuilder( ImmutableSortedMap.Builder builder) { ImmutableSortedMap explicitSubSchemas = builder.build(); for (String schemaName : schema.getSubSchemaNames()) { @@ -112,11 +112,11 @@ protected void addImplicitSubSchemaToBuilder( } } - protected void addImplicitTableToBuilder(ImmutableSortedSet.Builder builder) { + @Override protected void addImplicitTableToBuilder(ImmutableSortedSet.Builder builder) { builder.addAll(schema.getTableNames()); } - protected void addImplicitFunctionsToBuilder( + @Override protected void addImplicitFunctionsToBuilder( ImmutableList.Builder builder, String name, boolean caseSensitive) { Collection functions = schema.getFunctions(name); @@ -125,7 +125,8 @@ protected void addImplicitFunctionsToBuilder( } } - protected void addImplicitFuncNamesToBuilder(ImmutableSortedSet.Builder builder) { + @Override protected void addImplicitFuncNamesToBuilder( + ImmutableSortedSet.Builder builder) { builder.addAll(schema.getFunctionNames()); } @@ -134,7 +135,7 @@ protected void addImplicitFuncNamesToBuilder(ImmutableSortedSet.Builder builder.addAll(schema.getTypeNames()); } - protected void addImplicitTablesBasedOnNullaryFunctionsToBuilder( + @Override protected void addImplicitTablesBasedOnNullaryFunctionsToBuilder( ImmutableSortedMap.Builder builder) { ImmutableSortedMap explicitTables = builder.build(); @@ -153,7 +154,7 @@ protected void addImplicitTablesBasedOnNullaryFunctionsToBuilder( } } - protected TableEntry getImplicitTableBasedOnNullaryFunction(String tableName, + @Override protected TableEntry getImplicitTableBasedOnNullaryFunction(String tableName, boolean caseSensitive) { Collection functions = schema.getFunctions(tableName); if (functions != null) { @@ -168,7 +169,7 @@ protected TableEntry getImplicitTableBasedOnNullaryFunction(String tableName, return null; } - protected CalciteSchema snapshot(CalciteSchema parent, SchemaVersion version) { + @Override protected CalciteSchema snapshot(CalciteSchema parent, SchemaVersion version) { CalciteSchema snapshot = new SimpleCalciteSchema(parent, schema.snapshot(version), name, null, tableMap, latticeMap, typeMap, functionMap, functionNames, nullaryFunctionMap, getPath()); @@ -179,7 +180,7 @@ protected CalciteSchema snapshot(CalciteSchema parent, SchemaVersion version) { return snapshot; } - protected boolean isCacheEnabled() { + @Override protected boolean isCacheEnabled() { return false; } diff --git a/core/src/main/java/org/apache/calcite/materialize/CachingLatticeStatisticProvider.java b/core/src/main/java/org/apache/calcite/materialize/CachingLatticeStatisticProvider.java index 544cba28d3b..5b20859537b 100644 --- a/core/src/main/java/org/apache/calcite/materialize/CachingLatticeStatisticProvider.java +++ b/core/src/main/java/org/apache/calcite/materialize/CachingLatticeStatisticProvider.java @@ -44,7 +44,7 @@ class CachingLatticeStatisticProvider implements LatticeStatisticProvider { CacheLoader.from(key -> provider.cardinality(ImmutableList.of(key)))); } - public double cardinality(List columns) { + @Override public double cardinality(List columns) { final List counts = new ArrayList<>(); for (Lattice.Column column : columns) { try { diff --git a/core/src/main/java/org/apache/calcite/materialize/DelegatingLatticeStatisticProvider.java b/core/src/main/java/org/apache/calcite/materialize/DelegatingLatticeStatisticProvider.java index 0a36e8a53e8..f928fbef037 100644 --- a/core/src/main/java/org/apache/calcite/materialize/DelegatingLatticeStatisticProvider.java +++ b/core/src/main/java/org/apache/calcite/materialize/DelegatingLatticeStatisticProvider.java @@ -35,7 +35,7 @@ protected DelegatingLatticeStatisticProvider( this.provider = provider; } - public double cardinality(List columns) { + @Override public double cardinality(List columns) { return provider.cardinality(columns); } } diff --git a/core/src/main/java/org/apache/calcite/materialize/Lattice.java b/core/src/main/java/org/apache/calcite/materialize/Lattice.java index 3f16f8c507b..2be85d2f0df 100644 --- a/core/src/main/java/org/apache/calcite/materialize/Lattice.java +++ b/core/src/main/java/org/apache/calcite/materialize/Lattice.java @@ -571,7 +571,7 @@ public Measure(SqlAggFunction agg, boolean distinct, @Nullable String name, this.digest = b.toString(); } - public int compareTo(@Nonnull Measure measure) { + @Override public int compareTo(@Nonnull Measure measure) { int c = compare(args, measure.args); if (c == 0) { c = agg.getName().compareTo(measure.agg.getName()); @@ -655,7 +655,7 @@ static ImmutableBitSet toBitSet(List columns) { return builder.build(); } - public int compareTo(Column column) { + @Override public int compareTo(Column column) { return Utilities.compare(ordinal, column.ordinal); } @@ -700,11 +700,11 @@ public List identifiers() { return ImmutableList.of(table, column); } - public void toSql(SqlWriter writer) { + @Override public void toSql(SqlWriter writer) { writer.dialect.quoteIdentifier(writer.buf, identifiers()); } - public String defaultAlias() { + @Override public String defaultAlias() { return column; } } @@ -725,11 +725,11 @@ private DerivedColumn(int ordinal, String alias, RexNode e, return Arrays.toString(new Object[] {e, alias}); } - public void toSql(SqlWriter writer) { + @Override public void toSql(SqlWriter writer) { writer.write(e); } - public String defaultAlias() { + @Override public String defaultAlias() { // there is no default alias for an expression return null; } diff --git a/core/src/main/java/org/apache/calcite/materialize/LatticeChildNode.java b/core/src/main/java/org/apache/calcite/materialize/LatticeChildNode.java index 5f394a956ad..2782cb81cde 100644 --- a/core/src/main/java/org/apache/calcite/materialize/LatticeChildNode.java +++ b/core/src/main/java/org/apache/calcite/materialize/LatticeChildNode.java @@ -35,7 +35,7 @@ public class LatticeChildNode extends LatticeNode { this.link = ImmutableList.copyOf(mutableNode.step.keys); } - void use(List usedNodes) { + @Override void use(List usedNodes) { if (!usedNodes.contains(this)) { parent.use(usedNodes); usedNodes.add(this); diff --git a/core/src/main/java/org/apache/calcite/materialize/LatticeRootNode.java b/core/src/main/java/org/apache/calcite/materialize/LatticeRootNode.java index aef86d2e142..607b882de7b 100644 --- a/core/src/main/java/org/apache/calcite/materialize/LatticeRootNode.java +++ b/core/src/main/java/org/apache/calcite/materialize/LatticeRootNode.java @@ -46,7 +46,7 @@ private ImmutableList createPaths(LatticeSpace space) { return ImmutableList.copyOf(paths); } - void use(List usedNodes) { + @Override void use(List usedNodes) { if (!usedNodes.contains(this)) { usedNodes.add(this); } diff --git a/core/src/main/java/org/apache/calcite/materialize/LatticeSuggester.java b/core/src/main/java/org/apache/calcite/materialize/LatticeSuggester.java index 06f08047571..bae862e88e4 100644 --- a/core/src/main/java/org/apache/calcite/materialize/LatticeSuggester.java +++ b/core/src/main/java/org/apache/calcite/materialize/LatticeSuggester.java @@ -433,7 +433,7 @@ private Frame frame(final Query q, RelNode r) { } final int fieldCount = r.getRowType().getFieldCount(); return new Frame(fieldCount, h.hops, measures, ImmutableList.of(h)) { - ColRef column(int offset) { + @Override ColRef column(int offset) { if (offset < aggregate.getGroupSet().cardinality()) { return h.column(aggregate.getGroupSet().nth(offset)); } @@ -459,7 +459,7 @@ ColRef column(int offset) { columns = columnBuilder.build(); } - ColRef column(int offset) { + @Override ColRef column(int offset) { return columns.get(offset); } @@ -515,7 +515,7 @@ private ColRef toColRef(RexNode e, String alias) { return new Frame(fieldCount, builder.build(), CompositeList.of(left.measures, right.measures), ImmutableList.of(left, right)) { - ColRef column(int offset) { + @Override ColRef column(int offset) { if (offset < leftCount) { return left.column(offset); } else { @@ -529,7 +529,7 @@ ColRef column(int offset) { final int fieldCount = r.getRowType().getFieldCount(); return new Frame(fieldCount, ImmutableList.of(), ImmutableList.of(), ImmutableSet.of(tableRef)) { - ColRef column(int offset) { + @Override ColRef column(int offset) { if (offset >= scan.getTable().getRowType().getFieldCount()) { throw new IndexOutOfBoundsException("field " + offset + " out of range in " + scan.getTable().getRowType()); @@ -627,17 +627,17 @@ private TableRef(LatticeTable table, int ordinalInQuery) { this.ordinalInQuery = ordinalInQuery; } - public int hashCode() { + @Override public int hashCode() { return ordinalInQuery; } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { return this == obj || obj instanceof TableRef && ordinalInQuery == ((TableRef) obj).ordinalInQuery; } - public String toString() { + @Override public String toString() { return table + ":" + ordinalInQuery; } } @@ -680,11 +680,11 @@ TableRef target() { private static class Factory implements AttributedDirectedGraph.AttributedEdgeFactory< TableRef, StepRef> { - public StepRef createEdge(TableRef source, TableRef target) { + @Override public StepRef createEdge(TableRef source, TableRef target) { throw new UnsupportedOperationException(); } - public StepRef createEdge(TableRef source, TableRef target, + @Override public StepRef createEdge(TableRef source, TableRef target, Object... attributes) { final Step step = (Step) attributes[0]; final Integer ordinalInQuery = (Integer) attributes[1]; @@ -753,11 +753,11 @@ private BaseColRef(TableRef t, int c) { this.c = c; } - public TableRef tableRef() { + @Override public TableRef tableRef() { return t; } - public int col(LatticeSpace space) { + @Override public int col(LatticeSpace space) { return c; } } @@ -787,11 +787,11 @@ private static class SingleTableDerivedColRef extends DerivedColRef super(ImmutableList.of(tableRef), e, alias); } - public TableRef tableRef() { + @Override public TableRef tableRef() { return tableRefs.get(0); } - public int col(LatticeSpace space) { + @Override public int col(LatticeSpace space) { return space.registerExpression(tableRef().table, e); } } diff --git a/core/src/main/java/org/apache/calcite/materialize/MaterializationService.java b/core/src/main/java/org/apache/calcite/materialize/MaterializationService.java index 90c5791170a..17f9a169d9f 100644 --- a/core/src/main/java/org/apache/calcite/materialize/MaterializationService.java +++ b/core/src/main/java/org/apache/calcite/materialize/MaterializationService.java @@ -358,7 +358,7 @@ Table createTable(CalciteSchema schema, String viewSql, * Creates a table using {@link CloneSchema}. */ public static class DefaultTableFactory implements TableFactory { - public Table createTable(CalciteSchema schema, String viewSql, + @Override public Table createTable(CalciteSchema schema, String viewSql, List viewSchemaPath) { final CalciteConnection connection = CalciteMetaImpl.connect(schema.root(), null); @@ -372,26 +372,26 @@ public Table createTable(CalciteSchema schema, String viewSql, calciteSignature.getCollationList(), Util.transform(calciteSignature.columns, column -> column.type.rep), new AbstractQueryable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final DataContext dataContext = Schemas.createDataContext(connection, calciteSignature.rootSchema.plus()); return calciteSignature.enumerable(dataContext).enumerator(); } - public Type getElementType() { + @Override public Type getElementType() { return Object.class; } - public Expression getExpression() { + @Override public Expression getExpression() { throw new UnsupportedOperationException(); } - public QueryProvider getProvider() { + @Override public QueryProvider getProvider() { return connection; } - public Iterator iterator() { + @Override public Iterator iterator() { final DataContext dataContext = Schemas.createDataContext(connection, calciteSignature.rootSchema.plus()); diff --git a/core/src/main/java/org/apache/calcite/materialize/MutableNode.java b/core/src/main/java/org/apache/calcite/materialize/MutableNode.java index 48822701267..cc7b971b1a9 100644 --- a/core/src/main/java/org/apache/calcite/materialize/MutableNode.java +++ b/core/src/main/java/org/apache/calcite/materialize/MutableNode.java @@ -43,7 +43,7 @@ class MutableNode { static final Ordering ORDERING = Ordering.from( new Comparator() { - public int compare(MutableNode o1, MutableNode o2) { + @Override public int compare(MutableNode o1, MutableNode o2) { int c = Ordering.natural().lexicographical().compare( o1.table.t.getQualifiedName(), o2.table.t.getQualifiedName()); if (c == 0) { diff --git a/core/src/main/java/org/apache/calcite/materialize/ProfilerLatticeStatisticProvider.java b/core/src/main/java/org/apache/calcite/materialize/ProfilerLatticeStatisticProvider.java index d22f56f8056..51dc46deb3e 100644 --- a/core/src/main/java/org/apache/calcite/materialize/ProfilerLatticeStatisticProvider.java +++ b/core/src/main/java/org/apache/calcite/materialize/ProfilerLatticeStatisticProvider.java @@ -78,7 +78,7 @@ private ProfilerLatticeStatisticProvider(Lattice lattice) { })::get; } - public double cardinality(List columns) { + @Override public double cardinality(List columns) { final ImmutableBitSet build = Lattice.Column.toBitSet(columns); final double cardinality = profile.get().cardinality(build); // System.out.println(columns + ": " + cardinality); diff --git a/core/src/main/java/org/apache/calcite/materialize/SqlLatticeStatisticProvider.java b/core/src/main/java/org/apache/calcite/materialize/SqlLatticeStatisticProvider.java index 34df02d7e76..21802ad3828 100644 --- a/core/src/main/java/org/apache/calcite/materialize/SqlLatticeStatisticProvider.java +++ b/core/src/main/java/org/apache/calcite/materialize/SqlLatticeStatisticProvider.java @@ -46,7 +46,7 @@ private SqlLatticeStatisticProvider(Lattice lattice) { this.lattice = Objects.requireNonNull(lattice); } - public double cardinality(List columns) { + @Override public double cardinality(List columns) { final List counts = new ArrayList<>(); for (Lattice.Column column : columns) { counts.add(cardinality(lattice, column)); diff --git a/core/src/main/java/org/apache/calcite/materialize/Step.java b/core/src/main/java/org/apache/calcite/materialize/Step.java index 8c8fa8f446f..33e0c8e8e46 100644 --- a/core/src/main/java/org/apache/calcite/materialize/Step.java +++ b/core/src/main/java/org/apache/calcite/materialize/Step.java @@ -144,11 +144,11 @@ static class Factory implements AttributedDirectedGraph.AttributedEdgeFactory< this.space = Objects.requireNonNull(space); } - public Step createEdge(LatticeTable source, LatticeTable target) { + @Override public Step createEdge(LatticeTable source, LatticeTable target) { throw new UnsupportedOperationException(); } - public Step createEdge(LatticeTable source, LatticeTable target, + @Override public Step createEdge(LatticeTable source, LatticeTable target, Object... attributes) { @SuppressWarnings("unchecked") final List keys = (List) attributes[0]; diff --git a/core/src/main/java/org/apache/calcite/materialize/TileSuggester.java b/core/src/main/java/org/apache/calcite/materialize/TileSuggester.java index eb5680f62da..5ab233cbb45 100644 --- a/core/src/main/java/org/apache/calcite/materialize/TileSuggester.java +++ b/core/src/main/java/org/apache/calcite/materialize/TileSuggester.java @@ -101,31 +101,31 @@ private static class SchemaImpl implements Schema { this.attributes = attributeBuilder.build(); } - public List getTables() { + @Override public List getTables() { return ImmutableList.of(table); } - public List getMeasures() { + @Override public List getMeasures() { throw new UnsupportedOperationException(); } - public List getDimensions() { + @Override public List getDimensions() { throw new UnsupportedOperationException(); } - public List getAttributes() { + @Override public List getAttributes() { return attributes; } - public StatisticsProvider getStatisticsProvider() { + @Override public StatisticsProvider getStatisticsProvider() { return statisticsProvider; } - public Dialect getDialect() { + @Override public Dialect getDialect() { throw new UnsupportedOperationException(); } - public String generateAggregateSql(Aggregate aggregate, + @Override public String generateAggregateSql(Aggregate aggregate, List columnNameList) { throw new UnsupportedOperationException(); } @@ -135,11 +135,11 @@ public String generateAggregateSql(Aggregate aggregate, * There is only one table (in this sense of table) in a lattice. * The algorithm does not really care about tables. */ private static class TableImpl implements Table { - public String getLabel() { + @Override public String getLabel() { return "TABLE"; } - public Table getParent() { + @Override public Table getParent() { return null; } } @@ -158,27 +158,27 @@ private AttributeImpl(Lattice.Column column, TableImpl table) { return getLabel(); } - public String getLabel() { + @Override public String getLabel() { return column.alias; } - public Table getTable() { + @Override public Table getTable() { return table; } - public double estimateSpace() { + @Override public double estimateSpace() { return 0; } - public String getCandidateColumnName() { + @Override public String getCandidateColumnName() { return null; } - public String getDatatype(Dialect dialect) { + @Override public String getDatatype(Dialect dialect) { return null; } - public List getAncestorAttributes() { + @Override public List getAncestorAttributes() { return ImmutableList.of(); } } @@ -192,20 +192,20 @@ private static class StatisticsProviderImpl implements StatisticsProvider { this.lattice = lattice; } - public double getFactRowCount() { + @Override public double getFactRowCount() { return lattice.getFactRowCount(); } - public double getRowCount(List attributes) { + @Override public double getRowCount(List attributes) { return lattice.getRowCount( Util.transform(attributes, input -> ((AttributeImpl) input).column)); } - public double getSpace(List attributes) { + @Override public double getSpace(List attributes) { return attributes.size(); } - public double getLoadTime(List attributes) { + @Override public double getLoadTime(List attributes) { return getSpace(attributes) * getRowCount(attributes); } } diff --git a/core/src/main/java/org/apache/calcite/model/JsonCustomSchema.java b/core/src/main/java/org/apache/calcite/model/JsonCustomSchema.java index 36cea82424f..1491a02656e 100644 --- a/core/src/main/java/org/apache/calcite/model/JsonCustomSchema.java +++ b/core/src/main/java/org/apache/calcite/model/JsonCustomSchema.java @@ -41,7 +41,7 @@ public class JsonCustomSchema extends JsonMapSchema { */ public Map operand; - public void accept(ModelHandler handler) { + @Override public void accept(ModelHandler handler) { handler.visit(this); } diff --git a/core/src/main/java/org/apache/calcite/model/JsonCustomTable.java b/core/src/main/java/org/apache/calcite/model/JsonCustomTable.java index 09d01042d59..2bbab55c613 100644 --- a/core/src/main/java/org/apache/calcite/model/JsonCustomTable.java +++ b/core/src/main/java/org/apache/calcite/model/JsonCustomTable.java @@ -41,7 +41,7 @@ public class JsonCustomTable extends JsonTable { */ public Map operand; - public void accept(ModelHandler handler) { + @Override public void accept(ModelHandler handler) { handler.visit(this); } } diff --git a/core/src/main/java/org/apache/calcite/model/JsonView.java b/core/src/main/java/org/apache/calcite/model/JsonView.java index 90467d1ec83..c2547bd6676 100644 --- a/core/src/main/java/org/apache/calcite/model/JsonView.java +++ b/core/src/main/java/org/apache/calcite/model/JsonView.java @@ -82,7 +82,7 @@ public class JsonView extends JsonTable { */ public Boolean modifiable; - public void accept(ModelHandler handler) { + @Override public void accept(ModelHandler handler) { handler.visit(this); } diff --git a/core/src/main/java/org/apache/calcite/plan/AbstractRelOptPlanner.java b/core/src/main/java/org/apache/calcite/plan/AbstractRelOptPlanner.java index b8428420a34..ed7b9179e83 100644 --- a/core/src/main/java/org/apache/calcite/plan/AbstractRelOptPlanner.java +++ b/core/src/main/java/org/apache/calcite/plan/AbstractRelOptPlanner.java @@ -113,18 +113,18 @@ protected AbstractRelOptPlanner(RelOptCostFactory costFactory, //~ Methods ---------------------------------------------------------------- - public void clear() {} + @Override public void clear() {} - public Context getContext() { + @Override public Context getContext() { return context; } - public RelOptCostFactory getCostFactory() { + @Override public RelOptCostFactory getCostFactory() { return costFactory; } @SuppressWarnings("deprecation") - public void setCancelFlag(CancelFlag cancelFlag) { + @Override public void setCancelFlag(CancelFlag cancelFlag) { // ignored } @@ -138,11 +138,11 @@ public void checkCancel() { } } - public List getRules() { + @Override public List getRules() { return ImmutableList.copyOf(mapDescToRule.values()); } - public boolean addRule(RelOptRule rule) { + @Override public boolean addRule(RelOptRule rule) { // Check that there isn't a rule with the same description final String description = rule.toString(); assert description != null; @@ -162,7 +162,7 @@ public boolean addRule(RelOptRule rule) { return true; } - public boolean removeRule(RelOptRule rule) { + @Override public boolean removeRule(RelOptRule rule) { String description = rule.toString(); RelOptRule removed = mapDescToRule.remove(description); return removed != null; @@ -178,7 +178,7 @@ protected RelOptRule getRuleByDescription(String description) { return mapDescToRule.get(description); } - public void setRuleDescExclusionFilter(Pattern exclusionFilter) { + @Override public void setRuleDescExclusionFilter(Pattern exclusionFilter) { ruleDescExclusionFilter = exclusionFilter; } @@ -193,38 +193,38 @@ public boolean isRuleExcluded(RelOptRule rule) { && ruleDescExclusionFilter.matcher(rule.toString()).matches(); } - public RelOptPlanner chooseDelegate() { + @Override public RelOptPlanner chooseDelegate() { return this; } - public void addMaterialization(RelOptMaterialization materialization) { + @Override public void addMaterialization(RelOptMaterialization materialization) { // ignore - this planner does not support materializations } - public List getMaterializations() { + @Override public List getMaterializations() { return ImmutableList.of(); } - public void addLattice(RelOptLattice lattice) { + @Override public void addLattice(RelOptLattice lattice) { // ignore - this planner does not support lattices } - public RelOptLattice getLattice(RelOptTable table) { + @Override public RelOptLattice getLattice(RelOptTable table) { // this planner does not support lattices return null; } - public void registerSchema(RelOptSchema schema) { + @Override public void registerSchema(RelOptSchema schema) { } - public long getRelMetadataTimestamp(RelNode rel) { + @Override public long getRelMetadataTimestamp(RelNode rel) { return 0; } @Override public void prune(RelNode rel) { } - public void registerClass(RelNode node) { + @Override public void registerClass(RelNode node) { final Class clazz = node.getClass(); if (classes.add(clazz)) { onNewClass(node); @@ -239,49 +239,49 @@ protected void onNewClass(RelNode node) { node.register(this); } - public RelTraitSet emptyTraitSet() { + @Override public RelTraitSet emptyTraitSet() { return RelTraitSet.createEmpty(); } - public RelOptCost getCost(RelNode rel, RelMetadataQuery mq) { + @Override public RelOptCost getCost(RelNode rel, RelMetadataQuery mq) { return mq.getCumulativeCost(rel); } - @SuppressWarnings("deprecation") + @Override @SuppressWarnings("deprecation") public RelOptCost getCost(RelNode rel) { final RelMetadataQuery mq = rel.getCluster().getMetadataQuery(); return getCost(rel, mq); } - public void addListener(RelOptListener newListener) { + @Override public void addListener(RelOptListener newListener) { if (listener == null) { listener = new MulticastRelOptListener(); } listener.addListener(newListener); } - public void registerMetadataProviders(List list) { + @Override public void registerMetadataProviders(List list) { } - public boolean addRelTraitDef(RelTraitDef relTraitDef) { + @Override public boolean addRelTraitDef(RelTraitDef relTraitDef) { return false; } - public void clearRelTraitDefs() {} + @Override public void clearRelTraitDefs() {} - public List getRelTraitDefs() { + @Override public List getRelTraitDefs() { return ImmutableList.of(); } - public void setExecutor(RexExecutor executor) { + @Override public void setExecutor(RexExecutor executor) { this.executor = executor; } - public RexExecutor getExecutor() { + @Override public RexExecutor getExecutor() { return executor; } - public void onCopy(RelNode rel, RelNode newRel) { + @Override public void onCopy(RelNode rel, RelNode newRel) { // do nothing } diff --git a/core/src/main/java/org/apache/calcite/plan/Contexts.java b/core/src/main/java/org/apache/calcite/plan/Contexts.java index 05343d86330..ebcd34ad341 100644 --- a/core/src/main/java/org/apache/calcite/plan/Contexts.java +++ b/core/src/main/java/org/apache/calcite/plan/Contexts.java @@ -118,7 +118,7 @@ private static class WrapContext implements Context { this.target = Objects.requireNonNull(target); } - public T unwrap(Class clazz) { + @Override public T unwrap(Class clazz) { if (clazz.isInstance(target)) { return clazz.cast(target); } @@ -128,7 +128,7 @@ public T unwrap(Class clazz) { /** Empty context. */ static class EmptyContext implements Context { - public T unwrap(Class clazz) { + @Override public T unwrap(Class clazz) { return null; } } 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 61cf9f12ee2..75915ae0f3a 100644 --- a/core/src/main/java/org/apache/calcite/plan/Convention.java +++ b/core/src/main/java/org/apache/calcite/plan/Convention.java @@ -104,21 +104,21 @@ public Impl(String name, Class relClass) { return getName(); } - public void register(RelOptPlanner planner) {} + @Override public void register(RelOptPlanner planner) {} - public boolean satisfies(RelTrait trait) { + @Override public boolean satisfies(RelTrait trait) { return this == trait; } - public Class getInterface() { + @Override public Class getInterface() { return relClass; } - public String getName() { + @Override public String getName() { return name; } - public RelTraitDef getTraitDef() { + @Override public RelTraitDef getTraitDef() { return ConventionTraitDef.INSTANCE; } @@ -127,11 +127,11 @@ public RelTraitDef getTraitDef() { return null; } - public boolean canConvertConvention(Convention toConvention) { + @Override public boolean canConvertConvention(Convention toConvention) { return false; } - public boolean useAbstractConvertersForConversion(RelTraitSet fromTraits, + @Override public boolean useAbstractConvertersForConversion(RelTraitSet fromTraits, RelTraitSet toTraits) { return false; } diff --git a/core/src/main/java/org/apache/calcite/plan/ConventionTraitDef.java b/core/src/main/java/org/apache/calcite/plan/ConventionTraitDef.java index d38d296ad0c..218ca09a42c 100644 --- a/core/src/main/java/org/apache/calcite/plan/ConventionTraitDef.java +++ b/core/src/main/java/org/apache/calcite/plan/ConventionTraitDef.java @@ -70,19 +70,19 @@ private ConventionTraitDef() { //~ Methods ---------------------------------------------------------------- // implement RelTraitDef - public Class getTraitClass() { + @Override public Class getTraitClass() { return Convention.class; } - public String getSimpleName() { + @Override public String getSimpleName() { return "convention"; } - public Convention getDefault() { + @Override public Convention getDefault() { return Convention.NONE; } - public void registerConverterRule( + @Override public void registerConverterRule( RelOptPlanner planner, ConverterRule converterRule) { if (converterRule.isGuaranteed()) { @@ -101,7 +101,7 @@ public void registerConverterRule( } } - public void deregisterConverterRule( + @Override public void deregisterConverterRule( RelOptPlanner planner, ConverterRule converterRule) { if (converterRule.isGuaranteed()) { @@ -122,7 +122,7 @@ public void deregisterConverterRule( } // implement RelTraitDef - public RelNode convert( + @Override public RelNode convert( RelOptPlanner planner, RelNode rel, Convention toConvention, @@ -191,7 +191,7 @@ private RelNode changeConvention( return null; } - public boolean canConvert( + @Override public boolean canConvert( RelOptPlanner planner, Convention fromConvention, Convention toConvention) { diff --git a/core/src/main/java/org/apache/calcite/plan/MulticastRelOptListener.java b/core/src/main/java/org/apache/calcite/plan/MulticastRelOptListener.java index e707bbd7c50..af194f79758 100644 --- a/core/src/main/java/org/apache/calcite/plan/MulticastRelOptListener.java +++ b/core/src/main/java/org/apache/calcite/plan/MulticastRelOptListener.java @@ -49,35 +49,35 @@ public void addListener(RelOptListener listener) { } // implement RelOptListener - public void relEquivalenceFound(RelEquivalenceEvent event) { + @Override public void relEquivalenceFound(RelEquivalenceEvent event) { for (RelOptListener listener : listeners) { listener.relEquivalenceFound(event); } } // implement RelOptListener - public void ruleAttempted(RuleAttemptedEvent event) { + @Override public void ruleAttempted(RuleAttemptedEvent event) { for (RelOptListener listener : listeners) { listener.ruleAttempted(event); } } // implement RelOptListener - public void ruleProductionSucceeded(RuleProductionEvent event) { + @Override public void ruleProductionSucceeded(RuleProductionEvent event) { for (RelOptListener listener : listeners) { listener.ruleProductionSucceeded(event); } } // implement RelOptListener - public void relChosen(RelChosenEvent event) { + @Override public void relChosen(RelChosenEvent event) { for (RelOptListener listener : listeners) { listener.relChosen(event); } } // implement RelOptListener - public void relDiscarded(RelDiscardedEvent event) { + @Override public void relDiscarded(RelDiscardedEvent event) { for (RelOptListener listener : listeners) { listener.relDiscarded(event); } diff --git a/core/src/main/java/org/apache/calcite/plan/RelCompositeTrait.java b/core/src/main/java/org/apache/calcite/plan/RelCompositeTrait.java index ac8c705e314..8bb4efdd52d 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelCompositeTrait.java +++ b/core/src/main/java/org/apache/calcite/plan/RelCompositeTrait.java @@ -70,7 +70,7 @@ static RelTrait of(RelTraitDef def, return def.canonize(compositeTrait); } - public RelTraitDef getTraitDef() { + @Override public RelTraitDef getTraitDef() { return traitDef; } @@ -88,7 +88,7 @@ public RelTraitDef getTraitDef() { return Arrays.toString(traits); } - public boolean satisfies(RelTrait trait) { + @Override public boolean satisfies(RelTrait trait) { for (T t : traits) { if (t.satisfies(trait)) { return true; @@ -97,7 +97,7 @@ public boolean satisfies(RelTrait trait) { return false; } - public void register(RelOptPlanner planner) { + @Override public void register(RelOptPlanner planner) { } /** Returns an immutable list of the traits in this composite trait. */ diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptAbstractTable.java b/core/src/main/java/org/apache/calcite/plan/RelOptAbstractTable.java index ebee046a9cb..aae8ee42545 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptAbstractTable.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptAbstractTable.java @@ -61,66 +61,66 @@ public String getName() { return name; } - public List getQualifiedName() { + @Override public List getQualifiedName() { return ImmutableList.of(name); } - public double getRowCount() { + @Override public double getRowCount() { return 100; } - public RelDataType getRowType() { + @Override public RelDataType getRowType() { return rowType; } - public RelOptSchema getRelOptSchema() { + @Override public RelOptSchema getRelOptSchema() { return schema; } // Override to define collations. - public List getCollationList() { + @Override public List getCollationList() { return Collections.emptyList(); } - public RelDistribution getDistribution() { + @Override public RelDistribution getDistribution() { return RelDistributions.BROADCAST_DISTRIBUTED; } - public T unwrap(Class clazz) { + @Override public T unwrap(Class clazz) { return clazz.isInstance(this) ? clazz.cast(this) : null; } // Override to define keys - public boolean isKey(ImmutableBitSet columns) { + @Override public boolean isKey(ImmutableBitSet columns) { return false; } // Override to get unique keys - public List getKeys() { + @Override public List getKeys() { return Collections.emptyList(); } // Override to define foreign keys - public List getReferentialConstraints() { + @Override public List getReferentialConstraints() { return Collections.emptyList(); } - public RelNode toRel(ToRelContext context) { + @Override public RelNode toRel(ToRelContext context) { return LogicalTableScan.create(context.getCluster(), this, context.getTableHints()); } - public Expression getExpression(Class clazz) { + @Override public Expression getExpression(Class clazz) { return null; } - public RelOptTable extend(List extendedFields) { + @Override public RelOptTable extend(List extendedFields) { throw new UnsupportedOperationException(); } - public List getColumnStrategies() { + @Override public List getColumnStrategies() { return RelOptTableImpl.columnStrategies(this); } diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptCost.java b/core/src/main/java/org/apache/calcite/plan/RelOptCost.java index 331d2abb08a..d963253e8bf 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptCost.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptCost.java @@ -122,5 +122,5 @@ public interface RelOptCost { * Forces implementations to override {@link Object#toString} and provide a * good cost rendering to use during tracing. */ - String toString(); + @Override String toString(); } diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptCostImpl.java b/core/src/main/java/org/apache/calcite/plan/RelOptCostImpl.java index 2ed57bd5d28..11f540aa989 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptCostImpl.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptCostImpl.java @@ -38,32 +38,32 @@ public RelOptCostImpl(double value) { //~ Methods ---------------------------------------------------------------- // implement RelOptCost - public double getRows() { + @Override public double getRows() { return value; } // implement RelOptCost - public double getIo() { + @Override public double getIo() { return 0; } // implement RelOptCost - public double getCpu() { + @Override public double getCpu() { return 0; } // implement RelOptCost - public boolean isInfinite() { + @Override public boolean isInfinite() { return Double.isInfinite(value); } // implement RelOptCost - public boolean isLe(RelOptCost other) { + @Override public boolean isLe(RelOptCost other) { return getRows() <= other.getRows(); } // implement RelOptCost - public boolean isLt(RelOptCost other) { + @Override public boolean isLt(RelOptCost other) { return getRows() < other.getRows(); } @@ -72,7 +72,7 @@ public boolean isLt(RelOptCost other) { } // implement RelOptCost - public boolean equals(RelOptCost other) { + @Override public boolean equals(RelOptCost other) { return getRows() == other.getRows(); } @@ -84,32 +84,32 @@ public boolean equals(RelOptCost other) { } // implement RelOptCost - public boolean isEqWithEpsilon(RelOptCost other) { + @Override public boolean isEqWithEpsilon(RelOptCost other) { return Math.abs(getRows() - other.getRows()) < RelOptUtil.EPSILON; } // implement RelOptCost - public RelOptCost minus(RelOptCost other) { + @Override public RelOptCost minus(RelOptCost other) { return new RelOptCostImpl(getRows() - other.getRows()); } // implement RelOptCost - public RelOptCost plus(RelOptCost other) { + @Override public RelOptCost plus(RelOptCost other) { return new RelOptCostImpl(getRows() + other.getRows()); } // implement RelOptCost - public RelOptCost multiplyBy(double factor) { + @Override public RelOptCost multiplyBy(double factor) { return new RelOptCostImpl(getRows() * factor); } - public double divideBy(RelOptCost cost) { + @Override public double divideBy(RelOptCost cost) { RelOptCostImpl that = (RelOptCostImpl) cost; return this.getRows() / that.getRows(); } // implement RelOptCost - public String toString() { + @Override public String toString() { if (value == Double.MAX_VALUE) { return "huge"; } else { @@ -121,7 +121,7 @@ public String toString() { * {@link RelOptCostImpl}s. */ private static class Factory implements RelOptCostFactory { // implement RelOptPlanner - public RelOptCost makeCost( + @Override public RelOptCost makeCost( double dRows, double dCpu, double dIo) { @@ -129,22 +129,22 @@ public RelOptCost makeCost( } // implement RelOptPlanner - public RelOptCost makeHugeCost() { + @Override public RelOptCost makeHugeCost() { return new RelOptCostImpl(Double.MAX_VALUE); } // implement RelOptPlanner - public RelOptCost makeInfiniteCost() { + @Override public RelOptCost makeInfiniteCost() { return new RelOptCostImpl(Double.POSITIVE_INFINITY); } // implement RelOptPlanner - public RelOptCost makeTinyCost() { + @Override public RelOptCost makeTinyCost() { return new RelOptCostImpl(1.0); } // implement RelOptPlanner - public RelOptCost makeZeroCost() { + @Override public RelOptCost makeZeroCost() { return new RelOptCostImpl(0.0); } } 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 b06f0f46ef1..ce4d101bea8 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptRule.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptRule.java @@ -455,7 +455,7 @@ public List getOperands() { return ImmutableList.copyOf(operands); } - public int hashCode() { + @Override public int hashCode() { // Conventionally, hashCode() and equals() should use the same // criteria, whereas here we only look at the description. This is // okay, because the planner requires all rule instances to have @@ -463,7 +463,7 @@ public int hashCode() { return description.hashCode(); } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { return (obj instanceof RelOptRule) && equals((RelOptRule) obj); } @@ -570,7 +570,7 @@ public RelTrait getOutTrait() { *

It must be unique (for rules that are not equal) and must consist of * only the characters A-Z, a-z, 0-9, '_', '.', '(', ')', '-', ',', '[', ']', ':', ' '. * It must start with a letter. */ - public final String toString() { + @Override public final String toString() { return description; } @@ -678,7 +678,7 @@ ConverterRelOptRuleOperand(Class clazz, RelTrait in, ImmutableList.of()); } - public boolean matches(RelNode rel) { + @Override public boolean matches(RelNode rel) { // Don't apply converters to converters that operate // on the same RelTraitDef -- otherwise we get // an n^2 effect. 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 75dfc51e441..3db199922fb 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperand.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptRuleOperand.java @@ -166,11 +166,11 @@ public void setRule(RelOptRule rule) { this.rule = rule; } - public int hashCode() { + @Override public int hashCode() { return Objects.hash(clazz, trait, children); } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { if (this == obj) { return true; } 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 60803026938..ed83d724ae1 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java +++ b/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java @@ -3103,7 +3103,7 @@ public static boolean contains(RelNode ancestor, final RelNode target) { } try { new RelVisitor() { - public void visit(RelNode node, int ordinal, RelNode parent) { + @Override public void visit(RelNode node, int ordinal, RelNode parent) { if (node == target) { throw Util.FoundOne.NULL; } @@ -3263,11 +3263,11 @@ public static RelNode createRename( assert fieldNames.size() == fields.size(); final List refs = new AbstractList() { - public int size() { + @Override public int size() { return fields.size(); } - public RexNode get(int index) { + @Override public RexNode get(int index) { return RexInputRef.of(index, fields); } }; @@ -3377,11 +3377,11 @@ public static RelNode createProject(final RelFactories.ProjectFactory factory, final RelBuilder relBuilder = RelBuilder.proto(factory).create(child.getCluster(), null); final List exprs = new AbstractList() { - public int size() { + @Override public int size() { return posList.size(); } - public RexNode get(int index) { + @Override public RexNode get(int index) { final int pos = posList.get(index); return relBuilder.getRexBuilder().makeInputRef(child, pos); } @@ -3540,11 +3540,11 @@ public static RelNode pushDownJoinConditions(Join originalJoin, relBuilder.peek().getRowType().getFieldList(); final List> pairs = new AbstractList>() { - public int size() { + @Override public int size() { return leftCount + extraLeftExprs.size(); } - public Pair get(int index) { + @Override public Pair get(int index) { if (index < leftCount) { RelDataTypeField field = fields.get(index); return Pair.of( @@ -3564,11 +3564,11 @@ public Pair get(int index) { final int newLeftCount = leftCount + extraLeftExprs.size(); final List> pairs = new AbstractList>() { - public int size() { + @Override public int size() { return rightCount + extraRightExprs.size(); } - public Pair get(int index) { + @Override public Pair get(int index) { if (index < rightCount) { RelDataTypeField field = fields.get(index); return Pair.of( @@ -3855,7 +3855,7 @@ private static class RelHintPropagateShuttle extends RelHomogeneousShuttle { /** * Visits a particular child of a parent. */ - protected RelNode visitChild(RelNode parent, int i, RelNode child) { + @Override protected RelNode visitChild(RelNode parent, int i, RelNode child) { inheritPaths.forEach(inheritPath -> inheritPath.right.push(i)); try { RelNode child2 = child.accept(this); @@ -3870,7 +3870,7 @@ protected RelNode visitChild(RelNode parent, int i, RelNode child) { } } - public RelNode visit(RelNode other) { + @Override public RelNode visit(RelNode other) { if (other instanceof Hintable) { return visitHintable(other); } else { @@ -3989,7 +3989,7 @@ private static class SubTreeHintPropagateShuttle extends RelHomogeneousShuttle { /** * Visits a particular child of a parent. */ - protected RelNode visitChild(RelNode parent, int i, RelNode child) { + @Override protected RelNode visitChild(RelNode parent, int i, RelNode child) { appendPath.add(i); try { RelNode child2 = child.accept(this); @@ -4005,7 +4005,7 @@ protected RelNode visitChild(RelNode parent, int i, RelNode child) { } } - public RelNode visit(RelNode other) { + @Override public RelNode visit(RelNode other) { if (this.appendPath.size() > 3) { // Returns early if the visiting depth is bigger than 3 return other; @@ -4087,7 +4087,7 @@ private static RelHint copyWithAppendPath(RelHint hint, * */ private static class ResetHintsShuttle extends RelHomogeneousShuttle { - public RelNode visit(RelNode node) { + @Override public RelNode visit(RelNode node) { node = visitChildren(node); if (node instanceof Hintable) { node = resetHints((Hintable) node); @@ -4112,7 +4112,7 @@ private static class VariableSetVisitor extends RelVisitor { final Set variables = new HashSet<>(); // implement RelVisitor - public void visit( + @Override public void visit( RelNode p, int ordinal, RelNode parent) { @@ -4163,7 +4163,7 @@ public VariableUsedVisitor(RelShuttle relShuttle) { public static class InputReferencedVisitor extends RexShuttle { public final SortedSet inputPosReferenced = new TreeSet<>(); - public RexNode visitInputRef(RexInputRef inputRef) { + @Override public RexNode visitInputRef(RexInputRef inputRef) { inputPosReferenced.add(inputRef.getIndex()); return inputRef; } @@ -4283,7 +4283,7 @@ public ImmutableBitSet build() { return bitBuilder.build(); } - public Void visitInputRef(RexInputRef inputRef) { + @Override public Void visitInputRef(RexInputRef inputRef) { bitBuilder.set(inputRef.getIndex()); return null; } @@ -4383,7 +4383,7 @@ public RexInputConverter( this(rexBuilder, srcFields, null, null, null, adjustments); } - public RexNode visitInputRef(RexInputRef var) { + @Override public RexNode visitInputRef(RexInputRef var) { int srcIndex = var.getIndex(); int destIndex = srcIndex + adjustments[srcIndex]; diff --git a/core/src/main/java/org/apache/calcite/plan/RelRule.java b/core/src/main/java/org/apache/calcite/plan/RelRule.java index edf62de515b..0390ae0cd85 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelRule.java +++ b/core/src/main/java/org/apache/calcite/plan/RelRule.java @@ -227,11 +227,11 @@ static RelOptRuleOperand operand(OperandTransform transform) { return b.operands.get(0); } - public OperandDetailBuilder operand(Class relClass) { + @Override public OperandDetailBuilder operand(Class relClass) { return new OperandDetailBuilderImpl<>(this, relClass); } - public Done exactly(RelOptRuleOperand operand) { + @Override public Done exactly(RelOptRuleOperand operand) { operands.add(operand); return DoneImpl.INSTANCE; } @@ -253,12 +253,12 @@ private static class OperandDetailBuilderImpl this.relClass = Objects.requireNonNull(relClass); } - public OperandDetailBuilderImpl trait(@Nonnull RelTrait trait) { + @Override public OperandDetailBuilderImpl trait(@Nonnull RelTrait trait) { this.trait = Objects.requireNonNull(trait); return this; } - public OperandDetailBuilderImpl predicate(Predicate predicate) { + @Override public OperandDetailBuilderImpl predicate(Predicate predicate) { this.predicate = predicate; return this; } @@ -271,27 +271,27 @@ Done done(RelOptRuleOperandChildPolicy childPolicy) { return DoneImpl.INSTANCE; } - public Done convert(RelTrait in) { + @Override public Done convert(RelTrait in) { parent.operands.add( new ConverterRelOptRuleOperand(relClass, in, predicate)); return DoneImpl.INSTANCE; } - public Done noInputs() { + @Override public Done noInputs() { return done(RelOptRuleOperandChildPolicy.LEAF); } - public Done anyInputs() { + @Override public Done anyInputs() { return done(RelOptRuleOperandChildPolicy.ANY); } - public Done oneInput(OperandTransform transform) { + @Override public Done oneInput(OperandTransform transform) { final Done done = transform.apply(inputBuilder); Objects.requireNonNull(done); return done(RelOptRuleOperandChildPolicy.SOME); } - public Done inputs(OperandTransform... transforms) { + @Override public Done inputs(OperandTransform... transforms) { for (OperandTransform transform : transforms) { final Done done = transform.apply(inputBuilder); Objects.requireNonNull(done); @@ -299,7 +299,7 @@ public Done inputs(OperandTransform... transforms) { return done(RelOptRuleOperandChildPolicy.SOME); } - public Done unorderedInputs(OperandTransform... transforms) { + @Override public Done unorderedInputs(OperandTransform... transforms) { for (OperandTransform transform : transforms) { final Done done = transform.apply(inputBuilder); Objects.requireNonNull(done); 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 37440a275c9..aa70ddd9f8a 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelTrait.java +++ b/core/src/main/java/org/apache/calcite/plan/RelTrait.java @@ -48,12 +48,12 @@ public interface RelTrait { /** * See note about equals() and hashCode(). */ - int hashCode(); + @Override int hashCode(); /** * See note about equals() and hashCode(). */ - boolean equals(Object o); + @Override boolean equals(Object o); /** * Returns whether this trait satisfies a given trait. @@ -78,7 +78,7 @@ public interface RelTrait { * Returns a succinct name for this trait. The planner may use this String * to describe the trait. */ - String toString(); + @Override String toString(); /** * Registers a trait instance with the planner. diff --git a/core/src/main/java/org/apache/calcite/plan/RelTraitPropagationVisitor.java b/core/src/main/java/org/apache/calcite/plan/RelTraitPropagationVisitor.java index 080f28324ba..1474ad002d6 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelTraitPropagationVisitor.java +++ b/core/src/main/java/org/apache/calcite/plan/RelTraitPropagationVisitor.java @@ -55,7 +55,7 @@ public RelTraitPropagationVisitor( //~ Methods ---------------------------------------------------------------- - public void visit(RelNode rel, int ordinal, RelNode parent) { + @Override public void visit(RelNode rel, int ordinal, RelNode parent) { // REVIEW: SWZ: 1/31/06: We assume that any special RelNodes, such // as the VolcanoPlanner's RelSubset always have a full complement // of traits and that they either appear as registered or do nothing diff --git a/core/src/main/java/org/apache/calcite/plan/RelTraitSet.java b/core/src/main/java/org/apache/calcite/plan/RelTraitSet.java index 8e4766a5a15..9ea5323fa76 100644 --- a/core/src/main/java/org/apache/calcite/plan/RelTraitSet.java +++ b/core/src/main/java/org/apache/calcite/plan/RelTraitSet.java @@ -105,7 +105,7 @@ public List getTraits(int index) { } } - public RelTrait get(int index) { + @Override public RelTrait get(int index) { return getTrait(index); } @@ -393,7 +393,7 @@ public T getCollation() { * * @return the size of the RelTraitSet. */ - public int size() { + @Override public int size() { return traits.length; } diff --git a/core/src/main/java/org/apache/calcite/plan/RexImplicationChecker.java b/core/src/main/java/org/apache/calcite/plan/RexImplicationChecker.java index 2a94e612624..62fd4d7991f 100644 --- a/core/src/main/java/org/apache/calcite/plan/RexImplicationChecker.java +++ b/core/src/main/java/org/apache/calcite/plan/RexImplicationChecker.java @@ -436,7 +436,7 @@ private static class InputUsageFinder extends RexVisitorImpl { super(true); } - public Void visitInputRef(RexInputRef inputRef) { + @Override public Void visitInputRef(RexInputRef inputRef) { InputRefUsage inputRefUse = getUsageMap(inputRef); inputRefUse.usageCount++; return null; 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 057935e905c..52b7f2686e1 100644 --- a/core/src/main/java/org/apache/calcite/plan/Strong.java +++ b/core/src/main/java/org/apache/calcite/plan/Strong.java @@ -136,7 +136,7 @@ public static boolean isStrong(RexNode e) { final ImmutableBitSet.Builder nullColumns = ImmutableBitSet.builder(); e.accept( new RexVisitorImpl(true) { - public Void visitInputRef(RexInputRef inputRef) { + @Override public Void visitInputRef(RexInputRef inputRef) { nullColumns.set(inputRef.getIndex()); return super.visitInputRef(inputRef); } 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 c27394a932d..68321d682a1 100644 --- a/core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java +++ b/core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java @@ -203,7 +203,7 @@ public SubstitutionVisitor(RelNode target_, RelNode query_, final List allNodes = new ArrayList<>(); final MutableRelVisitor visitor = new MutableRelVisitor() { - public void visit(MutableRel node) { + @Override public void visit(MutableRel node) { parents.add(node.getParent()); allNodes.add(node); super.visit(node); @@ -1044,7 +1044,7 @@ private TrivialRule() { super(any(MutableRel.class), any(MutableRel.class), 0); } - public UnifyResult apply(UnifyRuleCall call) { + @Override public UnifyResult apply(UnifyRuleCall call) { if (call.query.equals(call.target)) { return call.result(call.target); } @@ -1117,7 +1117,7 @@ private CalcToCalcUnifyRule() { operand(MutableCalc.class, target(0)), 1); } - public UnifyResult apply(UnifyRuleCall call) { + @Override public UnifyResult apply(UnifyRuleCall call) { final MutableCalc query = (MutableCalc) call.query; final Pair> queryExplained = explainCalc(query); final RexNode queryCond = queryExplained.left; @@ -1549,7 +1549,7 @@ private AggregateToAggregateUnifyRule() { operand(MutableAggregate.class, target(0)), 1); } - public UnifyResult apply(UnifyRuleCall call) { + @Override public UnifyResult apply(UnifyRuleCall call) { final MutableAggregate query = (MutableAggregate) call.query; final MutableAggregate target = (MutableAggregate) call.target; assert query != target; @@ -1585,7 +1585,7 @@ private UnionToUnionUnifyRule() { super(any(MutableUnion.class), any(MutableUnion.class), 0); } - public UnifyResult apply(UnifyRuleCall call) { + @Override public UnifyResult apply(UnifyRuleCall call) { final MutableUnion query = (MutableUnion) call.query; final MutableUnion target = (MutableUnion) call.target; final List queryInputs = new ArrayList<>(query.getInputs()); @@ -1612,7 +1612,7 @@ private UnionOnCalcsToUnionUnifyRule() { super(any(MutableUnion.class), any(MutableUnion.class), 0); } - public UnifyResult apply(UnifyRuleCall call) { + @Override public UnifyResult apply(UnifyRuleCall call) { return setOpApply(call); } } @@ -1630,7 +1630,7 @@ private IntersectToIntersectUnifyRule() { super(any(MutableIntersect.class), any(MutableIntersect.class), 0); } - public UnifyResult apply(UnifyRuleCall call) { + @Override public UnifyResult apply(UnifyRuleCall call) { final MutableIntersect query = (MutableIntersect) call.query; final MutableIntersect target = (MutableIntersect) call.target; final List queryInputs = new ArrayList<>(query.getInputs()); @@ -1657,7 +1657,7 @@ private IntersectOnCalcsToIntersectUnifyRule() { super(any(MutableIntersect.class), any(MutableIntersect.class), 0); } - public UnifyResult apply(UnifyRuleCall call) { + @Override public UnifyResult apply(UnifyRuleCall call) { return setOpApply(call); } } @@ -1866,7 +1866,7 @@ public static MutableRel unifyAggregates(MutableAggregate query, Set constantCondInputRefs = new HashSet<>(); List targetGroupByIndexList = target.groupSet.asList(); RexShuttle rexShuttle = new RexShuttle() { - public RexNode visitInputRef(RexInputRef inputRef) { + @Override public RexNode visitInputRef(RexInputRef inputRef) { constantCondInputRefs.add(targetGroupByIndexList.get(inputRef.getIndex())); return super.visitInputRef(inputRef); } diff --git a/core/src/main/java/org/apache/calcite/plan/TableAccessMap.java b/core/src/main/java/org/apache/calcite/plan/TableAccessMap.java index b5810a2b3a5..fd9d6f4120f 100644 --- a/core/src/main/java/org/apache/calcite/plan/TableAccessMap.java +++ b/core/src/main/java/org/apache/calcite/plan/TableAccessMap.java @@ -170,7 +170,7 @@ public List getQualifiedName(RelOptTable table) { /** Visitor that finds all tables in a tree. */ private class TableRelVisitor extends RelVisitor { - public void visit( + @Override public void visit( RelNode p, int ordinal, RelNode parent) { diff --git a/core/src/main/java/org/apache/calcite/plan/ViewExpanders.java b/core/src/main/java/org/apache/calcite/plan/ViewExpanders.java index 72b80dabb69..f025489a181 100644 --- a/core/src/main/java/org/apache/calcite/plan/ViewExpanders.java +++ b/core/src/main/java/org/apache/calcite/plan/ViewExpanders.java @@ -39,15 +39,15 @@ public static RelOptTable.ToRelContext toRelContext( RelOptCluster cluster, List hints) { return new RelOptTable.ToRelContext() { - public RelOptCluster getCluster() { + @Override public RelOptCluster getCluster() { return cluster; } - public List getTableHints() { + @Override public List getTableHints() { return hints; } - public RelRoot expandView(RelDataType rowType, String queryString, + @Override public RelRoot expandView(RelDataType rowType, String queryString, List schemaPath, List viewPath) { return viewExpander.expandView(rowType, queryString, schemaPath, viewPath); @@ -72,16 +72,16 @@ public static RelOptTable.ToRelContext simpleContext( RelOptCluster cluster, List hints) { return new RelOptTable.ToRelContext() { - public RelOptCluster getCluster() { + @Override public RelOptCluster getCluster() { return cluster; } - public RelRoot expandView(RelDataType rowType, String queryString, + @Override public RelRoot expandView(RelDataType rowType, String queryString, List schemaPath, List viewPath) { throw new UnsupportedOperationException(); } - public List getTableHints() { + @Override public List getTableHints() { return hints; } }; diff --git a/core/src/main/java/org/apache/calcite/plan/VisitorDataContext.java b/core/src/main/java/org/apache/calcite/plan/VisitorDataContext.java index eae7e27b715..55c9be8ca9d 100644 --- a/core/src/main/java/org/apache/calcite/plan/VisitorDataContext.java +++ b/core/src/main/java/org/apache/calcite/plan/VisitorDataContext.java @@ -50,19 +50,19 @@ public VisitorDataContext(Object[] values) { this.values = values; } - public SchemaPlus getRootSchema() { + @Override public SchemaPlus getRootSchema() { throw new RuntimeException("Unsupported"); } - public JavaTypeFactory getTypeFactory() { + @Override public JavaTypeFactory getTypeFactory() { throw new RuntimeException("Unsupported"); } - public QueryProvider getQueryProvider() { + @Override public QueryProvider getQueryProvider() { throw new RuntimeException("Unsupported"); } - public Object get(String name) { + @Override public Object get(String name) { if (name.equals("inputRecord")) { return values; } else { diff --git a/core/src/main/java/org/apache/calcite/plan/hep/HepInstruction.java b/core/src/main/java/org/apache/calcite/plan/hep/HepInstruction.java index 329f0fe27e6..11eaf271832 100644 --- a/core/src/main/java/org/apache/calcite/plan/hep/HepInstruction.java +++ b/core/src/main/java/org/apache/calcite/plan/hep/HepInstruction.java @@ -50,7 +50,7 @@ static class RuleClass extends HepInstruction { */ Set ruleSet; - void initialize(boolean clearCache) { + @Override void initialize(boolean clearCache) { if (!clearCache) { return; } @@ -58,7 +58,7 @@ void initialize(boolean clearCache) { ruleSet = null; } - void execute(HepPlanner planner) { + @Override void execute(HepPlanner planner) { planner.executeInstruction(this); } } @@ -70,7 +70,7 @@ static class RuleCollection extends HepInstruction { */ Collection rules; - void execute(HepPlanner planner) { + @Override void execute(HepPlanner planner) { planner.executeInstruction(this); } } @@ -85,7 +85,7 @@ static class ConverterRules extends HepInstruction { */ Set ruleSet; - void execute(HepPlanner planner) { + @Override void execute(HepPlanner planner) { planner.executeInstruction(this); } } @@ -94,7 +94,7 @@ void execute(HepPlanner planner) { static class CommonRelSubExprRules extends HepInstruction { Set ruleSet; - void execute(HepPlanner planner) { + @Override void execute(HepPlanner planner) { planner.executeInstruction(this); } } @@ -112,7 +112,7 @@ static class RuleInstance extends HepInstruction { */ RelOptRule rule; - void initialize(boolean clearCache) { + @Override void initialize(boolean clearCache) { if (!clearCache) { return; } @@ -123,7 +123,7 @@ void initialize(boolean clearCache) { } } - void execute(HepPlanner planner) { + @Override void execute(HepPlanner planner) { planner.executeInstruction(this); } } @@ -132,7 +132,7 @@ void execute(HepPlanner planner) { static class MatchOrder extends HepInstruction { HepMatchOrder order; - void execute(HepPlanner planner) { + @Override void execute(HepPlanner planner) { planner.executeInstruction(this); } } @@ -141,7 +141,7 @@ void execute(HepPlanner planner) { static class MatchLimit extends HepInstruction { int limit; - void execute(HepPlanner planner) { + @Override void execute(HepPlanner planner) { planner.executeInstruction(this); } } @@ -150,11 +150,11 @@ void execute(HepPlanner planner) { static class Subprogram extends HepInstruction { HepProgram subprogram; - void initialize(boolean clearCache) { + @Override void initialize(boolean clearCache) { subprogram.initialize(clearCache); } - void execute(HepPlanner planner) { + @Override void execute(HepPlanner planner) { planner.executeInstruction(this); } } @@ -163,10 +163,10 @@ void execute(HepPlanner planner) { static class BeginGroup extends HepInstruction { EndGroup endGroup; - void initialize(boolean clearCache) { + @Override void initialize(boolean clearCache) { } - void execute(HepPlanner planner) { + @Override void execute(HepPlanner planner) { planner.executeInstruction(this); } } @@ -181,7 +181,7 @@ static class EndGroup extends HepInstruction { boolean collecting; - void initialize(boolean clearCache) { + @Override void initialize(boolean clearCache) { if (!clearCache) { return; } @@ -190,7 +190,7 @@ void initialize(boolean clearCache) { collecting = true; } - void execute(HepPlanner planner) { + @Override void execute(HepPlanner planner) { planner.executeInstruction(this); } } diff --git a/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java b/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java index 77a11559d71..5170fd3b1f9 100644 --- a/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java +++ b/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java @@ -154,13 +154,13 @@ public HepPlanner( //~ Methods ---------------------------------------------------------------- // implement RelOptPlanner - public void setRoot(RelNode rel) { + @Override public void setRoot(RelNode rel) { root = addRelToGraph(rel); dumpGraph(); } // implement RelOptPlanner - public RelNode getRoot() { + @Override public RelNode getRoot() { return root; } @@ -173,7 +173,7 @@ public RelNode getRoot() { } // implement RelOptPlanner - public RelNode changeTraits(RelNode rel, RelTraitSet toTraits) { + @Override public RelNode changeTraits(RelNode rel, RelTraitSet toTraits) { // Ignore traits, except for the root, where we remember // what the final conversion should be. if ((rel == root) || (rel == root.getCurrentRel())) { @@ -183,7 +183,7 @@ public RelNode changeTraits(RelNode rel, RelTraitSet toTraits) { } // implement RelOptPlanner - public RelNode findBestExp() { + @Override public RelNode findBestExp() { assert root != null; executeProgram(mainProgram); @@ -761,7 +761,7 @@ private HepRelVertex applyTransformationResults( } // implement RelOptPlanner - public RelNode register( + @Override public RelNode register( RelNode rel, RelNode equivRel) { // Ignore; this call is mostly to tell Volcano how to avoid @@ -774,12 +774,12 @@ public RelNode register( } // implement RelOptPlanner - public RelNode ensureRegistered(RelNode rel, RelNode equivRel) { + @Override public RelNode ensureRegistered(RelNode rel, RelNode equivRel) { return rel; } // implement RelOptPlanner - public boolean isRegistered(RelNode rel) { + @Override public boolean isRegistered(RelNode rel) { return true; } @@ -1028,12 +1028,12 @@ private void dumpGraph() { } // implement RelOptPlanner - public void registerMetadataProviders(List list) { + @Override public void registerMetadataProviders(List list) { list.add(0, new HepRelMetadataProvider()); } // implement RelOptPlanner - public long getRelMetadataTimestamp(RelNode rel) { + @Override public long getRelMetadataTimestamp(RelNode rel) { // TODO jvs 20-Apr-2006: This is overly conservative. Better would be // to keep a timestamp per HepRelVertex, and update only affected // vertices and all ancestors on each transformation. diff --git a/core/src/main/java/org/apache/calcite/plan/hep/HepRelMetadataProvider.java b/core/src/main/java/org/apache/calcite/plan/hep/HepRelMetadataProvider.java index 435e406a967..960f660b73b 100644 --- a/core/src/main/java/org/apache/calcite/plan/hep/HepRelMetadataProvider.java +++ b/core/src/main/java/org/apache/calcite/plan/hep/HepRelMetadataProvider.java @@ -43,7 +43,7 @@ class HepRelMetadataProvider implements RelMetadataProvider { return 107; } - public UnboundMetadata apply( + @Override public UnboundMetadata apply( Class relClass, final Class metadataClass) { return (rel, mq) -> { @@ -59,7 +59,7 @@ public UnboundMetadata apply( }; } - public Multimap> handlers( + @Override public Multimap> handlers( MetadataDef def) { return ImmutableMultimap.of(); } 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 40a50ac65bc..7d36ee0fb2a 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 @@ -60,7 +60,7 @@ public AbstractConverter( //~ Methods ---------------------------------------------------------------- - public RelNode copy(RelTraitSet traitSet, List inputs) { + @Override public RelNode copy(RelTraitSet traitSet, List inputs) { return new AbstractConverter( getCluster(), (RelSubset) sole(inputs), @@ -68,11 +68,11 @@ public RelNode copy(RelTraitSet traitSet, List inputs) { traitSet); } - public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { + @Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { return planner.getCostFactory().makeInfiniteCost(); } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { super.explainTerms(pw); for (RelTrait trait : traitSet) { pw.item(trait.getTraitDef().getSimpleName(), trait); 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 26da2230e3a..488bfcc632b 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 @@ -66,7 +66,7 @@ static String provenance( final PrintWriter pw = new PrintWriter(sw); final List nodes = new ArrayList<>(); new RelVisitor() { - public void visit(RelNode node, int ordinal, RelNode parent) { + @Override public void visit(RelNode node, int ordinal, RelNode parent) { nodes.add(node); super.visit(node, ordinal, parent); } 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 62394cca3e1..339b78d5196 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 @@ -72,7 +72,7 @@ class IterativeRuleQueue extends RuleQueue { /** * Add a rule match. */ - public void addMatch(VolcanoRuleMatch match) { + @Override public void addMatch(VolcanoRuleMatch match) { final String matchName = match.toString(); if (!matchList.names.add(matchName)) { 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 dccb95019f8..da6c88155af 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 @@ -212,7 +212,7 @@ public RelNode getOriginal() { return set.rel; } - public RelNode copy(RelTraitSet traitSet, List inputs) { + @Override public RelNode copy(RelTraitSet traitSet, List inputs) { if (inputs.isEmpty()) { final RelTraitSet traitSet1 = traitSet.simplify(); if (traitSet1.equals(this.traitSet)) { @@ -223,11 +223,11 @@ public RelNode copy(RelTraitSet traitSet, List inputs) { throw new UnsupportedOperationException(); } - public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { + @Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { return planner.getCostFactory().makeZeroCost(); } - public double estimateRowCount(RelMetadataQuery mq) { + @Override public double estimateRowCount(RelMetadataQuery mq) { if (best != null) { return mq.getRowCount(best); } else { 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 0115a05adf0..1380fee8f61 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 @@ -145,7 +145,7 @@ private void applyGenerator(GeneratorTask task, Procedure proc) { } } - public void onSetMerged(RelSet set) { + @Override public void onSetMerged(RelSet set) { // When RelSets get merged, an optimized group may get extra opportunities. // Clear the OPTIMISED state for the RelSubsets and all theirs ancestors // so that they will be optimized again @@ -172,7 +172,7 @@ private void clearProcessed(RelSet set) { // a callback invoked when a RelNode is going to be added into a RelSubset, // either by Register or Reregister. The task driver should need to schedule // tasks for the new nodes. - public void onProduce(RelNode node, RelSubset subset) { + @Override public void onProduce(RelNode node, RelSubset subset) { // if the RelNode is added to another RelSubset, just ignore it. // It should be schedule in the later OptimizeGroup task diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleQueue.java b/core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleQueue.java index 2c142c1f601..7cb0528eb37 100644 --- a/core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleQueue.java +++ b/core/src/main/java/org/apache/calcite/plan/volcano/TopDownRuleQueue.java @@ -41,7 +41,7 @@ class TopDownRuleQueue extends RuleQueue { super(planner); } - public void addMatch(VolcanoRuleMatch match) { + @Override public void addMatch(VolcanoRuleMatch match) { RelNode rel = match.rel(0); List queue = matches. computeIfAbsent(rel, id -> new LinkedList<>()); 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 f8d67ec6cc0..76969e12963 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 @@ -36,28 +36,28 @@ class VolcanoCost implements RelOptCost { Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY) { - public String toString() { + @Override public String toString() { return "{inf}"; } }; static final VolcanoCost HUGE = new VolcanoCost(Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE) { - public String toString() { + @Override public String toString() { return "{huge}"; } }; static final VolcanoCost ZERO = new VolcanoCost(0.0, 0.0, 0.0) { - public String toString() { + @Override public String toString() { return "{0}"; } }; static final VolcanoCost TINY = new VolcanoCost(1.0, 1.0, 0.0) { - public String toString() { + @Override public String toString() { return "{tiny}"; } }; @@ -80,22 +80,22 @@ public String toString() { //~ Methods ---------------------------------------------------------------- - public double getCpu() { + @Override public double getCpu() { return cpu; } - public boolean isInfinite() { + @Override public boolean isInfinite() { return (this == INFINITY) || (this.rowCount == Double.POSITIVE_INFINITY) || (this.cpu == Double.POSITIVE_INFINITY) || (this.io == Double.POSITIVE_INFINITY); } - public double getIo() { + @Override public double getIo() { return io; } - public boolean isLe(RelOptCost other) { + @Override public boolean isLe(RelOptCost other) { VolcanoCost that = (VolcanoCost) other; if (true) { return this == that @@ -107,7 +107,7 @@ public boolean isLe(RelOptCost other) { && (this.io <= that.io)); } - public boolean isLt(RelOptCost other) { + @Override public boolean isLt(RelOptCost other) { if (true) { VolcanoCost that = (VolcanoCost) other; return this.rowCount < that.rowCount; @@ -115,7 +115,7 @@ public boolean isLt(RelOptCost other) { return isLe(other) && !equals(other); } - public double getRows() { + @Override public double getRows() { return rowCount; } @@ -123,7 +123,7 @@ public double getRows() { return Objects.hash(rowCount, cpu, io); } - public boolean equals(RelOptCost other) { + @Override public boolean equals(RelOptCost other) { return this == other || other instanceof VolcanoCost && (this.rowCount == ((VolcanoCost) other).rowCount) @@ -138,7 +138,7 @@ public boolean equals(RelOptCost other) { return false; } - public boolean isEqWithEpsilon(RelOptCost other) { + @Override public boolean isEqWithEpsilon(RelOptCost other) { if (!(other instanceof VolcanoCost)) { return false; } @@ -149,7 +149,7 @@ public boolean isEqWithEpsilon(RelOptCost other) { && (Math.abs(this.io - that.io) < RelOptUtil.EPSILON)); } - public RelOptCost minus(RelOptCost other) { + @Override public RelOptCost minus(RelOptCost other) { if (this == INFINITY) { return this; } @@ -160,14 +160,14 @@ public RelOptCost minus(RelOptCost other) { this.io - that.io); } - public RelOptCost multiplyBy(double factor) { + @Override public RelOptCost multiplyBy(double factor) { if (this == INFINITY) { return this; } return new VolcanoCost(rowCount * factor, cpu * factor, io * factor); } - public double divideBy(RelOptCost cost) { + @Override public double divideBy(RelOptCost cost) { // Compute the geometric average of the ratios of all of the factors // which are non-zero and finite. VolcanoCost that = (VolcanoCost) cost; @@ -200,7 +200,7 @@ public double divideBy(RelOptCost cost) { return Math.pow(d, 1 / n); } - public RelOptCost plus(RelOptCost other) { + @Override public RelOptCost plus(RelOptCost other) { VolcanoCost that = (VolcanoCost) other; if ((this == INFINITY) || (that == INFINITY)) { return INFINITY; @@ -211,30 +211,30 @@ public RelOptCost plus(RelOptCost other) { this.io + that.io); } - public String toString() { + @Override public String toString() { return "{" + rowCount + " rows, " + cpu + " cpu, " + io + " io}"; } /** Implementation of {@link org.apache.calcite.plan.RelOptCostFactory} * that creates {@link org.apache.calcite.plan.volcano.VolcanoCost}s. */ private static class Factory implements RelOptCostFactory { - public RelOptCost makeCost(double dRows, double dCpu, double dIo) { + @Override public RelOptCost makeCost(double dRows, double dCpu, double dIo) { return new VolcanoCost(dRows, dCpu, dIo); } - public RelOptCost makeHugeCost() { + @Override public RelOptCost makeHugeCost() { return VolcanoCost.HUGE; } - public RelOptCost makeInfiniteCost() { + @Override public RelOptCost makeInfiniteCost() { return VolcanoCost.INFINITY; } - public RelOptCost makeTinyCost() { + @Override public RelOptCost makeTinyCost() { return VolcanoCost.TINY; } - public RelOptCost makeZeroCost() { + @Override public RelOptCost makeZeroCost() { return VolcanoCost.ZERO; } } 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 fa26892cb97..12ffe289f4a 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 @@ -252,11 +252,11 @@ public void setTopDownOpt(boolean value) { } // implement RelOptPlanner - public boolean isRegistered(RelNode rel) { + @Override public boolean isRegistered(RelNode rel) { return mapRel2Subset.get(rel) != null; } - public void setRoot(RelNode rel) { + @Override public void setRoot(RelNode rel) { // We've registered all the rules, and therefore RelNode classes, // we're interested in, and have not yet started calling metadata providers. // So now is a good time to tell the metadata layer what to expect. @@ -271,7 +271,7 @@ public void setRoot(RelNode rel) { ensureRootConverters(); } - public RelNode getRoot() { + @Override public RelNode getRoot() { return root; } @@ -398,7 +398,7 @@ public RelSet getSet(RelNode rel) { this.provenanceMap.clear(); } - public boolean addRule(RelOptRule rule) { + @Override public boolean addRule(RelOptRule rule) { if (locked) { return false; } @@ -437,7 +437,7 @@ public boolean addRule(RelOptRule rule) { return true; } - public boolean removeRule(RelOptRule rule) { + @Override public boolean removeRule(RelOptRule rule) { // Remove description. if (!super.removeRule(rule)) { // Rule was not present. @@ -479,7 +479,7 @@ public boolean removeRule(RelOptRule rule) { } } - public RelNode changeTraits(final RelNode rel, RelTraitSet toTraits) { + @Override public RelNode changeTraits(final RelNode rel, RelTraitSet toTraits) { assert !rel.getTraitSet().equals(toTraits); assert toTraits.allSimple(); @@ -492,7 +492,7 @@ public RelNode changeTraits(final RelNode rel, RelTraitSet toTraits) { rel.getCluster(), toTraits, true); } - public RelOptPlanner chooseDelegate() { + @Override public RelOptPlanner chooseDelegate() { return this; } @@ -503,7 +503,7 @@ public RelOptPlanner chooseDelegate() { * @return the most efficient RelNode tree found for implementing the given * query */ - public RelNode findBestExp() { + @Override public RelNode findBestExp() { ensureRootConverters(); registerMaterializations(); @@ -569,7 +569,7 @@ void ensureRootConverters() { } } - public RelSubset register( + @Override public RelSubset register( RelNode rel, RelNode equivRel) { assert !isRegistered(rel) : "pre: isRegistered(rel)"; @@ -589,7 +589,7 @@ public RelSubset register( return registerImpl(rel, set); } - public RelSubset ensureRegistered(RelNode rel, RelNode equivRel) { + @Override public RelSubset ensureRegistered(RelNode rel, RelNode equivRel) { RelSubset result; final RelSubset subset = getSubset(rel); if (subset != null) { @@ -674,7 +674,7 @@ public void registerAbstractRelationalRules() { RelOptUtil.registerAbstractRelationalRules(this); } - public void registerSchema(RelOptSchema schema) { + @Override public void registerSchema(RelOptSchema schema) { if (registeredSchemas.add(schema)) { try { schema.registerRules(this); @@ -693,7 +693,7 @@ public void setNoneConventionHasInfiniteCost(boolean infinite) { this.noneConventionHasInfiniteCost = infinite; } - public RelOptCost getCost(RelNode rel, RelMetadataQuery mq) { + @Override public RelOptCost getCost(RelNode rel, RelMetadataQuery mq) { assert rel != null : "pre-condition: rel != null"; if (rel instanceof RelSubset) { return ((RelSubset) rel).bestCost; @@ -1290,12 +1290,12 @@ private RelSubset registerSubset( } // implement RelOptPlanner - public void registerMetadataProviders(List list) { + @Override public void registerMetadataProviders(List list) { list.add(0, new VolcanoRelMetadataProvider()); } // implement RelOptPlanner - public long getRelMetadataTimestamp(RelNode rel) { + @Override public long getRelMetadataTimestamp(RelNode rel) { RelSubset subset = getSubset(rel); if (subset == null) { return 0; @@ -1459,7 +1459,7 @@ private static class DeferringRuleCall extends VolcanoRuleCall { * Rather than invoking the rule (as the base method does), creates a * {@link VolcanoRuleMatch} which can be invoked later. */ - protected void onMatch() { + @Override protected void onMatch() { final VolcanoRuleMatch match = new VolcanoRuleMatch( volcanoPlanner, diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoRelMetadataProvider.java b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoRelMetadataProvider.java index 00c51642273..82223ce722e 100644 --- a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoRelMetadataProvider.java +++ b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoRelMetadataProvider.java @@ -43,7 +43,7 @@ public class VolcanoRelMetadataProvider implements RelMetadataProvider { return 103; } - public UnboundMetadata apply( + @Override public UnboundMetadata apply( Class relClass, final Class metadataClass) { if (relClass != RelSubset.class) { @@ -112,7 +112,7 @@ public UnboundMetadata apply( }; } - public Multimap> handlers( + @Override public Multimap> handlers( MetadataDef def) { return ImmutableMultimap.of(); } diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoRuleMatch.java b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoRuleMatch.java index beda1c5a4ca..01ccde743ec 100644 --- a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoRuleMatch.java +++ b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoRuleMatch.java @@ -52,7 +52,7 @@ class VolcanoRuleMatch extends VolcanoRuleCall { //~ Methods ---------------------------------------------------------------- - public String toString() { + @Override public String toString() { return digest; } diff --git a/core/src/main/java/org/apache/calcite/prepare/CalciteCatalogReader.java b/core/src/main/java/org/apache/calcite/prepare/CalciteCatalogReader.java index e0f2f5cb2b0..fcede58c19f 100644 --- a/core/src/main/java/org/apache/calcite/prepare/CalciteCatalogReader.java +++ b/core/src/main/java/org/apache/calcite/prepare/CalciteCatalogReader.java @@ -108,12 +108,12 @@ protected CalciteCatalogReader(CalciteSchema rootSchema, this.config = config; } - public CalciteCatalogReader withSchemaPath(List schemaPath) { + @Override public CalciteCatalogReader withSchemaPath(List schemaPath) { return new CalciteCatalogReader(rootSchema, nameMatcher, ImmutableList.of(schemaPath, ImmutableList.of()), typeFactory, config); } - public Prepare.PreparingTable getTable(final List names) { + @Override public Prepare.PreparingTable getTable(final List names) { // First look in the default schema, if any. // If not found, look in the root schema. CalciteSchema.TableEntry entry = SqlValidatorUtil.getTableEntry(this, names); @@ -171,7 +171,7 @@ private Collection getFunctionsFrom( return functions2; } - public RelDataType getNamedType(SqlIdentifier typeName) { + @Override public RelDataType getNamedType(SqlIdentifier typeName) { CalciteSchema.TypeEntry typeEntry = SqlValidatorUtil.getTypeEntry(getRootSchema(), typeName); if (typeEntry != null) { return typeEntry.getType().apply(typeFactory); @@ -180,7 +180,7 @@ public RelDataType getNamedType(SqlIdentifier typeName) { } } - public List getAllSchemaObjectNames(List names) { + @Override public List getAllSchemaObjectNames(List names) { final CalciteSchema schema = SqlValidatorUtil.getSchema(rootSchema, names, nameMatcher); if (schema == null) { @@ -221,31 +221,31 @@ private SqlMonikerImpl moniker(CalciteSchema schema, String name, return new SqlMonikerImpl(path, type); } - public List> getSchemaPaths() { + @Override public List> getSchemaPaths() { return schemaPaths; } - public Prepare.PreparingTable getTableForMember(List names) { + @Override public Prepare.PreparingTable getTableForMember(List names) { return getTable(names); } - @SuppressWarnings("deprecation") + @Override @SuppressWarnings("deprecation") public RelDataTypeField field(RelDataType rowType, String alias) { return nameMatcher.field(rowType, alias); } @SuppressWarnings("deprecation") - public boolean matches(String string, String name) { + @Override public boolean matches(String string, String name) { return nameMatcher.matches(string, name); } - public RelDataType createTypeFromProjection(final RelDataType type, + @Override public RelDataType createTypeFromProjection(final RelDataType type, final List columnNameList) { return SqlValidatorUtil.createTypeFromProjection(type, columnNameList, typeFactory, nameMatcher.isCaseSensitive()); } - public void lookupOperatorOverloads(final SqlIdentifier opName, + @Override public void lookupOperatorOverloads(final SqlIdentifier opName, SqlFunctionCategory category, SqlSyntax syntax, List operatorList, @@ -409,7 +409,7 @@ private static RelDataType toSql(RelDataTypeFactory typeFactory, return JavaTypeFactoryImpl.toSql(typeFactory, type); } - public List getOperatorList() { + @Override public List getOperatorList() { final ImmutableList.Builder builder = ImmutableList.builder(); for (List schemaPath : schemaPaths) { CalciteSchema schema = @@ -424,15 +424,15 @@ public List getOperatorList() { return builder.build(); } - public CalciteSchema getRootSchema() { + @Override public CalciteSchema getRootSchema() { return rootSchema; } - public RelDataTypeFactory getTypeFactory() { + @Override public RelDataTypeFactory getTypeFactory() { return typeFactory; } - public void registerRules(RelOptPlanner planner) { + @Override public void registerRules(RelOptPlanner planner) { } @SuppressWarnings("deprecation") @@ -440,7 +440,7 @@ public void registerRules(RelOptPlanner planner) { return nameMatcher.isCaseSensitive(); } - public SqlNameMatcher nameMatcher() { + @Override public SqlNameMatcher nameMatcher() { return nameMatcher; } diff --git a/core/src/main/java/org/apache/calcite/prepare/CalciteMaterializer.java b/core/src/main/java/org/apache/calcite/prepare/CalciteMaterializer.java index a779ff4562d..ffd6b9f8ca0 100644 --- a/core/src/main/java/org/apache/calcite/prepare/CalciteMaterializer.java +++ b/core/src/main/java/org/apache/calcite/prepare/CalciteMaterializer.java @@ -151,55 +151,55 @@ private Iterable useStar(CalciteSchema schema, RelNode queryRel) { /** Implementation of {@link RelShuttle} that returns each relational * expression unchanged. It does not visit inputs. */ static class RelNullShuttle implements RelShuttle { - public RelNode visit(TableScan scan) { + @Override public RelNode visit(TableScan scan) { return scan; } - public RelNode visit(TableFunctionScan scan) { + @Override public RelNode visit(TableFunctionScan scan) { return scan; } - public RelNode visit(LogicalValues values) { + @Override public RelNode visit(LogicalValues values) { return values; } - public RelNode visit(LogicalFilter filter) { + @Override public RelNode visit(LogicalFilter filter) { return filter; } - public RelNode visit(LogicalCalc calc) { + @Override public RelNode visit(LogicalCalc calc) { return calc; } - public RelNode visit(LogicalProject project) { + @Override public RelNode visit(LogicalProject project) { return project; } - public RelNode visit(LogicalJoin join) { + @Override public RelNode visit(LogicalJoin join) { return join; } - public RelNode visit(LogicalCorrelate correlate) { + @Override public RelNode visit(LogicalCorrelate correlate) { return correlate; } - public RelNode visit(LogicalUnion union) { + @Override public RelNode visit(LogicalUnion union) { return union; } - public RelNode visit(LogicalIntersect intersect) { + @Override public RelNode visit(LogicalIntersect intersect) { return intersect; } - public RelNode visit(LogicalMinus minus) { + @Override public RelNode visit(LogicalMinus minus) { return minus; } - public RelNode visit(LogicalAggregate aggregate) { + @Override public RelNode visit(LogicalAggregate aggregate) { return aggregate; } - public RelNode visit(LogicalMatch match) { + @Override public RelNode visit(LogicalMatch match) { return match; } - public RelNode visit(LogicalSort sort) { + @Override public RelNode visit(LogicalSort sort) { return sort; } - public RelNode visit(LogicalExchange exchange) { + @Override public RelNode visit(LogicalExchange exchange) { return exchange; } - public RelNode visit(LogicalTableModify modify) { + @Override public RelNode visit(LogicalTableModify modify) { return modify; } - public RelNode visit(RelNode other) { + @Override public RelNode visit(RelNode other) { return other; } } 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 8221b028c1f..9cecb7a4344 100644 --- a/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java +++ b/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java @@ -164,16 +164,16 @@ public class CalcitePrepareImpl implements CalcitePrepare { public CalcitePrepareImpl() { } - public ParseResult parse( + @Override public ParseResult parse( Context context, String sql) { return parse_(context, sql, false, false, false); } - public ConvertResult convert(Context context, String sql) { + @Override public ConvertResult convert(Context context, String sql) { return (ConvertResult) parse_(context, sql, true, false, false); } - public AnalyzeViewResult analyzeView(Context context, String sql, boolean fail) { + @Override public AnalyzeViewResult analyzeView(Context context, String sql, boolean fail) { return (AnalyzeViewResult) parse_(context, sql, true, true, fail); } @@ -449,11 +449,11 @@ protected RelOptPlanner createPlanner( if (spark.enabled()) { spark.registerRules( new SparkHandler.RuleSetBuilder() { - public void addRule(RelOptRule rule) { + @Override public void addRule(RelOptRule rule) { // TODO: } - public void removeRule(RelOptRule rule) { + @Override public void removeRule(RelOptRule rule) { // TODO: } }); @@ -463,14 +463,14 @@ public void removeRule(RelOptRule rule) { return planner; } - public CalciteSignature prepareQueryable( + @Override public CalciteSignature prepareQueryable( Context context, Queryable queryable) { return prepare_(context, Query.of(queryable), queryable.getElementType(), -1); } - public CalciteSignature prepareSql( + @Override public CalciteSignature prepareSql( Context context, Query query, Type elementType, @@ -1145,15 +1145,15 @@ protected SqlValidator createSqlValidator(CatalogReader catalogReader) { root.rel, mapTableModOp(isDml, root.kind), isDml) { - public String getCode() { + @Override public String getCode() { throw new UnsupportedOperationException(); } - public Bindable getBindable(Meta.CursorFactory cursorFactory) { + @Override public Bindable getBindable(Meta.CursorFactory cursorFactory) { return bindable; } - public Type getElementType() { + @Override public Type getElementType() { return ((Typed) bindable).getElementType(); } }; @@ -1186,7 +1186,7 @@ private static class CalcitePreparedExplain extends Prepare.PreparedExplain { super(resultType, parameterRowType, root, format, detailLevel); } - public Bindable getBindable(final Meta.CursorFactory cursorFactory) { + @Override public Bindable getBindable(final Meta.CursorFactory cursorFactory) { final String explanation = getCode(); return dataContext -> { switch (cursorFactory.style) { @@ -1221,7 +1221,7 @@ public static ScalarTranslator empty(RexBuilder builder) { return new EmptyScalarTranslator(builder); } - public List toRexList(BlockStatement statement) { + @Override public List toRexList(BlockStatement statement) { final List simpleList = simpleList(statement); final List list = new ArrayList<>(); for (Expression expression1 : simpleList) { @@ -1230,7 +1230,7 @@ public List toRexList(BlockStatement statement) { return list; } - public RexNode toRex(BlockStatement statement) { + @Override public RexNode toRex(BlockStatement statement) { return toRex(Blocks.simple(statement)); } @@ -1244,7 +1244,7 @@ private static List simpleList(BlockStatement statement) { } } - public RexNode toRex(Expression expression) { + @Override public RexNode toRex(Expression expression) { switch (expression.getNodeType()) { case MemberAccess: // Case-sensitive name match because name was previously resolved. @@ -1320,7 +1320,7 @@ protected RelDataType type(Expression expression) { return ((JavaTypeFactory) rexBuilder.getTypeFactory()).createType(type); } - public ScalarTranslator bind( + @Override public ScalarTranslator bind( List parameterList, List values) { return new LambdaScalarTranslator( rexBuilder, parameterList, values); @@ -1345,7 +1345,7 @@ private static class LambdaScalarTranslator extends EmptyScalarTranslator { this.values = values; } - public RexNode parameter(ParameterExpression param) { + @Override public RexNode parameter(ParameterExpression param) { int i = parameterList.indexOf(param); if (i >= 0) { return values.get(i); diff --git a/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java b/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java index 5417a64b1b7..39e77a95f9a 100644 --- a/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java +++ b/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java @@ -146,17 +146,17 @@ private void ensure(State state) { state.from(this); } - public RelTraitSet getEmptyTraitSet() { + @Override public RelTraitSet getEmptyTraitSet() { return planner.emptyTraitSet(); } - public void close() { + @Override public void close() { open = false; typeFactory = null; state = State.STATE_0_CLOSED; } - public void reset() { + @Override public void reset() { ensure(State.STATE_0_CLOSED); open = true; state = State.STATE_1_RESET; @@ -195,7 +195,7 @@ private void ready() { } } - public SqlNode parse(final Reader reader) throws SqlParseException { + @Override public SqlNode parse(final Reader reader) throws SqlParseException { switch (state) { case STATE_0_CLOSED: case STATE_1_RESET: @@ -208,7 +208,7 @@ public SqlNode parse(final Reader reader) throws SqlParseException { return sqlNode; } - public SqlNode validate(SqlNode sqlNode) throws ValidationException { + @Override public SqlNode validate(SqlNode sqlNode) throws ValidationException { ensure(State.STATE_3_PARSED); this.validator = createSqlValidator(createCatalogReader()); try { @@ -220,7 +220,7 @@ public SqlNode validate(SqlNode sqlNode) throws ValidationException { return validatedSqlNode; } - public Pair validateAndGetType(SqlNode sqlNode) + @Override public Pair validateAndGetType(SqlNode sqlNode) throws ValidationException { final SqlNode validatedNode = this.validate(sqlNode); final RelDataType type = @@ -229,11 +229,11 @@ public Pair validateAndGetType(SqlNode sqlNode) } @SuppressWarnings("deprecation") - public final RelNode convert(SqlNode sql) { + @Override public final RelNode convert(SqlNode sql) { return rel(sql).rel; } - public RelRoot rel(SqlNode sql) { + @Override public RelRoot rel(SqlNode sql) { ensure(State.STATE_4_VALIDATED); assert validatedSqlNode != null; final RexBuilder rexBuilder = createRexBuilder(); @@ -262,7 +262,7 @@ public class ViewExpanderImpl implements ViewExpander { ViewExpanderImpl() { } - public RelRoot expandView(RelDataType rowType, String queryString, + @Override public RelRoot expandView(RelDataType rowType, String queryString, List schemaPath, List viewPath) { return PlannerImpl.this.expandView(rowType, queryString, schemaPath, viewPath); @@ -341,11 +341,11 @@ private RexBuilder createRexBuilder() { return new RexBuilder(typeFactory); } - public JavaTypeFactory getTypeFactory() { + @Override public JavaTypeFactory getTypeFactory() { return typeFactory; } - public RelNode transform(int ruleSetIndex, RelTraitSet requiredOutputTraits, + @Override public RelNode transform(int ruleSetIndex, RelTraitSet requiredOutputTraits, RelNode rel) { ensure(State.STATE_5_CONVERTED); rel.getCluster().setMetadataProvider( diff --git a/core/src/main/java/org/apache/calcite/prepare/Prepare.java b/core/src/main/java/org/apache/calcite/prepare/Prepare.java index c52b1c07abd..29a3c304695 100644 --- a/core/src/main/java/org/apache/calcite/prepare/Prepare.java +++ b/core/src/main/java/org/apache/calcite/prepare/Prepare.java @@ -382,7 +382,7 @@ private boolean shouldTrim(RelNode rootRel) { /** Interface by which validator and planner can read table metadata. */ public interface CatalogReader extends RelOptSchema, SqlValidatorCatalogReader, SqlOperatorTable { - PreparingTable getTableForMember(List names); + @Override PreparingTable getTableForMember(List names); /** Returns a catalog reader the same as this one but with a possibly * different schema path. */ @@ -403,7 +403,7 @@ public interface PreparingTable public abstract static class AbstractPreparingTable implements PreparingTable { @SuppressWarnings("deprecation") - public boolean columnHasDefaultValue(RelDataType rowType, int ordinal, + @Override public boolean columnHasDefaultValue(RelDataType rowType, int ordinal, InitializerContext initializerContext) { // This method is no longer used final Table table = this.unwrap(Table.class); @@ -422,7 +422,7 @@ public boolean columnHasDefaultValue(RelDataType rowType, int ordinal, return !rowType.getFieldList().get(ordinal).getType().isNullable(); } - public final RelOptTable extend(List extendedFields) { + @Override public final RelOptTable extend(List extendedFields) { final Table table = unwrap(Table.class); // Get the set of extended columns that do not have the same name as a column @@ -452,7 +452,7 @@ public final RelOptTable extend(List extendedFields) { * based on a {@link Table} that has been extended. */ protected abstract RelOptTable extend(Table extendedTable); - public List getColumnStrategies() { + @Override public List getColumnStrategies() { return RelOptTableImpl.columnStrategies(AbstractPreparingTable.this); } } @@ -482,7 +482,7 @@ public PreparedExplain( this.detailLevel = detailLevel; } - public String getCode() { + @Override public String getCode() { if (root == null) { return RelOptUtil.dumpType(rowType); } else { @@ -490,19 +490,19 @@ public String getCode() { } } - public RelDataType getParameterRowType() { + @Override public RelDataType getParameterRowType() { return parameterRowType; } - public boolean isDml() { + @Override public boolean isDml() { return false; } - public LogicalTableModify.Operation getTableModOp() { + @Override public LogicalTableModify.Operation getTableModOp() { return null; } - public List> getFieldOrigins() { + @Override public List> getFieldOrigins() { return Collections.singletonList( Collections.nCopies(4, null)); } @@ -580,19 +580,19 @@ public PreparedResultImpl( this.isDml = isDml; } - public boolean isDml() { + @Override public boolean isDml() { return isDml; } - public LogicalTableModify.Operation getTableModOp() { + @Override public LogicalTableModify.Operation getTableModOp() { return tableModOp; } - public List> getFieldOrigins() { + @Override public List> getFieldOrigins() { return fieldOrigins; } - public RelDataType getParameterRowType() { + @Override public RelDataType getParameterRowType() { return parameterRowType; } @@ -605,7 +605,7 @@ public RelDataType getPhysicalRowType() { return rowType; } - public abstract Type getElementType(); + @Override public abstract Type getElementType(); public RelNode getRootRel() { return rootRel; 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 96244701ec3..136ae6db1c2 100644 --- a/core/src/main/java/org/apache/calcite/prepare/QueryableRelBuilder.java +++ b/core/src/main/java/org/apache/calcite/prepare/QueryableRelBuilder.java @@ -117,7 +117,7 @@ private void setRel(RelNode rel) { // ~ Methods from QueryableFactory ----------------------------------------- - public TResult aggregate( + @Override public TResult aggregate( Queryable source, TAccumulate seed, FunctionExpression> func, @@ -125,164 +125,164 @@ public TResult aggregate( throw new UnsupportedOperationException(); } - public T aggregate( + @Override public T aggregate( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public TAccumulate aggregate( + @Override public TAccumulate aggregate( Queryable source, TAccumulate seed, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public boolean all( + @Override public boolean all( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public boolean any(Queryable source) { + @Override public boolean any(Queryable source) { throw new UnsupportedOperationException(); } - public boolean any( + @Override public boolean any( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public BigDecimal averageBigDecimal( + @Override public BigDecimal averageBigDecimal( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public BigDecimal averageNullableBigDecimal( + @Override public BigDecimal averageNullableBigDecimal( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public double averageDouble( + @Override public double averageDouble( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public Double averageNullableDouble( + @Override public Double averageNullableDouble( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public int averageInteger( + @Override public int averageInteger( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public Integer averageNullableInteger( + @Override public Integer averageNullableInteger( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public float averageFloat( + @Override public float averageFloat( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public Float averageNullableFloat( + @Override public Float averageNullableFloat( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public long averageLong( + @Override public long averageLong( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public Long averageNullableLong( + @Override public Long averageNullableLong( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public Queryable concat( + @Override public Queryable concat( Queryable source, Enumerable source2) { throw new UnsupportedOperationException(); } - public boolean contains( + @Override public boolean contains( Queryable source, T element) { throw new UnsupportedOperationException(); } - public boolean contains( + @Override public boolean contains( Queryable source, T element, EqualityComparer comparer) { throw new UnsupportedOperationException(); } - public int count(Queryable source) { + @Override public int count(Queryable source) { throw new UnsupportedOperationException(); } - public int count( + @Override public int count( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public Queryable defaultIfEmpty(Queryable source) { + @Override public Queryable defaultIfEmpty(Queryable source) { throw new UnsupportedOperationException(); } - public Queryable defaultIfEmpty(Queryable source, T value) { + @Override public Queryable defaultIfEmpty(Queryable source, T value) { throw new UnsupportedOperationException(); } - public Queryable distinct( + @Override public Queryable distinct( Queryable source) { throw new UnsupportedOperationException(); } - public Queryable distinct( + @Override public Queryable distinct( Queryable source, EqualityComparer comparer) { throw new UnsupportedOperationException(); } - public T elementAt(Queryable source, int index) { + @Override public T elementAt(Queryable source, int index) { throw new UnsupportedOperationException(); } - public T elementAtOrDefault(Queryable source, int index) { + @Override public T elementAtOrDefault(Queryable source, int index) { throw new UnsupportedOperationException(); } - public Queryable except( + @Override public Queryable except( Queryable source, Enumerable enumerable) { return except(source, enumerable, false); } - public Queryable except( + @Override public Queryable except( Queryable source, Enumerable enumerable, boolean all) { throw new UnsupportedOperationException(); } - public Queryable except( + @Override public Queryable except( Queryable source, Enumerable enumerable, EqualityComparer tEqualityComparer) { return except(source, enumerable, tEqualityComparer, false); } - public Queryable except( + @Override public Queryable except( Queryable source, Enumerable enumerable, EqualityComparer tEqualityComparer, @@ -290,48 +290,48 @@ public Queryable except( throw new UnsupportedOperationException(); } - public T first(Queryable source) { + @Override public T first(Queryable source) { throw new UnsupportedOperationException(); } - public T first( + @Override public T first( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public T firstOrDefault( + @Override public T firstOrDefault( Queryable source) { throw new UnsupportedOperationException(); } - public T firstOrDefault( + @Override public T firstOrDefault( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public Queryable> groupBy( + @Override public Queryable> groupBy( Queryable source, FunctionExpression> keySelector) { throw new UnsupportedOperationException(); } - public Queryable> groupBy( + @Override public Queryable> groupBy( Queryable source, FunctionExpression> keySelector, EqualityComparer comparer) { throw new UnsupportedOperationException(); } - public Queryable> groupBy( + @Override public Queryable> groupBy( Queryable source, FunctionExpression> keySelector, FunctionExpression> elementSelector) { throw new UnsupportedOperationException(); } - public Queryable groupByK( + @Override public Queryable groupByK( Queryable source, FunctionExpression> keySelector, FunctionExpression, TResult>> @@ -339,7 +339,7 @@ public Queryable groupByK( throw new UnsupportedOperationException(); } - public Queryable> groupBy( + @Override public Queryable> groupBy( Queryable source, FunctionExpression> keySelector, FunctionExpression> elementSelector, @@ -347,7 +347,7 @@ public Queryable> groupBy( throw new UnsupportedOperationException(); } - public Queryable groupByK( + @Override public Queryable groupByK( Queryable source, FunctionExpression> keySelector, FunctionExpression, TResult>> @@ -356,7 +356,7 @@ public Queryable groupByK( throw new UnsupportedOperationException(); } - public Queryable groupBy( + @Override public Queryable groupBy( Queryable source, FunctionExpression> keySelector, FunctionExpression> elementSelector, @@ -365,7 +365,7 @@ public Queryable groupBy( throw new UnsupportedOperationException(); } - public Queryable groupBy( + @Override public Queryable groupBy( Queryable source, FunctionExpression> keySelector, FunctionExpression> elementSelector, @@ -375,7 +375,7 @@ public Queryable groupBy( throw new UnsupportedOperationException(); } - public Queryable groupJoin( + @Override public Queryable groupJoin( Queryable source, Enumerable inner, FunctionExpression> outerKeySelector, @@ -385,7 +385,7 @@ public Queryable groupJoin( throw new UnsupportedOperationException(); } - public Queryable groupJoin( + @Override public Queryable groupJoin( Queryable source, Enumerable inner, FunctionExpression> outerKeySelector, @@ -396,31 +396,31 @@ public Queryable groupJoin( throw new UnsupportedOperationException(); } - public Queryable intersect( + @Override public Queryable intersect( Queryable source, Enumerable enumerable) { return intersect(source, enumerable, false); } - public Queryable intersect( + @Override public Queryable intersect( Queryable source, Enumerable enumerable, boolean all) { throw new UnsupportedOperationException(); } - public Queryable intersect( + @Override public Queryable intersect( Queryable source, Enumerable enumerable, EqualityComparer tEqualityComparer) { return intersect(source, enumerable, tEqualityComparer, false); } - public Queryable intersect( + @Override public Queryable intersect( Queryable source, Enumerable enumerable, EqualityComparer tEqualityComparer, boolean all) { throw new UnsupportedOperationException(); } - public Queryable join( + @Override public Queryable join( Queryable source, Enumerable inner, FunctionExpression> outerKeySelector, @@ -429,7 +429,7 @@ public Queryable join( throw new UnsupportedOperationException(); } - public Queryable join( + @Override public Queryable join( Queryable source, Enumerable inner, FunctionExpression> outerKeySelector, @@ -439,100 +439,100 @@ public Queryable join( throw new UnsupportedOperationException(); } - public T last(Queryable source) { + @Override public T last(Queryable source) { throw new UnsupportedOperationException(); } - public T last( + @Override public T last( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public T lastOrDefault( + @Override public T lastOrDefault( Queryable source) { throw new UnsupportedOperationException(); } - public T lastOrDefault( + @Override public T lastOrDefault( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public long longCount(Queryable source) { + @Override public long longCount(Queryable source) { throw new UnsupportedOperationException(); } - public long longCount( + @Override public long longCount( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public T max(Queryable source) { + @Override public T max(Queryable source) { throw new UnsupportedOperationException(); } - public > TResult max( + @Override public > TResult max( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public T min(Queryable source) { + @Override public T min(Queryable source) { throw new UnsupportedOperationException(); } - public > TResult min( + @Override public > TResult min( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public Queryable ofType( + @Override public Queryable ofType( Queryable source, Class clazz) { throw new UnsupportedOperationException(); } - public Queryable cast( + @Override public Queryable cast( Queryable source, Class clazz) { throw new UnsupportedOperationException(); } - public OrderedQueryable orderBy( + @Override public OrderedQueryable orderBy( Queryable source, FunctionExpression> keySelector) { throw new UnsupportedOperationException(); } - public OrderedQueryable orderBy( + @Override public OrderedQueryable orderBy( Queryable source, FunctionExpression> keySelector, Comparator comparator) { throw new UnsupportedOperationException(); } - public OrderedQueryable orderByDescending( + @Override public OrderedQueryable orderByDescending( Queryable source, FunctionExpression> keySelector) { throw new UnsupportedOperationException(); } - public OrderedQueryable orderByDescending( + @Override public OrderedQueryable orderByDescending( Queryable source, FunctionExpression> keySelector, Comparator comparator) { throw new UnsupportedOperationException(); } - public Queryable reverse( + @Override public Queryable reverse( Queryable source) { throw new UnsupportedOperationException(); } - public Queryable select( + @Override public Queryable select( Queryable source, FunctionExpression> selector) { RelNode child = toRel(source); @@ -542,25 +542,25 @@ public Queryable select( return null; } - public Queryable selectN( + @Override public Queryable selectN( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public Queryable selectMany( + @Override public Queryable selectMany( Queryable source, FunctionExpression>> selector) { throw new UnsupportedOperationException(); } - public Queryable selectManyN( + @Override public Queryable selectManyN( Queryable source, FunctionExpression>> selector) { throw new UnsupportedOperationException(); } - public Queryable selectMany( + @Override public Queryable selectMany( Queryable source, FunctionExpression>> collectionSelector, @@ -568,7 +568,7 @@ public Queryable selectMany( throw new UnsupportedOperationException(); } - public Queryable selectManyN( + @Override public Queryable selectManyN( Queryable source, FunctionExpression>> collectionSelector, @@ -576,171 +576,171 @@ public Queryable selectManyN( throw new UnsupportedOperationException(); } - public boolean sequenceEqual( + @Override public boolean sequenceEqual( Queryable source, Enumerable enumerable) { throw new UnsupportedOperationException(); } - public boolean sequenceEqual( + @Override public boolean sequenceEqual( Queryable source, Enumerable enumerable, EqualityComparer tEqualityComparer) { throw new UnsupportedOperationException(); } - public T single(Queryable source) { + @Override public T single(Queryable source) { throw new UnsupportedOperationException(); } - public T single( + @Override public T single( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public T singleOrDefault(Queryable source) { + @Override public T singleOrDefault(Queryable source) { throw new UnsupportedOperationException(); } - public T singleOrDefault( + @Override public T singleOrDefault( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public Queryable skip( + @Override public Queryable skip( Queryable source, int count) { throw new UnsupportedOperationException(); } - public Queryable skipWhile( + @Override public Queryable skipWhile( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public Queryable skipWhileN( + @Override public Queryable skipWhileN( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public BigDecimal sumBigDecimal( + @Override public BigDecimal sumBigDecimal( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public BigDecimal sumNullableBigDecimal( + @Override public BigDecimal sumNullableBigDecimal( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public double sumDouble( + @Override public double sumDouble( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public Double sumNullableDouble( + @Override public Double sumNullableDouble( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public int sumInteger( + @Override public int sumInteger( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public Integer sumNullableInteger( + @Override public Integer sumNullableInteger( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public long sumLong( + @Override public long sumLong( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public Long sumNullableLong( + @Override public Long sumNullableLong( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public float sumFloat( + @Override public float sumFloat( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public Float sumNullableFloat( + @Override public Float sumNullableFloat( Queryable source, FunctionExpression> selector) { throw new UnsupportedOperationException(); } - public Queryable take( + @Override public Queryable take( Queryable source, int count) { throw new UnsupportedOperationException(); } - public Queryable takeWhile( + @Override public Queryable takeWhile( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public Queryable takeWhileN( + @Override public Queryable takeWhileN( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public > OrderedQueryable thenBy( + @Override public > OrderedQueryable thenBy( OrderedQueryable source, FunctionExpression> keySelector) { throw new UnsupportedOperationException(); } - public OrderedQueryable thenBy( + @Override public OrderedQueryable thenBy( OrderedQueryable source, FunctionExpression> keySelector, Comparator comparator) { throw new UnsupportedOperationException(); } - public > OrderedQueryable thenByDescending( + @Override public > OrderedQueryable thenByDescending( OrderedQueryable source, FunctionExpression> keySelector) { throw new UnsupportedOperationException(); } - public OrderedQueryable thenByDescending( + @Override public OrderedQueryable thenByDescending( OrderedQueryable source, FunctionExpression> keySelector, Comparator comparator) { throw new UnsupportedOperationException(); } - public Queryable union( + @Override public Queryable union( Queryable source, Enumerable source1) { throw new UnsupportedOperationException(); } - public Queryable union( + @Override public Queryable union( Queryable source, Enumerable source1, EqualityComparer tEqualityComparer) { throw new UnsupportedOperationException(); } - public Queryable where( + @Override public Queryable where( Queryable source, FunctionExpression> predicate) { RelNode child = toRel(source); @@ -749,13 +749,13 @@ public Queryable where( return source; } - public Queryable whereN( + @Override public Queryable whereN( Queryable source, FunctionExpression> predicate) { throw new UnsupportedOperationException(); } - public Queryable zip( + @Override public Queryable zip( Queryable source, Enumerable source1, FunctionExpression> resultSelector) { diff --git a/core/src/main/java/org/apache/calcite/prepare/RelOptTableImpl.java b/core/src/main/java/org/apache/calcite/prepare/RelOptTableImpl.java index e5f8ded9ab4..0cf648e0372 100644 --- a/core/src/main/java/org/apache/calcite/prepare/RelOptTableImpl.java +++ b/core/src/main/java/org/apache/calcite/prepare/RelOptTableImpl.java @@ -186,7 +186,7 @@ public static RelOptTableImpl create(RelOptSchema schema, return new RelOptTableImpl(schema, rowType, names, table, null, null); } - public T unwrap(Class clazz) { + @Override public T unwrap(Class clazz) { if (clazz.isInstance(this)) { return clazz.cast(this); } @@ -207,7 +207,7 @@ public T unwrap(Class clazz) { return null; } - public Expression getExpression(Class clazz) { + @Override public Expression getExpression(Class clazz) { if (expressionFunction == null) { return null; } @@ -231,7 +231,7 @@ public Expression getExpression(Class clazz) { return (this.table == null) ? super.hashCode() : this.table.hashCode(); } - public double getRowCount() { + @Override public double getRowCount() { if (rowCount != null) { return rowCount; } @@ -244,11 +244,11 @@ public double getRowCount() { return 100d; } - public RelOptSchema getRelOptSchema() { + @Override public RelOptSchema getRelOptSchema() { return schema; } - public RelNode toRel(ToRelContext context) { + @Override public RelNode toRel(ToRelContext context) { // Make sure rowType's list is immutable. If rowType is DynamicRecordType, creates a new // RelOptTable by replacing with immutable RelRecordType using the same field list. if (this.getRowType().isDynamicStruct()) { @@ -287,43 +287,43 @@ public RelNode toRel(ToRelContext context) { return LogicalTableScan.create(context.getCluster(), this, context.getTableHints()); } - public List getCollationList() { + @Override public List getCollationList() { if (table != null) { return table.getStatistic().getCollations(); } return ImmutableList.of(); } - public RelDistribution getDistribution() { + @Override public RelDistribution getDistribution() { if (table != null) { return table.getStatistic().getDistribution(); } return RelDistributionTraitDef.INSTANCE.getDefault(); } - public boolean isKey(ImmutableBitSet columns) { + @Override public boolean isKey(ImmutableBitSet columns) { if (table != null) { return table.getStatistic().isKey(columns); } return false; } - public List getKeys() { + @Override public List getKeys() { return table.getStatistic().getKeys(); } - public List getReferentialConstraints() { + @Override public List getReferentialConstraints() { if (table != null) { return table.getStatistic().getReferentialConstraints(); } return ImmutableList.of(); } - public RelDataType getRowType() { + @Override public RelDataType getRowType() { return rowType; } - public boolean supportsModality(SqlModality modality) { + @Override public boolean supportsModality(SqlModality modality) { switch (modality) { case STREAM: return table instanceof StreamableTable; @@ -336,11 +336,11 @@ public boolean supportsModality(SqlModality modality) { return table instanceof TemporalTable; } - public List getQualifiedName() { + @Override public List getQualifiedName() { return names; } - public SqlMonotonicity getMonotonicity(String columnName) { + @Override public SqlMonotonicity getMonotonicity(String columnName) { List collations = table.getStatistic().getCollations(); if (collations == null) { return null; @@ -357,7 +357,7 @@ public SqlMonotonicity getMonotonicity(String columnName) { return SqlMonotonicity.NOT_MONOTONIC; } - public SqlAccessType getAllowedAccess() { + @Override public SqlAccessType getAllowedAccess() { return SqlAccessType.ALL; } @@ -368,11 +368,11 @@ public static List columnStrategies(final RelOptTable table) { Util.first(table.unwrap(InitializerExpressionFactory.class), NullInitializerExpressionFactory.INSTANCE); return new AbstractList() { - public int size() { + @Override public int size() { return fieldCount; } - public ColumnStrategy get(int index) { + @Override public ColumnStrategy get(int index) { return ief.generationStrategy(table, index); } }; diff --git a/core/src/main/java/org/apache/calcite/profile/Profiler.java b/core/src/main/java/org/apache/calcite/profile/Profiler.java index 7ab6988194b..cd389854eaa 100644 --- a/core/src/main/java/org/apache/calcite/profile/Profiler.java +++ b/core/src/main/java/org/apache/calcite/profile/Profiler.java @@ -109,7 +109,7 @@ public RowCount(int rowCount) { this.rowCount = rowCount; } - public Object toMap(JsonBuilder jsonBuilder) { + @Override public Object toMap(JsonBuilder jsonBuilder) { final Map map = jsonBuilder.map(); map.put("type", "rowCount"); map.put("rowCount", rowCount); @@ -125,7 +125,7 @@ public Unique(SortedSet columns) { this.columns = ImmutableSortedSet.copyOf(columns); } - public Object toMap(JsonBuilder jsonBuilder) { + @Override public Object toMap(JsonBuilder jsonBuilder) { final Map map = jsonBuilder.map(); map.put("type", "unique"); map.put("columns", FunctionalDependency.getObjects(jsonBuilder, columns)); @@ -143,7 +143,7 @@ class FunctionalDependency implements Statistic { this.dependentColumn = dependentColumn; } - public Object toMap(JsonBuilder jsonBuilder) { + @Override public Object toMap(JsonBuilder jsonBuilder) { final Map map = jsonBuilder.map(); map.put("type", "fd"); map.put("columns", getObjects(jsonBuilder, columns)); @@ -199,7 +199,7 @@ public Distribution(SortedSet columns, SortedSet values, this.minimal = minimal; } - public Object toMap(JsonBuilder jsonBuilder) { + @Override public Object toMap(JsonBuilder jsonBuilder) { final Map map = jsonBuilder.map(); map.put("type", "distribution"); map.put("columns", FunctionalDependency.getObjects(jsonBuilder, columns)); diff --git a/core/src/main/java/org/apache/calcite/profile/ProfilerImpl.java b/core/src/main/java/org/apache/calcite/profile/ProfilerImpl.java index e276e620ceb..3f7cf107184 100644 --- a/core/src/main/java/org/apache/calcite/profile/ProfilerImpl.java +++ b/core/src/main/java/org/apache/calcite/profile/ProfilerImpl.java @@ -97,7 +97,7 @@ public static Builder builder() { this.predicate = predicate; } - public Profile profile(Iterable> rows, + @Override public Profile profile(Iterable> rows, final List columns, Collection initialGroups) { return new Run(columns, initialGroups).profile(rows); } @@ -543,7 +543,7 @@ static class SingletonCollector extends Collector { this.sketchThreshold = sketchThreshold; } - public void add(List row) { + @Override public void add(List row) { final Comparable v = row.get(columnOrdinal); if (v == NullSentinel.INSTANCE) { nullCount++; @@ -560,7 +560,7 @@ public void add(List row) { } } - public void finish() { + @Override public void finish() { space.nullCount = nullCount; space.cardinality = values.size() + (nullCount > 0 ? 1 : 0); space.valueSet = values.size() < 20 ? values : null; @@ -583,7 +583,7 @@ static class CompositeCollector extends Collector { this.sketchThreshold = sketchThreshold; } - public void add(List row) { + @Override public void add(List row) { if (space.columnOrdinals.equals(OF)) { Util.discard(0); } @@ -619,7 +619,7 @@ public void add(List row) { } } - public void finish() { + @Override public void finish() { // number of input rows (not distinct values) // that were null or partially null space.nullCount = nullCount; @@ -660,7 +660,7 @@ protected void add(Comparable value) { } } - public void finish() { + @Override public void finish() { space.nullCount = nullCount; space.cardinality = (int) sketch.getEstimate(); space.valueSet = null; @@ -676,7 +676,7 @@ static class HllSingletonCollector extends HllCollector { this.columnOrdinal = columnOrdinal; } - public void add(List row) { + @Override public void add(List row) { final Comparable value = row.get(columnOrdinal); if (value == NullSentinel.INSTANCE) { nullCount++; @@ -698,7 +698,7 @@ static class HllCompositeCollector extends HllCollector { this.columnOrdinals = columnOrdinals; } - public void add(List row) { + @Override public void add(List row) { if (space.columnOrdinals.equals(OF)) { Util.discard(0); } diff --git a/core/src/main/java/org/apache/calcite/profile/SimpleProfiler.java b/core/src/main/java/org/apache/calcite/profile/SimpleProfiler.java index a251714389f..725a40d9fe7 100644 --- a/core/src/main/java/org/apache/calcite/profile/SimpleProfiler.java +++ b/core/src/main/java/org/apache/calcite/profile/SimpleProfiler.java @@ -45,7 +45,7 @@ */ public class SimpleProfiler implements Profiler { - public Profile profile(Iterable> rows, + @Override public Profile profile(Iterable> rows, final List columns, Collection initialGroups) { Util.discard(initialGroups); // this profiler ignores initial groups return new Run(columns).profile(rows); @@ -309,7 +309,7 @@ static class Space implements Comparable { && columnOrdinals.equals(((Space) o).columnOrdinals); } - public int compareTo(@Nonnull Space o) { + @Override public int compareTo(@Nonnull Space o) { return columnOrdinals.equals(o.columnOrdinals) ? 0 : columnOrdinals.contains(o.columnOrdinals) ? 1 : -1; 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 206503de3df..0b8dccc1ac5 100644 --- a/core/src/main/java/org/apache/calcite/rel/AbstractRelNode.java +++ b/core/src/main/java/org/apache/calcite/rel/AbstractRelNode.java @@ -98,7 +98,7 @@ public AbstractRelNode(RelOptCluster cluster, RelTraitSet traitSet) { //~ Methods ---------------------------------------------------------------- - public RelNode copy(RelTraitSet traitSet, List inputs) { + @Override public RelNode copy(RelTraitSet traitSet, List inputs) { // Note that empty set equals empty set, so relational expressions // with zero inputs do not generally need to implement their own copy // method. @@ -118,37 +118,37 @@ protected static T sole(List collection) { return collection.get(0); } - public final RelOptCluster getCluster() { + @Override public final RelOptCluster getCluster() { return cluster; } - public final Convention getConvention() { + @Override public final Convention getConvention() { return traitSet.getTrait(ConventionTraitDef.INSTANCE); } - public RelTraitSet getTraitSet() { + @Override public RelTraitSet getTraitSet() { return traitSet; } - public String getCorrelVariable() { + @Override public String getCorrelVariable() { return null; } - public int getId() { + @Override public int getId() { return id; } - public RelNode getInput(int i) { + @Override public RelNode getInput(int i) { List inputs = getInputs(); return inputs.get(i); } - public void register(RelOptPlanner planner) { + @Override public void register(RelOptPlanner planner) { Util.discard(planner); } // It is not recommended to override this method, but sub-classes can do it at their own risk. - public String getRelTypeName() { + @Override public String getRelTypeName() { String cn = getClass().getName(); int i = cn.length(); while (--i >= 0) { @@ -159,11 +159,11 @@ public String getRelTypeName() { return cn; } - public boolean isValid(Litmus litmus, Context context) { + @Override public boolean isValid(Litmus litmus, Context context) { return litmus.succeed(); } - public final RelDataType getRowType() { + @Override public final RelDataType getRowType() { if (rowType == null) { rowType = deriveRowType(); assert rowType != null : this; @@ -177,58 +177,58 @@ protected RelDataType deriveRowType() { throw new UnsupportedOperationException(); } - public RelDataType getExpectedInputRowType(int ordinalInParent) { + @Override public RelDataType getExpectedInputRowType(int ordinalInParent) { return getRowType(); } - public List getInputs() { + @Override public List getInputs() { return Collections.emptyList(); } - public double estimateRowCount(RelMetadataQuery mq) { + @Override public double estimateRowCount(RelMetadataQuery mq) { return 1.0; } - public Set getVariablesSet() { + @Override public Set getVariablesSet() { return ImmutableSet.of(); } - public void collectVariablesUsed(Set variableSet) { + @Override public void collectVariablesUsed(Set variableSet) { // for default case, nothing to do } - public boolean isEnforcer() { + @Override public boolean isEnforcer() { return false; } - public void collectVariablesSet(Set variableSet) { + @Override public void collectVariablesSet(Set variableSet) { } - public void childrenAccept(RelVisitor visitor) { + @Override public void childrenAccept(RelVisitor visitor) { List inputs = getInputs(); for (int i = 0; i < inputs.size(); i++) { visitor.visit(inputs.get(i), i, this); } } - public RelNode accept(RelShuttle shuttle) { + @Override public RelNode accept(RelShuttle shuttle) { // Call fall-back method. Specific logical types (such as LogicalProject // and LogicalJoin) have their own RelShuttle.visit methods. return shuttle.visit(this); } - public RelNode accept(RexShuttle shuttle) { + @Override public RelNode accept(RexShuttle shuttle) { return this; } - public RelOptCost computeSelfCost(RelOptPlanner planner, + @Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { // by default, assume cost is proportional to number of rows double rowCount = mq.getRowCount(this); return planner.getCostFactory().makeCost(rowCount, rowCount, 0); } - public final M metadata(Class metadataClass, + @Override public final M metadata(Class metadataClass, RelMetadataQuery mq) { final MetadataFactory factory = cluster.getMetadataFactory(); final M metadata = factory.query(this, mq, metadataClass); @@ -242,7 +242,7 @@ public final M metadata(Class metadataClass, return metadata; } - public void explain(RelWriter pw) { + @Override public void explain(RelWriter pw) { explainTerms(pw).done(this); } @@ -261,7 +261,7 @@ public RelWriter explainTerms(RelWriter pw) { return pw; } - public RelNode onRegister(RelOptPlanner planner) { + @Override public RelNode onRegister(RelOptPlanner planner) { List oldInputs = getInputs(); List inputs = new ArrayList<>(oldInputs.size()); for (final RelNode input : oldInputs) { @@ -282,35 +282,35 @@ public RelNode onRegister(RelOptPlanner planner) { return r; } - public void recomputeDigest() { + @Override public void recomputeDigest() { digest.clear(); } - public void replaceInput( + @Override public void replaceInput( int ordinalInParent, RelNode p) { throw new UnsupportedOperationException("replaceInput called on " + this); } /** Description; consists of id plus digest. */ - public String toString() { + @Override public String toString() { return "rel#" + id + ':' + getDigest(); } @Deprecated // to be removed before 2.0 - public final String getDescription() { + @Override public final String getDescription() { return this.toString(); } - public String getDigest() { + @Override public String getDigest() { return digest.toString(); } - public final RelDigest getRelDigest() { + @Override public final RelDigest getRelDigest() { return digest; } - public RelOptTable getTable() { + @Override public RelOptTable getTable() { return null; } @@ -349,7 +349,7 @@ public RelOptTable getTable() { * @return Whether the 2 RelNodes are equivalent or have the same digest. * @see #deepHashCode() */ - @API(since = "1.25", status = API.Status.MAINTAINED) + @Override @API(since = "1.25", status = API.Status.MAINTAINED) public boolean deepEquals(Object obj) { if (this == obj) { return true; @@ -386,7 +386,7 @@ public boolean deepEquals(Object obj) { * @see #deepEquals(Object) */ @API(since = "1.25", status = API.Status.MAINTAINED) - public int deepHashCode() { + @Override public int deepHashCode() { int result = 31 + getTraitSet().hashCode(); List> items = this.getDigestItems(); for (Pair item : items) { diff --git a/core/src/main/java/org/apache/calcite/rel/BiRel.java b/core/src/main/java/org/apache/calcite/rel/BiRel.java index baafd46332c..2c12a21156a 100644 --- a/core/src/main/java/org/apache/calcite/rel/BiRel.java +++ b/core/src/main/java/org/apache/calcite/rel/BiRel.java @@ -41,12 +41,12 @@ public BiRel( this.right = right; } - public void childrenAccept(RelVisitor visitor) { + @Override public void childrenAccept(RelVisitor visitor) { visitor.visit(left, 0, this); visitor.visit(right, 1, this); } - public List getInputs() { + @Override public List getInputs() { return FlatLists.of(left, right); } @@ -58,7 +58,7 @@ public RelNode getRight() { return right; } - public void replaceInput( + @Override public void replaceInput( int ordinalInParent, RelNode p) { switch (ordinalInParent) { diff --git a/core/src/main/java/org/apache/calcite/rel/RelCollationImpl.java b/core/src/main/java/org/apache/calcite/rel/RelCollationImpl.java index f06c84c1cd6..3853f46b0d1 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelCollationImpl.java +++ b/core/src/main/java/org/apache/calcite/rel/RelCollationImpl.java @@ -71,19 +71,19 @@ public static RelCollation of(List fieldCollations) { //~ Methods ---------------------------------------------------------------- - public RelTraitDef getTraitDef() { + @Override public RelTraitDef getTraitDef() { return RelCollationTraitDef.INSTANCE; } - public List getFieldCollations() { + @Override public List getFieldCollations() { return fieldCollations; } - public int hashCode() { + @Override public int hashCode() { return fieldCollations.hashCode(); } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { if (this == obj) { return true; } @@ -94,11 +94,11 @@ public boolean equals(Object obj) { return false; } - public boolean isTop() { + @Override public boolean isTop() { return fieldCollations.isEmpty(); } - public int compareTo(@Nonnull RelMultipleTrait o) { + @Override public int compareTo(@Nonnull RelMultipleTrait o) { final RelCollationImpl that = (RelCollationImpl) o; final UnmodifiableIterator iterator = that.fieldCollations.iterator(); @@ -115,7 +115,7 @@ public int compareTo(@Nonnull RelMultipleTrait o) { return iterator.hasNext() ? -1 : 0; } - public void register(RelOptPlanner planner) {} + @Override public void register(RelOptPlanner planner) {} /** * Applies mapping to a given collation. @@ -140,7 +140,7 @@ public void register(RelOptPlanner planner) {} return (RelCollationImpl) RexUtil.apply(mapping, this); } - public boolean satisfies(RelTrait trait) { + @Override public boolean satisfies(RelTrait trait) { return this == trait || trait instanceof RelCollationImpl && Util.startsWith(fieldCollations, @@ -150,7 +150,7 @@ public boolean satisfies(RelTrait trait) { /** Returns a string representation of this collation, suitably terse given * that it will appear in plan traces. Examples: * "[]", "[2]", "[0 DESC, 1]", "[0 DESC, 1 ASC NULLS LAST]". */ - public String toString() { + @Override public String toString() { Iterator it = fieldCollations.iterator(); if (! it.hasNext()) { return "[]"; 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 bab96ab019e..ad6d9fa2d7a 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelCollationTraitDef.java +++ b/core/src/main/java/org/apache/calcite/rel/RelCollationTraitDef.java @@ -43,11 +43,11 @@ public class RelCollationTraitDef extends RelTraitDef { private RelCollationTraitDef() { } - public Class getTraitClass() { + @Override public Class getTraitClass() { return RelCollation.class; } - public String getSimpleName() { + @Override public String getSimpleName() { return "sort"; } @@ -55,11 +55,11 @@ public String getSimpleName() { return true; } - public RelCollation getDefault() { + @Override public RelCollation getDefault() { return RelCollations.EMPTY; } - public RelNode convert( + @Override public RelNode convert( RelOptPlanner planner, RelNode rel, RelCollation toCollation, @@ -81,7 +81,7 @@ public RelNode convert( return newRel; } - public boolean canConvert( + @Override public boolean canConvert( RelOptPlanner planner, RelCollation fromTrait, RelCollation toTrait) { return true; } diff --git a/core/src/main/java/org/apache/calcite/rel/RelCollations.java b/core/src/main/java/org/apache/calcite/rel/RelCollations.java index ed522780444..8071f7f645d 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelCollations.java +++ b/core/src/main/java/org/apache/calcite/rel/RelCollations.java @@ -53,7 +53,7 @@ public class RelCollations { RelCollationTraitDef.INSTANCE.canonize( new RelCollationImpl( ImmutableList.of(new RelFieldCollation(-1))) { - public String toString() { + @Override public String toString() { return "PRESERVE"; } }); 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 cf2dc035259..cc4d96b39f6 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelDistribution.java +++ b/core/src/main/java/org/apache/calcite/rel/RelDistribution.java @@ -66,7 +66,7 @@ public interface RelDistribution extends RelMultipleTrait { * @param mapping Mapping * @return distribution with mapping applied */ - RelDistribution apply(Mappings.TargetMapping mapping); + @Override RelDistribution apply(Mappings.TargetMapping mapping); /** Type of distribution. */ enum Type { diff --git a/core/src/main/java/org/apache/calcite/rel/RelDistributionTraitDef.java b/core/src/main/java/org/apache/calcite/rel/RelDistributionTraitDef.java index 72dd253f736..1582e32e66f 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelDistributionTraitDef.java +++ b/core/src/main/java/org/apache/calcite/rel/RelDistributionTraitDef.java @@ -36,19 +36,19 @@ public class RelDistributionTraitDef extends RelTraitDef { private RelDistributionTraitDef() { } - public Class getTraitClass() { + @Override public Class getTraitClass() { return RelDistribution.class; } - public String getSimpleName() { + @Override public String getSimpleName() { return "dist"; } - public RelDistribution getDefault() { + @Override public RelDistribution getDefault() { return RelDistributions.ANY; } - public RelNode convert(RelOptPlanner planner, RelNode rel, + @Override public RelNode convert(RelOptPlanner planner, RelNode rel, RelDistribution toDistribution, boolean allowInfiniteCostConverters) { if (toDistribution == RelDistributions.ANY) { return rel; @@ -66,7 +66,7 @@ public RelNode convert(RelOptPlanner planner, RelNode rel, return newRel; } - public boolean canConvert(RelOptPlanner planner, RelDistribution fromTrait, + @Override public boolean canConvert(RelOptPlanner planner, RelDistribution fromTrait, RelDistribution toTrait) { return true; } diff --git a/core/src/main/java/org/apache/calcite/rel/RelDistributions.java b/core/src/main/java/org/apache/calcite/rel/RelDistributions.java index 9b7b10eb9c0..05f55392c04 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelDistributions.java +++ b/core/src/main/java/org/apache/calcite/rel/RelDistributions.java @@ -125,19 +125,19 @@ private RelDistributionImpl(Type type, ImmutableIntList keys) { } } - @Nonnull public Type getType() { + @Override @Nonnull public Type getType() { return type; } - @Nonnull public List getKeys() { + @Override @Nonnull public List getKeys() { return keys; } - public RelDistributionTraitDef getTraitDef() { + @Override public RelDistributionTraitDef getTraitDef() { return RelDistributionTraitDef.INSTANCE; } - public RelDistribution apply(Mappings.TargetMapping mapping) { + @Override public RelDistribution apply(Mappings.TargetMapping mapping) { if (keys.isEmpty()) { return this; } @@ -151,7 +151,7 @@ public RelDistribution apply(Mappings.TargetMapping mapping) { return of(type, mappedKeys); } - public boolean satisfies(RelTrait trait) { + @Override public boolean satisfies(RelTrait trait) { if (trait == this || trait == ANY) { return true; } @@ -181,7 +181,7 @@ public boolean satisfies(RelTrait trait) { return false; } - public void register(RelOptPlanner planner) { + @Override public void register(RelOptPlanner planner) { } @Override public boolean isTop() { diff --git a/core/src/main/java/org/apache/calcite/rel/RelFieldCollation.java b/core/src/main/java/org/apache/calcite/rel/RelFieldCollation.java index 38ecccef9a4..37a956027c9 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelFieldCollation.java +++ b/core/src/main/java/org/apache/calcite/rel/RelFieldCollation.java @@ -268,7 +268,7 @@ public RelFieldCollation.Direction getDirection() { return direction; } - public String toString() { + @Override public String toString() { if (direction == Direction.ASCENDING && nullDirection == direction.defaultNullDirection()) { return String.valueOf(fieldIndex); 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 bd865f6b355..284052f3520 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelNode.java +++ b/core/src/main/java/org/apache/calcite/rel/RelNode.java @@ -109,7 +109,7 @@ public interface RelNode extends RelOptNode, Cloneable { /** * Returns the type of the rows returned by this relational expression. */ - RelDataType getRowType(); + @Override RelDataType getRowType(); /** * Returns the type of the rows expected for an input. Defaults to @@ -127,7 +127,7 @@ public interface RelNode extends RelOptNode, Cloneable { * * @return Array of this relational expression's inputs */ - List getInputs(); + @Override List getInputs(); /** * Returns an estimate of the number of rows this relational expression will @@ -259,7 +259,7 @@ default String explain() { * * @see #getRelDigest() */ - default String getDigest() { + @Override default String getDigest() { return getRelDigest().toString(); } diff --git a/core/src/main/java/org/apache/calcite/rel/RelNodes.java b/core/src/main/java/org/apache/calcite/rel/RelNodes.java index a7d98c4b077..dab3b5e5f63 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelNodes.java +++ b/core/src/main/java/org/apache/calcite/rel/RelNodes.java @@ -53,7 +53,7 @@ public static int compareRels(RelNode[] rels0, RelNode[] rels1) { /** Arbitrary stable comparator for {@link RelNode}s. */ private static class RelNodeComparator implements Comparator { - public int compare(RelNode o1, RelNode o2) { + @Override public int compare(RelNode o1, RelNode o2) { // Compare on field count first. It is more stable than id (when rules // are added to the set of active rules). final int c = Utilities.compare(o1.getRowType().getFieldCount(), diff --git a/core/src/main/java/org/apache/calcite/rel/RelShuttleImpl.java b/core/src/main/java/org/apache/calcite/rel/RelShuttleImpl.java index 9b622df8ab1..35b4aa28eb1 100644 --- a/core/src/main/java/org/apache/calcite/rel/RelShuttleImpl.java +++ b/core/src/main/java/org/apache/calcite/rel/RelShuttleImpl.java @@ -73,71 +73,71 @@ protected RelNode visitChildren(RelNode rel) { return rel; } - public RelNode visit(LogicalAggregate aggregate) { + @Override public RelNode visit(LogicalAggregate aggregate) { return visitChild(aggregate, 0, aggregate.getInput()); } - public RelNode visit(LogicalMatch match) { + @Override public RelNode visit(LogicalMatch match) { return visitChild(match, 0, match.getInput()); } - public RelNode visit(TableScan scan) { + @Override public RelNode visit(TableScan scan) { return scan; } - public RelNode visit(TableFunctionScan scan) { + @Override public RelNode visit(TableFunctionScan scan) { return visitChildren(scan); } - public RelNode visit(LogicalValues values) { + @Override public RelNode visit(LogicalValues values) { return values; } - public RelNode visit(LogicalFilter filter) { + @Override public RelNode visit(LogicalFilter filter) { return visitChild(filter, 0, filter.getInput()); } - public RelNode visit(LogicalCalc calc) { + @Override public RelNode visit(LogicalCalc calc) { return visitChildren(calc); } - public RelNode visit(LogicalProject project) { + @Override public RelNode visit(LogicalProject project) { return visitChild(project, 0, project.getInput()); } - public RelNode visit(LogicalJoin join) { + @Override public RelNode visit(LogicalJoin join) { return visitChildren(join); } - public RelNode visit(LogicalCorrelate correlate) { + @Override public RelNode visit(LogicalCorrelate correlate) { return visitChildren(correlate); } - public RelNode visit(LogicalUnion union) { + @Override public RelNode visit(LogicalUnion union) { return visitChildren(union); } - public RelNode visit(LogicalIntersect intersect) { + @Override public RelNode visit(LogicalIntersect intersect) { return visitChildren(intersect); } - public RelNode visit(LogicalMinus minus) { + @Override public RelNode visit(LogicalMinus minus) { return visitChildren(minus); } - public RelNode visit(LogicalSort sort) { + @Override public RelNode visit(LogicalSort sort) { return visitChildren(sort); } - public RelNode visit(LogicalExchange exchange) { + @Override public RelNode visit(LogicalExchange exchange) { return visitChildren(exchange); } - public RelNode visit(LogicalTableModify modify) { + @Override public RelNode visit(LogicalTableModify modify) { return visitChildren(modify); } - public RelNode visit(RelNode other) { + @Override public RelNode visit(RelNode other) { return visitChildren(other); } } diff --git a/core/src/main/java/org/apache/calcite/rel/SingleRel.java b/core/src/main/java/org/apache/calcite/rel/SingleRel.java index ef06c96e39b..403d5c1fa06 100644 --- a/core/src/main/java/org/apache/calcite/rel/SingleRel.java +++ b/core/src/main/java/org/apache/calcite/rel/SingleRel.java @@ -72,7 +72,7 @@ public RelNode getInput() { visitor.visit(input, 0, this); } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { return super.explainTerms(pw) .input("input", getInput()); } @@ -85,7 +85,7 @@ public RelWriter explainTerms(RelWriter pw) { recomputeDigest(); } - protected RelDataType deriveRowType() { + @Override protected RelDataType deriveRowType() { return input.getRowType(); } } diff --git a/core/src/main/java/org/apache/calcite/rel/convert/ConverterImpl.java b/core/src/main/java/org/apache/calcite/rel/convert/ConverterImpl.java index 310cf629073..b542b962087 100644 --- a/core/src/main/java/org/apache/calcite/rel/convert/ConverterImpl.java +++ b/core/src/main/java/org/apache/calcite/rel/convert/ConverterImpl.java @@ -71,11 +71,11 @@ protected Error cannotImplement() { + inTraits + " traits"); } - public RelTraitSet getInputTraits() { + @Override public RelTraitSet getInputTraits() { return inTraits; } - public RelTraitDef getTraitDef() { + @Override public RelTraitDef getTraitDef() { return traitDef; } 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 0d78259110a..45ac09f7697 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 @@ -124,7 +124,7 @@ public ConverterRule(Class clazz, return (Convention) outTrait; } - public RelTrait getOutTrait() { + @Override public RelTrait getOutTrait() { return outTrait; } diff --git a/core/src/main/java/org/apache/calcite/rel/convert/NoneConverter.java b/core/src/main/java/org/apache/calcite/rel/convert/NoneConverter.java index 8f08a913a1e..70e89a2ce1f 100644 --- a/core/src/main/java/org/apache/calcite/rel/convert/NoneConverter.java +++ b/core/src/main/java/org/apache/calcite/rel/convert/NoneConverter.java @@ -46,7 +46,7 @@ public NoneConverter( //~ Methods ---------------------------------------------------------------- - public RelNode copy(RelTraitSet traitSet, List inputs) { + @Override public RelNode copy(RelTraitSet traitSet, List inputs) { assert traitSet.comprises(Convention.NONE); return new NoneConverter( getCluster(), diff --git a/core/src/main/java/org/apache/calcite/rel/core/Aggregate.java b/core/src/main/java/org/apache/calcite/rel/core/Aggregate.java index 634e0fbeeff..f728a523a5f 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/Aggregate.java +++ b/core/src/main/java/org/apache/calcite/rel/core/Aggregate.java @@ -318,7 +318,7 @@ public ImmutableList getGroupSets() { return groupSets; } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { // We skip the "groups" element if it is a singleton of "group". super.explainTerms(pw) .item("group", groupSet) @@ -364,7 +364,7 @@ public RelWriter explainTerms(RelWriter pw) { return planner.getCostFactory().makeCost(rowCount * multiplier, 0, 0); } - protected RelDataType deriveRowType() { + @Override protected RelDataType deriveRowType() { return deriveRowType(getCluster().getTypeFactory(), getInput().getRowType(), false, groupSet, groupSets, aggCalls); } @@ -416,7 +416,7 @@ public static RelDataType deriveRowType(RelDataTypeFactory typeFactory, return builder.build(); } - public boolean isValid(Litmus litmus, Context context) { + @Override public boolean isValid(Litmus litmus, Context context) { return super.isValid(litmus, context) && litmus.check(Util.isDistinct(getRowType().getFieldNames()), "distinct field names: {}", getRowType()); @@ -600,15 +600,15 @@ public AggCallBinding(RelDataTypeFactory typeFactory, return filter; } - public int getOperandCount() { + @Override public int getOperandCount() { return operands.size(); } - public RelDataType getOperandType(int ordinal) { + @Override public RelDataType getOperandType(int ordinal) { return operands.get(ordinal); } - public CalciteException newError( + @Override public CalciteException newError( Resources.ExInst e) { return SqlUtil.newContextException(SqlParserPos.ZERO, e); } diff --git a/core/src/main/java/org/apache/calcite/rel/core/AggregateCall.java b/core/src/main/java/org/apache/calcite/rel/core/AggregateCall.java index 8880389f4a2..2eed5d7c484 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/AggregateCall.java +++ b/core/src/main/java/org/apache/calcite/rel/core/AggregateCall.java @@ -291,7 +291,7 @@ public AggregateCall rename(String name) { name); } - public String toString() { + @Override public String toString() { StringBuilder buf = new StringBuilder(aggFunction.toString()); buf.append("("); if (approximate) { diff --git a/core/src/main/java/org/apache/calcite/rel/core/Calc.java b/core/src/main/java/org/apache/calcite/rel/core/Calc.java index 4f1f208cee7..a85853ab307 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/Calc.java +++ b/core/src/main/java/org/apache/calcite/rel/core/Calc.java @@ -136,7 +136,7 @@ public final boolean containsOver() { return RexOver.containsOver(program); } - public boolean isValid(Litmus litmus, Context context) { + @Override public boolean isValid(Litmus litmus, Context context) { if (!RelOptUtil.equal( "program's input type", program.getInputRowType(), @@ -174,11 +174,11 @@ public RexProgram getProgram() { return planner.getCostFactory().makeCost(dRows, dCpu, dIo); } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { return program.explainCalc(super.explainTerms(pw)); } - public RelNode accept(RexShuttle shuttle) { + @Override public RelNode accept(RexShuttle shuttle) { List oldExprs = program.getExprList(); List exprs = shuttle.apply(oldExprs); List oldProjects = program.getProjectList(); diff --git a/core/src/main/java/org/apache/calcite/rel/core/CorrelationId.java b/core/src/main/java/org/apache/calcite/rel/core/CorrelationId.java index 11be21b632b..f34f216052e 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/CorrelationId.java +++ b/core/src/main/java/org/apache/calcite/rel/core/CorrelationId.java @@ -81,11 +81,11 @@ public String getName() { return name; } - public String toString() { + @Override public String toString() { return name; } - public int compareTo(CorrelationId other) { + @Override public int compareTo(CorrelationId other) { return id - other.id; } diff --git a/core/src/main/java/org/apache/calcite/rel/core/Exchange.java b/core/src/main/java/org/apache/calcite/rel/core/Exchange.java index 79999bd8ac7..31f94a3c30e 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/Exchange.java +++ b/core/src/main/java/org/apache/calcite/rel/core/Exchange.java @@ -98,7 +98,7 @@ public RelDistribution getDistribution() { Util.nLogN(rowCount) * bytesPerRow, rowCount, 0); } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { return super.explainTerms(pw) .item("distribution", distribution); } 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 e3ba20aa19d..ef4d9276198 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 @@ -97,7 +97,7 @@ protected Filter(RelInput input) { public abstract Filter copy(RelTraitSet traitSet, RelNode input, RexNode condition); - public RelNode accept(RexShuttle shuttle) { + @Override public RelNode accept(RexShuttle shuttle) { RexNode condition = shuttle.apply(this.condition); if (this.condition == condition) { return this; @@ -151,7 +151,7 @@ public static double estimateFilteredRows(RelNode child, RexNode condition) { return RelMdUtil.estimateFilteredRows(child, condition, mq); } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { return super.explainTerms(pw) .item("condition", condition); } diff --git a/core/src/main/java/org/apache/calcite/rel/core/Project.java b/core/src/main/java/org/apache/calcite/rel/core/Project.java index 51e8271e5a7..053a36721e6 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/Project.java +++ b/core/src/main/java/org/apache/calcite/rel/core/Project.java @@ -153,7 +153,7 @@ public boolean isBoxed() { return true; } - public RelNode accept(RexShuttle shuttle) { + @Override public RelNode accept(RexShuttle shuttle) { List exps = shuttle.apply(this.exps); if (this.exps == exps) { return this; @@ -200,7 +200,7 @@ public final boolean containsOver() { return RexOver.containsOver(getProjects(), null); } - public boolean isValid(Litmus litmus, Context context) { + @Override public boolean isValid(Litmus litmus, Context context) { if (!super.isValid(litmus, context)) { return litmus.fail(null); } @@ -259,7 +259,7 @@ private static int countTrivial(List refs) { return refs.size(); } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { super.explainTerms(pw); // Skip writing field names so the optimizer can reuse the projects that differ in // field names only diff --git a/core/src/main/java/org/apache/calcite/rel/core/RelFactories.java b/core/src/main/java/org/apache/calcite/rel/core/RelFactories.java index 62a133c7f46..18b0a78f6ec 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/RelFactories.java +++ b/core/src/main/java/org/apache/calcite/rel/core/RelFactories.java @@ -172,7 +172,7 @@ RelNode createProject(RelNode input, List hints, * {@link org.apache.calcite.rel.logical.LogicalProject}. */ private static class ProjectFactoryImpl implements ProjectFactory { - public RelNode createProject(RelNode input, List hints, + @Override public RelNode createProject(RelNode input, List hints, List childExprs, List fieldNames) { return LogicalProject.create(input, hints, childExprs, fieldNames); } @@ -199,7 +199,7 @@ default RelNode createSort(RelTraitSet traitSet, RelNode input, * returns a vanilla {@link Sort}. */ private static class SortFactoryImpl implements SortFactory { - public RelNode createSort(RelNode input, RelCollation collation, + @Override public RelNode createSort(RelNode input, RelCollation collation, RexNode offset, RexNode fetch) { return LogicalSort.create(input, collation, offset, fetch); } @@ -270,7 +270,7 @@ public interface SetOpFactory { * operation (UNION, EXCEPT, INTERSECT). */ private static class SetOpFactoryImpl implements SetOpFactory { - public RelNode createSetOp(SqlKind kind, List inputs, + @Override public RelNode createSetOp(SqlKind kind, List inputs, boolean all) { switch (kind) { case UNION: @@ -300,7 +300,7 @@ RelNode createAggregate(RelNode input, List hints, ImmutableBitSet grou * that returns a vanilla {@link LogicalAggregate}. */ private static class AggregateFactoryImpl implements AggregateFactory { - public RelNode createAggregate(RelNode input, List hints, + @Override public RelNode createAggregate(RelNode input, List hints, ImmutableBitSet groupSet, ImmutableList groupSets, List aggCalls) { return LogicalAggregate.create(input, hints, groupSet, groupSets, aggCalls); @@ -339,7 +339,7 @@ default RelNode createFilter(RelNode input, RexNode condition) { * returns a vanilla {@link LogicalFilter}. */ private static class FilterFactoryImpl implements FilterFactory { - public RelNode createFilter(RelNode input, RexNode condition, + @Override public RelNode createFilter(RelNode input, RexNode condition, Set variablesSet) { return LogicalFilter.create(input, condition, ImmutableSet.copyOf(variablesSet)); @@ -376,7 +376,7 @@ RelNode createJoin(RelNode left, RelNode right, List hints, * {@link org.apache.calcite.rel.logical.LogicalJoin}. */ private static class JoinFactoryImpl implements JoinFactory { - public RelNode createJoin(RelNode left, RelNode right, List hints, + @Override public RelNode createJoin(RelNode left, RelNode right, List hints, RexNode condition, Set variablesSet, JoinRelType joinType, boolean semiJoinDone) { return LogicalJoin.create(left, right, hints, condition, variablesSet, joinType, @@ -410,7 +410,7 @@ RelNode createCorrelate(RelNode left, RelNode right, * {@link org.apache.calcite.rel.logical.LogicalCorrelate}. */ private static class CorrelateFactoryImpl implements CorrelateFactory { - public RelNode createCorrelate(RelNode left, RelNode right, + @Override public RelNode createCorrelate(RelNode left, RelNode right, CorrelationId correlationId, ImmutableBitSet requiredColumns, JoinRelType joinType) { return LogicalCorrelate.create(left, right, correlationId, @@ -444,7 +444,7 @@ public interface SemiJoinFactory { */ @Deprecated // to be removed before 2.0 private static class SemiJoinFactoryImpl implements SemiJoinFactory { - public RelNode createSemiJoin(RelNode left, RelNode right, + @Override public RelNode createSemiJoin(RelNode left, RelNode right, RexNode condition) { return LogicalJoin.create(left, right, ImmutableList.of(), condition, ImmutableSet.of(), JoinRelType.SEMI, false, ImmutableList.of()); @@ -468,7 +468,7 @@ RelNode createValues(RelOptCluster cluster, RelDataType rowType, * {@link LogicalValues}. */ private static class ValuesFactoryImpl implements ValuesFactory { - public RelNode createValues(RelOptCluster cluster, RelDataType rowType, + @Override public RelNode createValues(RelOptCluster cluster, RelDataType rowType, List> tuples) { return LogicalValues.create(cluster, rowType, ImmutableList.copyOf(tuples)); @@ -491,7 +491,7 @@ public interface TableScanFactory { * {@link LogicalTableScan}. */ private static class TableScanFactoryImpl implements TableScanFactory { - public RelNode createScan(RelOptTable.ToRelContext toRelContext, RelOptTable table) { + @Override public RelNode createScan(RelOptTable.ToRelContext toRelContext, RelOptTable table) { return table.toRel(toRelContext); } } @@ -556,7 +556,7 @@ public interface SnapshotFactory { * returns a vanilla {@link LogicalSnapshot}. */ public static class SnapshotFactoryImpl implements SnapshotFactory { - public RelNode createSnapshot(RelNode input, RexNode period) { + @Override public RelNode createSnapshot(RelNode input, RexNode period) { return LogicalSnapshot.create(input, period); } } @@ -580,7 +580,7 @@ RelNode createMatch(RelNode input, RexNode pattern, * that returns a {@link LogicalMatch}. */ private static class MatchFactoryImpl implements MatchFactory { - public RelNode createMatch(RelNode input, RexNode pattern, + @Override public RelNode createMatch(RelNode input, RexNode pattern, RelDataType rowType, boolean strictStart, boolean strictEnd, Map patternDefinitions, Map measures, RexNode after, Map> subsets, @@ -608,7 +608,7 @@ RelNode createTableSpool(RelNode input, Spool.Type readType, * that returns Logical Spools. */ private static class SpoolFactoryImpl implements SpoolFactory { - public RelNode createTableSpool(RelNode input, Spool.Type readType, + @Override public RelNode createTableSpool(RelNode input, Spool.Type readType, Spool.Type writeType, RelOptTable table) { return LogicalTableSpool.create(input, readType, writeType, table); } @@ -630,7 +630,7 @@ RelNode createRepeatUnion(RelNode seed, RelNode iterative, boolean all, * that returns a {@link LogicalRepeatUnion}. */ private static class RepeatUnionFactoryImpl implements RepeatUnionFactory { - public RelNode createRepeatUnion(RelNode seed, RelNode iterative, + @Override public RelNode createRepeatUnion(RelNode seed, RelNode iterative, boolean all, int iterationLimit) { return LogicalRepeatUnion.create(seed, iterative, all, iterationLimit); } diff --git a/core/src/main/java/org/apache/calcite/rel/core/Sample.java b/core/src/main/java/org/apache/calcite/rel/core/Sample.java index d78f2fdb165..bab6e2c805c 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/Sample.java +++ b/core/src/main/java/org/apache/calcite/rel/core/Sample.java @@ -66,7 +66,7 @@ private static RelOptSamplingParameters getSamplingParameters( repeatable ? ((Number) repeatableSeed).intValue() : 0); } - public RelNode copy(RelTraitSet traitSet, List inputs) { + @Override public RelNode copy(RelTraitSet traitSet, List inputs) { assert traitSet.containsIfApplicable(Convention.NONE); return new Sample(getCluster(), sole(inputs), params); } diff --git a/core/src/main/java/org/apache/calcite/rel/core/Snapshot.java b/core/src/main/java/org/apache/calcite/rel/core/Snapshot.java index eaba15dd600..ae5c795ab89 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/Snapshot.java +++ b/core/src/main/java/org/apache/calcite/rel/core/Snapshot.java @@ -74,7 +74,7 @@ protected Snapshot(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, public abstract Snapshot copy(RelTraitSet traitSet, RelNode input, RexNode period); - public RelNode accept(RexShuttle shuttle) { + @Override public RelNode accept(RexShuttle shuttle) { RexNode condition = shuttle.apply(this.period); if (this.period == condition) { return this; 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 4de02914eac..c7ece1f02fe 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 @@ -130,7 +130,7 @@ public abstract Sort copy(RelTraitSet traitSet, RelNode newInput, return planner.getCostFactory().makeCost(rowCount, cpu, 0); } - public RelNode accept(RexShuttle shuttle) { + @Override public RelNode accept(RexShuttle shuttle) { RexNode offset = shuttle.apply(this.offset); RexNode fetch = shuttle.apply(this.fetch); List originalSortExps = getSortExps(); @@ -174,7 +174,7 @@ public List getSortExps() { Objects.requireNonNull(field).getFieldIndex())); } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { super.explainTerms(pw); if (pw.nest()) { pw.item("collation", 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 eba52a4fdd2..dc9a7114dd8 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 @@ -103,7 +103,7 @@ public RelCollation getCollation() { return collation; } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { return super.explainTerms(pw) .item("collation", collation); } diff --git a/core/src/main/java/org/apache/calcite/rel/core/TableFunctionScan.java b/core/src/main/java/org/apache/calcite/rel/core/TableFunctionScan.java index c79e0a582fa..b33ca3d790a 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/TableFunctionScan.java +++ b/core/src/main/java/org/apache/calcite/rel/core/TableFunctionScan.java @@ -133,7 +133,7 @@ public abstract TableFunctionScan copy( return inputs; } - public RelNode accept(RexShuttle shuttle) { + @Override public RelNode accept(RexShuttle shuttle) { RexNode rexCall = shuttle.apply(this.rexCall); if (rexCall == this.rexCall) { return this; @@ -181,7 +181,7 @@ public RexNode getCall() { return rexCall; } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { super.explainTerms(pw); for (Ord ord : Ord.zip(inputs)) { pw.input("input#" + ord.i, ord.e); diff --git a/core/src/main/java/org/apache/calcite/rel/core/TableModify.java b/core/src/main/java/org/apache/calcite/rel/core/TableModify.java index 162eb2df815..8a5744675c3 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/TableModify.java +++ b/core/src/main/java/org/apache/calcite/rel/core/TableModify.java @@ -158,7 +158,7 @@ public Prepare.CatalogReader getCatalogReader() { return catalogReader; } - public RelOptTable getTable() { + @Override public RelOptTable getTable() { return table; } diff --git a/core/src/main/java/org/apache/calcite/rel/core/TableSpool.java b/core/src/main/java/org/apache/calcite/rel/core/TableSpool.java index cb7ec14ba0d..7c39e84728e 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/TableSpool.java +++ b/core/src/main/java/org/apache/calcite/rel/core/TableSpool.java @@ -42,7 +42,7 @@ protected TableSpool(RelOptCluster cluster, RelTraitSet traitSet, this.table = Objects.requireNonNull(table); } - public RelOptTable getTable() { + @Override public RelOptTable getTable() { return table; } diff --git a/core/src/main/java/org/apache/calcite/rel/core/Uncollect.java b/core/src/main/java/org/apache/calcite/rel/core/Uncollect.java index 45caa41f0d4..cbf5b6a89e3 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/Uncollect.java +++ b/core/src/main/java/org/apache/calcite/rel/core/Uncollect.java @@ -122,7 +122,7 @@ public RelNode copy(RelTraitSet traitSet, RelNode input) { return new Uncollect(getCluster(), traitSet, input, withOrdinality, itemAliases); } - protected RelDataType deriveRowType() { + @Override protected RelDataType deriveRowType() { return deriveUncollectRowType(input, withOrdinality, itemAliases); } diff --git a/core/src/main/java/org/apache/calcite/rel/core/Values.java b/core/src/main/java/org/apache/calcite/rel/core/Values.java index 8f25815fb96..0943ff4b1ea 100644 --- a/core/src/main/java/org/apache/calcite/rel/core/Values.java +++ b/core/src/main/java/org/apache/calcite/rel/core/Values.java @@ -166,12 +166,12 @@ private boolean assertRowType() { } // implement RelNode - public double estimateRowCount(RelMetadataQuery mq) { + @Override public double estimateRowCount(RelMetadataQuery mq) { return tuples.size(); } // implement RelNode - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { // A little adapter just to get the tuples to come out // with curly brackets instead of square brackets. Plus // more whitespace for readability. 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 dc364ea5b7c..48ddcff32d1 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 @@ -123,7 +123,7 @@ public Window(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, return litmus.succeed(); } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { super.explainTerms(pw); for (Ord window : Ord.zip(groups)) { pw.item("window#" + window.i, window.e.toString()); @@ -134,11 +134,11 @@ public RelWriter explainTerms(RelWriter pw) { public static ImmutableIntList getProjectOrdinals(final List exprs) { return ImmutableIntList.copyOf( new AbstractList() { - public Integer get(int index) { + @Override public Integer get(int index) { return ((RexSlot) exprs.get(index)).getIndex(); } - public int size() { + @Override public int size() { return exprs.size(); } }); @@ -148,7 +148,7 @@ public static RelCollation getCollation( final List collations) { return RelCollations.of( new AbstractList() { - public RelFieldCollation get(int index) { + @Override public RelFieldCollation get(int index) { final RexFieldCollation collation = collations.get(index); return new RelFieldCollation( ((RexLocalRef) collation.left).getIndex(), @@ -156,7 +156,7 @@ public RelFieldCollation get(int index) { collation.getNullDirection()); } - public int size() { + @Override public int size() { return collations.size(); } }); @@ -239,7 +239,7 @@ public Group( this.digest = computeString(); } - public String toString() { + @Override public String toString() { return digest; } @@ -325,11 +325,11 @@ public List getAggregateCalls(Window windowRel) { Util.skip(windowRel.getRowType().getFieldNames(), windowRel.getInput().getRowType().getFieldCount()); return new AbstractList() { - public int size() { + @Override public int size() { return aggCalls.size(); } - public AggregateCall get(int index) { + @Override public AggregateCall get(int index) { final RexWinAggCall aggCall = aggCalls.get(index); final SqlAggFunction op = (SqlAggFunction) aggCall.getOperator(); return AggregateCall.create(op, aggCall.distinct, false, 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 d2b2b47398f..96c73387efb 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 @@ -73,7 +73,7 @@ public RelDotWriter( //~ Methods ---------------------------------------------------------------- - protected void explain_(RelNode rel, + @Override protected void explain_(RelNode rel, List> values) { // get inputs List inputs = getInputs(rel); @@ -179,7 +179,7 @@ private void explainInputs(List inputs) { } } - public RelWriter done(RelNode node) { + @Override public RelWriter done(RelNode node) { int numOfVisitedNodes = nodeLabels.size(); super.done(node); if (numOfVisitedNodes == 0) { diff --git a/core/src/main/java/org/apache/calcite/rel/externalize/RelJsonReader.java b/core/src/main/java/org/apache/calcite/rel/externalize/RelJsonReader.java index a4db821b03c..b9caf290ccb 100644 --- a/core/src/main/java/org/apache/calcite/rel/externalize/RelJsonReader.java +++ b/core/src/main/java/org/apache/calcite/rel/externalize/RelJsonReader.java @@ -97,26 +97,26 @@ private void readRel(final Map jsonRel) { String type = (String) jsonRel.get("relOp"); Constructor constructor = relJson.getConstructor(type); RelInput input = new RelInput() { - public RelOptCluster getCluster() { + @Override public RelOptCluster getCluster() { return cluster; } - public RelTraitSet getTraitSet() { + @Override public RelTraitSet getTraitSet() { return cluster.traitSetOf(Convention.NONE); } - public RelOptTable getTable(String table) { + @Override public RelOptTable getTable(String table) { final List list = getStringList(table); return relOptSchema.getTableForMember(list); } - public RelNode getInput() { + @Override public RelNode getInput() { final List inputs = getInputs(); assert inputs.size() == 1; return inputs.get(0); } - public List getInputs() { + @Override public List getInputs() { final List jsonInputs = getStringList("inputs"); if (jsonInputs == null) { return ImmutableList.of(lastRel); @@ -128,15 +128,15 @@ public List getInputs() { return inputs; } - public RexNode getExpression(String tag) { + @Override public RexNode getExpression(String tag) { return relJson.toRex(this, jsonRel.get(tag)); } - public ImmutableBitSet getBitSet(String tag) { + @Override public ImmutableBitSet getBitSet(String tag) { return ImmutableBitSet.of(getIntegerList(tag)); } - public List getBitSetList(String tag) { + @Override public List getBitSetList(String tag) { List> list = getIntegerListList(tag); if (list == null) { return null; @@ -149,22 +149,22 @@ public List getBitSetList(String tag) { return builder.build(); } - public List getStringList(String tag) { + @Override public List getStringList(String tag) { //noinspection unchecked return (List) jsonRel.get(tag); } - public List getIntegerList(String tag) { + @Override public List getIntegerList(String tag) { //noinspection unchecked return (List) jsonRel.get(tag); } - public List> getIntegerListList(String tag) { + @Override public List> getIntegerListList(String tag) { //noinspection unchecked return (List>) jsonRel.get(tag); } - public List getAggregateCalls(String tag) { + @Override public List getAggregateCalls(String tag) { @SuppressWarnings("unchecked") final List> jsonAggs = (List) jsonRel.get(tag); final List inputs = new ArrayList<>(); @@ -174,29 +174,29 @@ public List getAggregateCalls(String tag) { return inputs; } - public Object get(String tag) { + @Override public Object get(String tag) { return jsonRel.get(tag); } - public String getString(String tag) { + @Override public String getString(String tag) { return (String) jsonRel.get(tag); } - public float getFloat(String tag) { + @Override public float getFloat(String tag) { return ((Number) jsonRel.get(tag)).floatValue(); } - public boolean getBoolean(String tag, boolean default_) { + @Override public boolean getBoolean(String tag, boolean default_) { final Boolean b = (Boolean) jsonRel.get(tag); return b != null ? b : default_; } - public > E getEnum(String tag, Class enumClass) { + @Override public > E getEnum(String tag, Class enumClass) { return Util.enumVal(enumClass, getString(tag).toUpperCase(Locale.ROOT)); } - public List getExpressionList(String tag) { + @Override public List getExpressionList(String tag) { @SuppressWarnings("unchecked") final List jsonNodes = (List) jsonRel.get(tag); if (jsonNodes == null) { @@ -209,12 +209,12 @@ public List getExpressionList(String tag) { return nodes; } - public RelDataType getRowType(String tag) { + @Override public RelDataType getRowType(String tag) { final Object o = jsonRel.get(tag); return relJson.toType(cluster.getTypeFactory(), o); } - public RelDataType getRowType(String expressionsTag, String fieldsTag) { + @Override public RelDataType getRowType(String expressionsTag, String fieldsTag) { final List expressionList = getExpressionList(expressionsTag); @SuppressWarnings("unchecked") final List names = (List) get(fieldsTag); @@ -231,16 +231,16 @@ public RelDataType getRowType(String expressionsTag, String fieldsTag) { }); } - public RelCollation getCollation() { + @Override public RelCollation getCollation() { //noinspection unchecked return relJson.toCollation((List) get("collation")); } - public RelDistribution getDistribution() { + @Override public RelDistribution getDistribution() { return relJson.toDistribution((Map) get("distribution")); } - public ImmutableList> getTuples(String tag) { + @Override public ImmutableList> getTuples(String tag) { //noinspection unchecked final List jsonTuples = (List) get(tag); final ImmutableList.Builder> builder = diff --git a/core/src/main/java/org/apache/calcite/rel/externalize/RelJsonWriter.java b/core/src/main/java/org/apache/calcite/rel/externalize/RelJsonWriter.java index 5b6a346e675..6600effc714 100644 --- a/core/src/main/java/org/apache/calcite/rel/externalize/RelJsonWriter.java +++ b/core/src/main/java/org/apache/calcite/rel/externalize/RelJsonWriter.java @@ -96,15 +96,15 @@ private List explainInputs(List inputs) { return list; } - public final void explain(RelNode rel, List> valueList) { + @Override public final void explain(RelNode rel, List> valueList) { explain_(rel, valueList); } - public SqlExplainLevel getDetailLevel() { + @Override public SqlExplainLevel getDetailLevel() { return SqlExplainLevel.ALL_ATTRIBUTES; } - public RelWriter item(String term, Object value) { + @Override public RelWriter item(String term, Object value) { values.add(Pair.of(term, value)); return this; } @@ -121,7 +121,7 @@ private List getList(List> values, String tag) { return list; } - public RelWriter done(RelNode node) { + @Override public RelWriter done(RelNode node) { final List> valuesCopy = ImmutableList.copyOf(values); values.clear(); diff --git a/core/src/main/java/org/apache/calcite/rel/externalize/RelWriterImpl.java b/core/src/main/java/org/apache/calcite/rel/externalize/RelWriterImpl.java index 9fa52d82696..4ac6b7e7d41 100644 --- a/core/src/main/java/org/apache/calcite/rel/externalize/RelWriterImpl.java +++ b/core/src/main/java/org/apache/calcite/rel/externalize/RelWriterImpl.java @@ -123,20 +123,20 @@ private void explainInputs(List inputs) { } } - public final void explain(RelNode rel, List> valueList) { + @Override public final void explain(RelNode rel, List> valueList) { explain_(rel, valueList); } - public SqlExplainLevel getDetailLevel() { + @Override public SqlExplainLevel getDetailLevel() { return detailLevel; } - public RelWriter item(String term, Object value) { + @Override public RelWriter item(String term, Object value) { values.add(Pair.of(term, value)); return this; } - public RelWriter done(RelNode node) { + @Override public RelWriter done(RelNode node) { assert checkInputsPresentInExplain(node); final List> valuesCopy = ImmutableList.copyOf(values); diff --git a/core/src/main/java/org/apache/calcite/rel/externalize/RelXmlWriter.java b/core/src/main/java/org/apache/calcite/rel/externalize/RelXmlWriter.java index 9d2d06065cc..17bfc38bf99 100644 --- a/core/src/main/java/org/apache/calcite/rel/externalize/RelXmlWriter.java +++ b/core/src/main/java/org/apache/calcite/rel/externalize/RelXmlWriter.java @@ -49,7 +49,7 @@ public RelXmlWriter(PrintWriter pw, SqlExplainLevel detailLevel) { //~ Methods ---------------------------------------------------------------- - protected void explain_( + @Override protected void explain_( RelNode rel, List> values) { if (generic) { diff --git a/core/src/main/java/org/apache/calcite/rel/hint/HintStrategyTable.java b/core/src/main/java/org/apache/calcite/rel/hint/HintStrategyTable.java index fc4db46ae4f..31c0e8c92a9 100644 --- a/core/src/main/java/org/apache/calcite/rel/hint/HintStrategyTable.java +++ b/core/src/main/java/org/apache/calcite/rel/hint/HintStrategyTable.java @@ -229,16 +229,16 @@ public static class HintErrorLogger implements Litmus { public static final HintErrorLogger INSTANCE = new HintErrorLogger(); - public boolean fail(String message, Object... args) { + @Override public boolean fail(String message, Object... args) { LOGGER.warn(message, args); return false; } - public boolean succeed() { + @Override public boolean succeed() { return true; } - public boolean check(boolean condition, String message, Object... args) { + @Override public boolean check(boolean condition, String message, Object... args) { if (condition) { return succeed(); } else { diff --git a/core/src/main/java/org/apache/calcite/rel/logical/LogicalFilter.java b/core/src/main/java/org/apache/calcite/rel/logical/LogicalFilter.java index 740469bda49..8248fbc969f 100644 --- a/core/src/main/java/org/apache/calcite/rel/logical/LogicalFilter.java +++ b/core/src/main/java/org/apache/calcite/rel/logical/LogicalFilter.java @@ -120,7 +120,7 @@ public static LogicalFilter create(final RelNode input, RexNode condition, return variablesSet; } - public LogicalFilter copy(RelTraitSet traitSet, RelNode input, + @Override public LogicalFilter copy(RelTraitSet traitSet, RelNode input, RexNode condition) { assert traitSet.containsIfApplicable(Convention.NONE); return new LogicalFilter(getCluster(), traitSet, input, condition, diff --git a/core/src/main/java/org/apache/calcite/rel/logical/LogicalJoin.java b/core/src/main/java/org/apache/calcite/rel/logical/LogicalJoin.java index baf87ec454b..d8e50720b52 100644 --- a/core/src/main/java/org/apache/calcite/rel/logical/LogicalJoin.java +++ b/core/src/main/java/org/apache/calcite/rel/logical/LogicalJoin.java @@ -184,7 +184,7 @@ public static LogicalJoin create(RelNode left, RelNode right, List hint return shuttle.visit(this); } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { // Don't ever print semiJoinDone=false. This way, we // don't clutter things up in optimizers that don't use semi-joins. return super.explainTerms(pw) @@ -208,7 +208,7 @@ public RelWriter explainTerms(RelWriter pw) { return semiJoinDone; } - public List getSystemFieldList() { + @Override public List getSystemFieldList() { return systemFieldList; } diff --git a/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableFunctionScan.java b/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableFunctionScan.java index fbd1869f452..9b5510ed55f 100644 --- a/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableFunctionScan.java +++ b/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableFunctionScan.java @@ -113,7 +113,7 @@ public static LogicalTableFunctionScan create( columnMappings); } - public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { + @Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { // REVIEW jvs 8-Jan-2006: what is supposed to be here // for an abstract rel? return planner.getCostFactory().makeHugeCost(); diff --git a/core/src/main/java/org/apache/calcite/rel/logical/LogicalUnion.java b/core/src/main/java/org/apache/calcite/rel/logical/LogicalUnion.java index 535ca8193b3..a56ba115673 100644 --- a/core/src/main/java/org/apache/calcite/rel/logical/LogicalUnion.java +++ b/core/src/main/java/org/apache/calcite/rel/logical/LogicalUnion.java @@ -67,7 +67,7 @@ public static LogicalUnion create(List inputs, boolean all) { //~ Methods ---------------------------------------------------------------- - public LogicalUnion copy( + @Override public LogicalUnion copy( RelTraitSet traitSet, List inputs, boolean all) { assert traitSet.containsIfApplicable(Convention.NONE); return new LogicalUnion(getCluster(), traitSet, inputs, all); diff --git a/core/src/main/java/org/apache/calcite/rel/logical/LogicalWindow.java b/core/src/main/java/org/apache/calcite/rel/logical/LogicalWindow.java index 7272a5796b8..6cbfeb0c054 100644 --- a/core/src/main/java/org/apache/calcite/rel/logical/LogicalWindow.java +++ b/core/src/main/java/org/apache/calcite/rel/logical/LogicalWindow.java @@ -212,7 +212,7 @@ public static RelNode create(RelOptCluster cluster, // the output calc (if it exists). RexShuttle shuttle = new RexShuttle() { - public RexNode visitOver(RexOver over) { + @Override public RexNode visitOver(RexOver over) { // Look up the aggCall which this expr was translated to. final Window.RexWinAggCall aggCall = aggMap.get(origToNewOver.get(over)); @@ -243,7 +243,7 @@ public RexNode visitOver(RexOver over) { over.getType()); } - public RexNode visitLocalRef(RexLocalRef localRef) { + @Override public RexNode visitLocalRef(RexLocalRef localRef) { final int index = localRef.getIndex(); if (index < inputFieldCount) { // Reference to input field. @@ -281,11 +281,11 @@ public RexNode visitLocalRef(RexLocalRef localRef) { private static List toInputRefs( final List operands) { return new AbstractList() { - public int size() { + @Override public int size() { return operands.size(); } - public RexNode get(int index) { + @Override public RexNode get(int index) { final RexNode operand = operands.get(index); if (operand instanceof RexInputRef) { return operand; diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/CachingRelMetadataProvider.java b/core/src/main/java/org/apache/calcite/rel/metadata/CachingRelMetadataProvider.java index 03f80e190a5..d1a69285eb8 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/CachingRelMetadataProvider.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/CachingRelMetadataProvider.java @@ -55,7 +55,7 @@ public CachingRelMetadataProvider( //~ Methods ---------------------------------------------------------------- - public UnboundMetadata apply( + @Override public UnboundMetadata apply( Class relClass, final Class metadataClass) { final UnboundMetadata function = @@ -75,7 +75,7 @@ public UnboundMetadata apply( }; } - public Multimap> handlers( + @Override public Multimap> handlers( MetadataDef def) { return underlyingProvider.handlers(def); } @@ -103,7 +103,7 @@ private class CachingInvocationHandler implements InvocationHandler { this.metadata = Objects.requireNonNull(metadata); } - public Object invoke(Object proxy, Method method, Object[] args) + @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { // Compute hash key. final ImmutableList.Builder builder = ImmutableList.builder(); 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 d1cf705d1c1..2ece0454dfa 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 @@ -67,7 +67,7 @@ protected ChainedRelMetadataProvider( return providers.hashCode(); } - public UnboundMetadata apply( + @Override public UnboundMetadata apply( Class relClass, final Class metadataClass) { final List> functions = new ArrayList<>(); @@ -101,7 +101,7 @@ public UnboundMetadata apply( } } - public Multimap> handlers( + @Override public Multimap> handlers( MetadataDef def) { final ImmutableMultimap.Builder> builder = ImmutableMultimap.builder(); @@ -125,7 +125,7 @@ private static class ChainedInvocationHandler implements InvocationHandler { this.metadataList = ImmutableList.copyOf(metadataList); } - public Object invoke(Object proxy, Method method, Object[] args) + @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { for (Metadata metadata : metadataList) { try { diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/JaninoRelMetadataProvider.java b/core/src/main/java/org/apache/calcite/rel/metadata/JaninoRelMetadataProvider.java index 78584a1b5c3..d18cf07dd15 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/JaninoRelMetadataProvider.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/JaninoRelMetadataProvider.java @@ -181,12 +181,12 @@ private static CacheBuilder maxSize(CacheBuilder builder, return 109 + provider.hashCode(); } - public UnboundMetadata apply( + @Override public UnboundMetadata apply( Class relClass, Class metadataClass) { throw new UnsupportedOperationException(); } - public Multimap> + @Override public Multimap> handlers(MetadataDef def) { return provider.handlers(def); } 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 c4fa662064f..d92c267bd8c 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 @@ -55,7 +55,7 @@ UnboundMetadata> loader(final RelMetadataProvider provider) { }); } - public M query(RelNode rel, RelMetadataQuery mq, + @Override public M query(RelNode rel, RelMetadataQuery mq, Class metadataClazz) { try { //noinspection unchecked 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 61681796be8..aa2662e1569 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 @@ -198,7 +198,7 @@ private static RelMetadataProvider reflectiveSource( space.providerMap); } - public Multimap> handlers( + @Override public Multimap> handlers( MetadataDef def) { final ImmutableMultimap.Builder> builder = ImmutableMultimap.builder(); @@ -228,7 +228,7 @@ private static boolean couldImplement(Method handlerMethod, Method method) { //~ Methods ---------------------------------------------------------------- - public UnboundMetadata apply( + @Override public UnboundMetadata apply( Class relClass, Class metadataClass) { if (metadataClass == metadataClass0) { return apply(relClass); diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelColumnOrigin.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelColumnOrigin.java index 6a3d7e5ae15..2cdaaa5627b 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelColumnOrigin.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelColumnOrigin.java @@ -70,7 +70,7 @@ public boolean isDerived() { } // override Object - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { if (!(obj instanceof RelColumnOrigin)) { return false; } @@ -82,7 +82,7 @@ public boolean equals(Object obj) { } // override Object - public int hashCode() { + @Override public int hashCode() { return originTable.getQualifiedName().hashCode() + iOriginColumn + (isDerived ? 313 : 0); } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdAllPredicates.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdAllPredicates.java index 2ae457156df..10ad7a04771 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdAllPredicates.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdAllPredicates.java @@ -77,7 +77,7 @@ public class RelMdAllPredicates public static final RelMetadataProvider SOURCE = ReflectiveRelMetadataProvider .reflectiveSource(BuiltInMethod.ALL_PREDICATES.method, new RelMdAllPredicates()); - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.AllPredicates.DEF; } 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 8de027553a3..be9314e222c 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 @@ -88,7 +88,7 @@ private RelMdCollation() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.Collation.DEF; } @@ -416,7 +416,7 @@ public static Ordering> comparator( switch (fieldCollation.direction) { case ASCENDING: return new Ordering>() { - public int compare(List o1, List o2) { + @Override public int compare(List o1, List o2) { final Comparable c1 = o1.get(x).getValueAs(Comparable.class); final Comparable c2 = o2.get(x).getValueAs(Comparable.class); return RelFieldCollation.compare(c1, c2, nullComparison); @@ -424,7 +424,7 @@ public int compare(List o1, List o2) { }; default: return new Ordering>() { - public int compare(List o1, List o2) { + @Override public int compare(List o1, List o2) { final Comparable c1 = o1.get(x).getValueAs(Comparable.class); final Comparable c2 = o2.get(x).getValueAs(Comparable.class); return RelFieldCollation.compare(c2, c1, -nullComparison); diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java index ed1b9cc647f..dbe3aff4844 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java @@ -58,7 +58,7 @@ private RelMdColumnOrigins() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.ColumnOrigin.DEF; } @@ -272,7 +272,7 @@ private Set getMultipleColumns(RexNode rexNode, RelNode input, final Set set = new HashSet<>(); final RexVisitor visitor = new RexVisitorImpl(true) { - public Void visitInputRef(RexInputRef inputRef) { + @Override public Void visitInputRef(RexInputRef inputRef) { Set inputSet = mq.getColumnOrigins(input, inputRef.getIndex()); if (inputSet != null) { diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnUniqueness.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnUniqueness.java index 5815cfc0581..77140d6dab1 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnUniqueness.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnUniqueness.java @@ -74,7 +74,7 @@ private RelMdColumnUniqueness() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.ColumnUniqueness.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdDistinctRowCount.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdDistinctRowCount.java index 971f4f3aab9..ba6d4fa5db0 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdDistinctRowCount.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdDistinctRowCount.java @@ -61,7 +61,7 @@ protected RelMdDistinctRowCount() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.DistinctRowCount.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdDistribution.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdDistribution.java index adbab6bdc4a..82b5479ad7a 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdDistribution.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdDistribution.java @@ -60,7 +60,7 @@ private RelMdDistribution() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.Distribution.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdExplainVisibility.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdExplainVisibility.java index 474f29f5661..6d73fad5165 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdExplainVisibility.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdExplainVisibility.java @@ -37,7 +37,7 @@ private RelMdExplainVisibility() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.ExplainVisibility.DEF; } 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 f560cbd744b..41189a02247 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 @@ -87,7 +87,7 @@ protected RelMdExpressionLineage() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.ExpressionLineage.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdLowerBoundCost.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdLowerBoundCost.java index f7ea60a3376..2a18df5a5aa 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdLowerBoundCost.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdLowerBoundCost.java @@ -40,7 +40,7 @@ protected RelMdLowerBoundCost() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.LowerBoundCost.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdMaxRowCount.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdMaxRowCount.java index e6255a31e31..dcf59a639c0 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdMaxRowCount.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdMaxRowCount.java @@ -51,7 +51,7 @@ public class RelMdMaxRowCount //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.MaxRowCount.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdMemory.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdMemory.java index 80864f82969..5d2d215767f 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdMemory.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdMemory.java @@ -42,7 +42,7 @@ protected RelMdMemory() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.Memory.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdMinRowCount.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdMinRowCount.java index 069e40ff112..2bdce84dc5c 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdMinRowCount.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdMinRowCount.java @@ -49,7 +49,7 @@ public class RelMdMinRowCount //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.MinRowCount.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdNodeTypes.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdNodeTypes.java index 5259b3ffca5..f47db4ac151 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdNodeTypes.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdNodeTypes.java @@ -54,7 +54,7 @@ public class RelMdNodeTypes //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.NodeTypes.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdParallelism.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdParallelism.java index c4443862260..4f2a371f26b 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdParallelism.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdParallelism.java @@ -45,7 +45,7 @@ protected RelMdParallelism() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.Parallelism.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPercentageOriginalRows.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPercentageOriginalRows.java index a68082c335c..081bac0b9e5 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPercentageOriginalRows.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPercentageOriginalRows.java @@ -54,7 +54,7 @@ public class RelMdPercentageOriginalRows private RelMdPercentageOriginalRows() {} - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.PercentageOriginalRows.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPopulationSize.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPopulationSize.java index 093958dbf19..f725293bbf6 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPopulationSize.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPopulationSize.java @@ -48,7 +48,7 @@ private RelMdPopulationSize() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.PopulationSize.DEF; } 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 698b05926be..6745e07d40b 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 @@ -132,7 +132,7 @@ public class RelMdPredicates private static final List EMPTY_LIST = ImmutableList.of(); - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.Predicates.DEF; } @@ -840,7 +840,7 @@ class ExprsItr implements Iterator { firstCall = true; } - public boolean hasNext() { + @Override public boolean hasNext() { if (firstCall) { initializeMapping(); firstCall = false; @@ -850,11 +850,11 @@ public boolean hasNext() { return nextMapping != null; } - public Mapping next() { + @Override public Mapping next() { return nextMapping; } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdRowCount.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdRowCount.java index a42ed2ab093..4cf6209ead1 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdRowCount.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdRowCount.java @@ -53,7 +53,7 @@ public class RelMdRowCount //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.RowCount.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdSelectivity.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdSelectivity.java index ec181f9778c..192cca05475 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdSelectivity.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdSelectivity.java @@ -55,7 +55,7 @@ protected RelMdSelectivity() { //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.Selectivity.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdSize.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdSize.java index 458df6b3448..00b78c55790 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdSize.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdSize.java @@ -74,7 +74,7 @@ protected RelMdSize() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.Size.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdTableReferences.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdTableReferences.java index e554728e0be..dd9e797dce8 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdTableReferences.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdTableReferences.java @@ -71,7 +71,7 @@ protected RelMdTableReferences() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.TableReferences.DEF; } diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdUniqueKeys.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdUniqueKeys.java index 9ce85970c8a..85d6ddd0f24 100644 --- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdUniqueKeys.java +++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdUniqueKeys.java @@ -66,7 +66,7 @@ private RelMdUniqueKeys() {} //~ Methods ---------------------------------------------------------------- - public MetadataDef getDef() { + @Override public MetadataDef getDef() { return BuiltInMetadata.UniqueKeys.DEF; } 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 4f642a22428..75ee15281a6 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 @@ -811,7 +811,7 @@ private static class CardOfProjExpr extends RexVisitorImpl { this.rel = rel; } - public Double visitInputRef(RexInputRef var) { + @Override public Double visitInputRef(RexInputRef var) { int index = var.getIndex(); ImmutableBitSet col = ImmutableBitSet.of(index); Double distinctRowCount = @@ -823,11 +823,11 @@ public Double visitInputRef(RexInputRef var) { } } - public Double visitLiteral(RexLiteral literal) { + @Override public Double visitLiteral(RexLiteral literal) { return numDistinctVals(1.0, mq.getRowCount(rel)); } - public Double visitCall(RexCall call) { + @Override public Double visitCall(RexCall call) { Double distinctRowCount; Double rowCount = mq.getRowCount(rel); if (call.isA(SqlKind.MINUS_PREFIX)) { diff --git a/core/src/main/java/org/apache/calcite/rel/mutable/MutableBiRel.java b/core/src/main/java/org/apache/calcite/rel/mutable/MutableBiRel.java index 46d1f2d3c19..e7475226cc2 100644 --- a/core/src/main/java/org/apache/calcite/rel/mutable/MutableBiRel.java +++ b/core/src/main/java/org/apache/calcite/rel/mutable/MutableBiRel.java @@ -40,7 +40,7 @@ protected MutableBiRel(MutableRelType type, RelOptCluster cluster, right.ordinalInParent = 1; } - public void setInput(int ordinalInParent, MutableRel input) { + @Override public void setInput(int ordinalInParent, MutableRel input) { if (ordinalInParent > 1) { throw new IllegalArgumentException(); } @@ -55,7 +55,7 @@ public void setInput(int ordinalInParent, MutableRel input) { } } - public List getInputs() { + @Override public List getInputs() { return ImmutableList.of(left, right); } @@ -67,7 +67,7 @@ public MutableRel getRight() { return right; } - public void childrenAccept(MutableRelVisitor visitor) { + @Override public void childrenAccept(MutableRelVisitor visitor) { visitor.visit(left); visitor.visit(right); diff --git a/core/src/main/java/org/apache/calcite/rel/mutable/MutableLeafRel.java b/core/src/main/java/org/apache/calcite/rel/mutable/MutableLeafRel.java index f34f58f29af..500c0b002f9 100644 --- a/core/src/main/java/org/apache/calcite/rel/mutable/MutableLeafRel.java +++ b/core/src/main/java/org/apache/calcite/rel/mutable/MutableLeafRel.java @@ -32,15 +32,15 @@ protected MutableLeafRel(MutableRelType type, RelNode rel) { this.rel = rel; } - public void setInput(int ordinalInParent, MutableRel input) { + @Override public void setInput(int ordinalInParent, MutableRel input) { throw new IllegalArgumentException(); } - public List getInputs() { + @Override public List getInputs() { return ImmutableList.of(); } - public void childrenAccept(MutableRelVisitor visitor) { + @Override public void childrenAccept(MutableRelVisitor visitor) { // no children - nothing to do } } 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 06fcf2f87c8..f15e9847737 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 @@ -82,7 +82,7 @@ public MutableRel getParent() { public abstract List getInputs(); - public abstract MutableRel clone(); + @Override public abstract MutableRel clone(); public abstract void childrenAccept(MutableRelVisitor visitor); diff --git a/core/src/main/java/org/apache/calcite/rel/mutable/MutableRels.java b/core/src/main/java/org/apache/calcite/rel/mutable/MutableRels.java index bb646844220..996e44c2ee1 100644 --- a/core/src/main/java/org/apache/calcite/rel/mutable/MutableRels.java +++ b/core/src/main/java/org/apache/calcite/rel/mutable/MutableRels.java @@ -153,11 +153,11 @@ public static MutableRel createProject(final MutableRel child, RelOptUtil.permute(child.cluster.getTypeFactory(), rowType, mapping), child, new AbstractList() { - public int size() { + @Override public int size() { return posList.size(); } - public RexNode get(int index) { + @Override public RexNode get(int index) { final int pos = posList.get(index); return RexInputRef.of(pos, rowType); } diff --git a/core/src/main/java/org/apache/calcite/rel/mutable/MutableSingleRel.java b/core/src/main/java/org/apache/calcite/rel/mutable/MutableSingleRel.java index 133061ab622..3b7e4788c64 100644 --- a/core/src/main/java/org/apache/calcite/rel/mutable/MutableSingleRel.java +++ b/core/src/main/java/org/apache/calcite/rel/mutable/MutableSingleRel.java @@ -34,7 +34,7 @@ protected MutableSingleRel(MutableRelType type, input.ordinalInParent = 0; } - public void setInput(int ordinalInParent, MutableRel input) { + @Override public void setInput(int ordinalInParent, MutableRel input) { if (ordinalInParent > 0) { throw new IllegalArgumentException(); } @@ -45,11 +45,11 @@ public void setInput(int ordinalInParent, MutableRel input) { } } - public List getInputs() { + @Override public List getInputs() { return ImmutableList.of(input); } - public void childrenAccept(MutableRelVisitor visitor) { + @Override public void childrenAccept(MutableRelVisitor visitor) { visitor.visit(input); } diff --git a/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java b/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java index e3e4231e1de..7b88b3fce25 100644 --- a/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java +++ b/core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java @@ -131,7 +131,7 @@ protected Result dispatch(RelNode e) { return dispatcher.invoke(e); } - public Result visitInput(RelNode parent, int i, boolean anon, + @Override public Result visitInput(RelNode parent, int i, boolean anon, boolean ignoreClauses, Set expectedClauses) { try { final RelNode e = parent.getInput(i); 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 7fa48594c25..a60111d59aa 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 @@ -1067,11 +1067,11 @@ private List toSql(RexProgram program, List operandList) { public List fieldList() { return new AbstractList() { - public SqlNode get(int index) { + @Override public SqlNode get(int index) { return field(index); } - public int size() { + @Override public int size() { return fieldCount; } }; @@ -1359,7 +1359,7 @@ public SimpleContext(SqlDialect dialect, IntFunction field) { throw new UnsupportedOperationException(); } - public SqlNode field(int ordinal) { + @Override public SqlNode field(int ordinal) { return field.apply(ordinal); } } @@ -1438,7 +1438,7 @@ protected AliasContext(SqlDialect dialect, this.qualified = qualified; } - public SqlNode field(int ordinal) { + @Override public SqlNode field(int ordinal) { for (Map.Entry alias : aliases.entrySet()) { final List fields = alias.getValue().getFieldList(); if (ordinal < fields.size()) { @@ -1469,7 +1469,7 @@ private JoinContext(SqlDialect dialect, Context leftContext, this.rightContext = rightContext; } - public SqlNode field(int ordinal) { + @Override public SqlNode field(int ordinal) { if (ordinal < leftContext.fieldCount) { return leftContext.field(ordinal); } else { diff --git a/core/src/main/java/org/apache/calcite/rel/rules/AggregateStarTableRule.java b/core/src/main/java/org/apache/calcite/rel/rules/AggregateStarTableRule.java index 859150c1e7d..d7ee66cc38e 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/AggregateStarTableRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/AggregateStarTableRule.java @@ -165,7 +165,7 @@ protected void apply(RelOptRuleCall call, Project postProject, new AbstractSourceMapping( tileKey.dimensions.cardinality() + tileKey.measures.size(), aggregate.getRowType().getFieldCount()) { - public int getSourceOpt(int source) { + @Override public int getSourceOpt(int source) { if (source < aggregate.getGroupCount()) { int in = tileKey.dimensions.nth(source); return aggregate.getGroupSet().indexOf(in); diff --git a/core/src/main/java/org/apache/calcite/rel/rules/CalcRelSplitter.java b/core/src/main/java/org/apache/calcite/rel/rules/CalcRelSplitter.java index 6d0b8406491..cfd99940535 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/CalcRelSplitter.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/CalcRelSplitter.java @@ -444,7 +444,7 @@ private List computeTopologicalOrdering( } expr.accept( new RexVisitorImpl(true) { - public Void visitLocalRef(RexLocalRef localRef) { + @Override public Void visitLocalRef(RexLocalRef localRef) { for (Integer target : targets) { graph.addEdge(localRef.getIndex(), target); } @@ -750,7 +750,7 @@ public RelType(String name) { this.name = name; } - public String toString() { + @Override public String toString() { return name; } @@ -828,28 +828,28 @@ private static class ImplementTester extends RexVisitorImpl { this.relType = relType; } - public Void visitCall(RexCall call) { + @Override public Void visitCall(RexCall call) { if (!relType.canImplement(call)) { throw CannotImplement.INSTANCE; } return null; } - public Void visitDynamicParam(RexDynamicParam dynamicParam) { + @Override public Void visitDynamicParam(RexDynamicParam dynamicParam) { if (!relType.canImplement(dynamicParam)) { throw CannotImplement.INSTANCE; } return null; } - public Void visitFieldAccess(RexFieldAccess fieldAccess) { + @Override public Void visitFieldAccess(RexFieldAccess fieldAccess) { if (!relType.canImplement(fieldAccess)) { throw CannotImplement.INSTANCE; } return null; } - public Void visitLiteral(RexLiteral literal) { + @Override public Void visitLiteral(RexLiteral literal) { if (!relType.canImplement(literal)) { throw CannotImplement.INSTANCE; } @@ -889,7 +889,7 @@ private static class InputToCommonExprConverter extends RexShuttle { this.allExprs = allExprs; } - public RexNode visitInputRef(RexInputRef input) { + @Override public RexNode visitInputRef(RexInputRef input) { final int index = exprInverseOrdinals[input.getIndex()]; assert index >= 0; return new RexLocalRef( @@ -897,7 +897,7 @@ public RexNode visitInputRef(RexInputRef input) { input.getType()); } - public RexNode visitLocalRef(RexLocalRef local) { + @Override public RexNode visitLocalRef(RexLocalRef local) { // A reference to a local variable becomes a reference to an input // if the local was computed at a previous level. final int localIndex = local.getIndex(); @@ -935,7 +935,7 @@ private static class MaxInputFinder extends RexVisitorImpl { this.exprLevels = exprLevels; } - public Void visitLocalRef(RexLocalRef localRef) { + @Override public Void visitLocalRef(RexLocalRef localRef) { int inputLevel = exprLevels[localRef.getIndex()]; level = Math.max(level, inputLevel); return null; @@ -980,7 +980,7 @@ public int[] getMaxUsingLevelOrdinals() { return maxUsingLevelOrdinals; } - public Void visitLocalRef(RexLocalRef ref) { + @Override public Void visitLocalRef(RexLocalRef ref) { final int index = ref.getIndex(); maxUsingLevelOrdinals[index] = Math.max(maxUsingLevelOrdinals[index], currentLevel); diff --git a/core/src/main/java/org/apache/calcite/rel/rules/DateRangeRules.java b/core/src/main/java/org/apache/calcite/rel/rules/DateRangeRules.java index ba2a7777653..68f89a9c4ac 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/DateRangeRules.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/DateRangeRules.java @@ -253,7 +253,7 @@ private ExtractFinder() { return super.visitCall(call); } - public void close() { + @Override public void close() { timeUnits.clear(); opKinds.clear(); } 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 2f1d18b181c..58040bd203e 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 @@ -564,7 +564,7 @@ private class InputReferenceCounter extends RexVisitorImpl { this.refCounts = refCounts; } - public Void visitInputRef(RexInputRef inputRef) { + @Override public Void visitInputRef(RexInputRef inputRef) { refCounts[inputRef.getIndex()]++; return null; } diff --git a/core/src/main/java/org/apache/calcite/rel/rules/LoptJoinTree.java b/core/src/main/java/org/apache/calcite/rel/rules/LoptJoinTree.java index de8de4b31d3..e73c5e27e0b 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/LoptJoinTree.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/LoptJoinTree.java @@ -180,7 +180,7 @@ public int getId() { return id; } - public void getTreeOrder(List treeOrder) { + @Override public void getTreeOrder(List treeOrder) { treeOrder.add(id); } } @@ -204,7 +204,7 @@ public BinaryTree getRight() { return right; } - public void getTreeOrder(List treeOrder) { + @Override public void getTreeOrder(List treeOrder) { left.getTreeOrder(treeOrder); right.getTreeOrder(treeOrder); } diff --git a/core/src/main/java/org/apache/calcite/rel/rules/LoptSemiJoinOptimizer.java b/core/src/main/java/org/apache/calcite/rel/rules/LoptSemiJoinOptimizer.java index 77e2109fcbb..927ab585551 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/LoptSemiJoinOptimizer.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/LoptSemiJoinOptimizer.java @@ -803,7 +803,7 @@ public RelNode getChosenSemiJoin(int factIdx) { /** Compares factors. */ private class FactorCostComparator implements Comparator { - public int compare(Integer rel1Idx, Integer rel2Idx) { + @Override public int compare(Integer rel1Idx, Integer rel2Idx) { RelOptCost c1 = mq.getCumulativeCost(chosenSemiJoins[rel1Idx]); RelOptCost c2 = diff --git a/core/src/main/java/org/apache/calcite/rel/rules/MultiJoin.java b/core/src/main/java/org/apache/calcite/rel/rules/MultiJoin.java index 90d3119b702..3b72fd4a419 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/MultiJoin.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/MultiJoin.java @@ -142,7 +142,7 @@ private Map cloneJoinFieldRefCountsMap() { return clonedMap; } - public RelWriter explainTerms(RelWriter pw) { + @Override public RelWriter explainTerms(RelWriter pw) { List joinTypeNames = new ArrayList<>(); List outerJoinConds = new ArrayList<>(); List projFieldObjects = new ArrayList<>(); @@ -172,15 +172,15 @@ public RelWriter explainTerms(RelWriter pw) { .itemIf("postJoinFilter", postJoinFilter, postJoinFilter != null); } - public RelDataType deriveRowType() { + @Override public RelDataType deriveRowType() { return rowType; } - public List getInputs() { + @Override public List getInputs() { return inputs; } - public RelNode accept(RexShuttle shuttle) { + @Override public RelNode accept(RexShuttle shuttle) { RexNode joinFilter = shuttle.apply(this.joinFilter); List outerJoinConditions = shuttle.apply(this.outerJoinConditions); RexNode postJoinFilter = shuttle.apply(this.postJoinFilter); 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 33fec8e8c56..6ec18352c60 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 @@ -123,7 +123,7 @@ public MultiJoinOptimizeBushyRule(RelFactories.JoinFactory joinFactory, // a large difference in the number of rows on LHS and RHS. final Comparator edgeComparator = new Comparator() { - public int compare(LoptMultiJoin.Edge e0, LoptMultiJoin.Edge e1) { + @Override public int compare(LoptMultiJoin.Edge e0, LoptMultiJoin.Edge e1) { return Double.compare(rowCountDiff(e0), rowCountDiff(e1)); } diff --git a/core/src/main/java/org/apache/calcite/rel/rules/ProjectTableScanRule.java b/core/src/main/java/org/apache/calcite/rel/rules/ProjectTableScanRule.java index 8614f69098f..4d9129a1a77 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/ProjectTableScanRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/ProjectTableScanRule.java @@ -103,7 +103,7 @@ protected void apply(RelOptRuleCall call, Project project, TableScan scan) { final List selectedColumns = new ArrayList<>(); final RexVisitorImpl visitor = new RexVisitorImpl(true) { - public Void visitInputRef(RexInputRef inputRef) { + @Override public Void visitInputRef(RexInputRef inputRef) { if (!selectedColumns.contains(inputRef.getIndex())) { selectedColumns.add(inputRef.getIndex()); } diff --git a/core/src/main/java/org/apache/calcite/rel/rules/ProjectToWindowRule.java b/core/src/main/java/org/apache/calcite/rel/rules/ProjectToWindowRule.java index e188b7d9a6b..5ee5c9e3892 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/ProjectToWindowRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/ProjectToWindowRule.java @@ -206,23 +206,23 @@ public interface Config extends ProjectToWindowRule.Config { static class WindowedAggRelSplitter extends CalcRelSplitter { private static final RelType[] REL_TYPES = { new RelType("CalcRelType") { - protected boolean canImplement(RexFieldAccess field) { + @Override protected boolean canImplement(RexFieldAccess field) { return true; } - protected boolean canImplement(RexDynamicParam param) { + @Override protected boolean canImplement(RexDynamicParam param) { return true; } - protected boolean canImplement(RexLiteral literal) { + @Override protected boolean canImplement(RexLiteral literal) { return true; } - protected boolean canImplement(RexCall call) { + @Override protected boolean canImplement(RexCall call) { return !(call instanceof RexOver); } - protected RelNode makeRel(RelOptCluster cluster, + @Override protected RelNode makeRel(RelOptCluster cluster, RelTraitSet traitSet, RelBuilder relBuilder, RelNode input, RexProgram program) { assert !program.containsAggs(); @@ -232,27 +232,27 @@ protected RelNode makeRel(RelOptCluster cluster, } }, new RelType("WinAggRelType") { - protected boolean canImplement(RexFieldAccess field) { + @Override protected boolean canImplement(RexFieldAccess field) { return false; } - protected boolean canImplement(RexDynamicParam param) { + @Override protected boolean canImplement(RexDynamicParam param) { return false; } - protected boolean canImplement(RexLiteral literal) { + @Override protected boolean canImplement(RexLiteral literal) { return false; } - protected boolean canImplement(RexCall call) { + @Override protected boolean canImplement(RexCall call) { return call instanceof RexOver; } - protected boolean supportsCondition() { + @Override protected boolean supportsCondition() { return false; } - protected RelNode makeRel(RelOptCluster cluster, RelTraitSet traitSet, + @Override protected RelNode makeRel(RelOptCluster cluster, RelTraitSet traitSet, RelBuilder relBuilder, RelNode input, RexProgram program) { Preconditions.checkArgument(program.getCondition() == null, "WindowedAggregateRel cannot accept a condition"); @@ -373,7 +373,7 @@ private DirectedGraph createGraphFromExpression( } new RexBiVisitorImpl(true) { - public Void visitLocalRef(RexLocalRef localRef, Integer i) { + @Override public Void visitLocalRef(RexLocalRef localRef, Integer i) { graph.addEdge(localRef.getIndex(), i); return null; } 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 58075401684..51b4767cca1 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 @@ -691,7 +691,7 @@ private class InputSpecialOpFinder extends RexVisitorImpl { this.strong = Strong.of(strongFields); } - public Void visitCall(RexCall call) { + @Override public Void visitCall(RexCall call) { if (preserve(call)) { return null; } @@ -737,7 +737,7 @@ private boolean preserve(RexNode call) { return false; } - public Void visitInputRef(RexInputRef inputRef) { + @Override public Void visitInputRef(RexInputRef inputRef) { rexRefs.set(inputRef.getIndex()); return null; } @@ -770,7 +770,7 @@ private class RefAndExprConverter extends RelOptUtil.RexInputConverter { this.firstRightRef = firstRightRef; } - public RexNode visitCall(RexCall call) { + @Override public RexNode visitCall(RexCall call) { // if the expression corresponds to one that needs to be preserved, // convert it to a field reference; otherwise, convert the entire // expression @@ -837,7 +837,7 @@ public interface ExprCondition extends Predicate { * @param expr Expression * @return result of evaluating the condition */ - boolean test(RexNode expr); + @Override boolean test(RexNode expr); /** * Constant condition that replies {@code false} for all expressions. @@ -866,7 +866,7 @@ class OperatorExprCondition implements ExprCondition { this.operatorSet = ImmutableSet.copyOf(operatorSet); } - public boolean test(RexNode expr) { + @Override public boolean test(RexNode expr) { return expr instanceof RexCall && operatorSet.contains(((RexCall) expr).getOperator()); } diff --git a/core/src/main/java/org/apache/calcite/rel/rules/ReduceDecimalsRule.java b/core/src/main/java/org/apache/calcite/rel/rules/ReduceDecimalsRule.java index bbf1c8442b1..f7903c3bff5 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/ReduceDecimalsRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/ReduceDecimalsRule.java @@ -146,7 +146,7 @@ public static class DecimalShuttle extends RexShuttle { * * */ - public RexNode visitCall(RexCall call) { + @Override public RexNode visitCall(RexCall call) { RexNode savedResult = lookup(call); if (savedResult != null) { return savedResult; @@ -721,7 +721,7 @@ private CastExpander(RexBuilder builder) { } // implement RexExpander - public RexNode expand(RexCall call) { + @Override public RexNode expand(RexCall call) { List operands = call.operands; assert call.isA(SqlKind.CAST); assert operands.size() == 1; @@ -1010,7 +1010,7 @@ private FloorExpander(RexBuilder rexBuilder) { super(rexBuilder); } - public RexNode expand(RexCall call) { + @Override public RexNode expand(RexCall call) { assert call.getOperator() == SqlStdOperatorTable.FLOOR; RexNode decValue = call.operands.get(0); int scale = decValue.getType().getScale(); @@ -1060,7 +1060,7 @@ private CeilExpander(RexBuilder rexBuilder) { super(rexBuilder); } - public RexNode expand(RexCall call) { + @Override public RexNode expand(RexCall call) { assert call.getOperator() == SqlStdOperatorTable.CEIL; RexNode decValue = call.operands.get(0); int scale = decValue.getType().getScale(); @@ -1111,7 +1111,7 @@ private CaseExpander(RexBuilder rexBuilder) { super(rexBuilder); } - public RexNode expand(RexCall call) { + @Override public RexNode expand(RexCall call) { RelDataType retType = call.getType(); int argCount = call.operands.size(); ImmutableList.Builder opBuilder = ImmutableList.builder(); @@ -1152,7 +1152,7 @@ private PassThroughExpander(RexBuilder builder) { return RexUtil.requiresDecimalExpansion(call, false); } - public RexNode expand(RexCall call) { + @Override public RexNode expand(RexCall call) { ImmutableList.Builder opBuilder = ImmutableList.builder(); for (RexNode operand : call.operands) { if (SqlTypeUtil.isNumeric(operand.getType())) { @@ -1183,7 +1183,7 @@ private CastArgAsDoubleExpander(RexBuilder builder) { super(builder); } - public RelDataType getArgType(RexCall call, int ordinal) { + @Override public RelDataType getArgType(RexCall call, int ordinal) { RelDataType type = real8; if (call.operands.get(ordinal).getType().isNullable()) { type = diff --git a/core/src/main/java/org/apache/calcite/rel/rules/ReduceExpressionsRule.java b/core/src/main/java/org/apache/calcite/rel/rules/ReduceExpressionsRule.java index 4c009473d30..0074a8b97ae 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/ReduceExpressionsRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/ReduceExpressionsRule.java @@ -447,7 +447,7 @@ public CalcReduceExpressionsRule(Class calcClass, final List expandedExprList = new ArrayList<>(); final RexShuttle shuttle = new RexShuttle() { - public RexNode visitLocalRef(RexLocalRef localRef) { + @Override public RexNode visitLocalRef(RexLocalRef localRef) { return expandedExprList.get(localRef.getIndex()); } }; 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 dcd6d2c2c70..6550a73d84a 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 @@ -237,7 +237,7 @@ protected void apply(RelOptRuleCall call, LogicalProject project, private static class MyRexShuttle extends RexShuttle { private List literalList; - public RexNode visitInputRef(RexInputRef inputRef) { + @Override public RexNode visitInputRef(RexInputRef inputRef) { return literalList.get(inputRef.getIndex()); } } diff --git a/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewProjectFilterRule.java b/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewProjectFilterRule.java index e73fad09f68..e4021447aff 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewProjectFilterRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewProjectFilterRule.java @@ -64,7 +64,7 @@ public interface Config extends MaterializedViewJoinRule.Config { .withFastBailOut(true) .as(Config.class); - default MaterializedViewProjectFilterRule toRule() { + @Override default MaterializedViewProjectFilterRule toRule() { return new MaterializedViewProjectFilterRule(this); } } diff --git a/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewProjectJoinRule.java b/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewProjectJoinRule.java index 352af89b9be..17b8e14250b 100644 --- a/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewProjectJoinRule.java +++ b/core/src/main/java/org/apache/calcite/rel/rules/materialize/MaterializedViewProjectJoinRule.java @@ -64,7 +64,7 @@ public interface Config extends MaterializedViewJoinRule.Config { .withFastBailOut(true) .as(Config.class); - default MaterializedViewProjectJoinRule toRule() { + @Override default MaterializedViewProjectJoinRule toRule() { return new MaterializedViewProjectJoinRule(this); } } 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 14bae0e70ed..1951ca4af16 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 @@ -1348,7 +1348,7 @@ protected static class Edge extends DefaultEdge { super(source, target); } - public String toString() { + @Override public String toString() { return "{" + source + " -> " + target + "}"; } } diff --git a/core/src/main/java/org/apache/calcite/rel/type/DelegatingTypeSystem.java b/core/src/main/java/org/apache/calcite/rel/type/DelegatingTypeSystem.java index ba3b45b9ca5..74b02c52fcd 100644 --- a/core/src/main/java/org/apache/calcite/rel/type/DelegatingTypeSystem.java +++ b/core/src/main/java/org/apache/calcite/rel/type/DelegatingTypeSystem.java @@ -28,70 +28,70 @@ protected DelegatingTypeSystem(RelDataTypeSystem typeSystem) { this.typeSystem = typeSystem; } - public int getMaxScale(SqlTypeName typeName) { + @Override public int getMaxScale(SqlTypeName typeName) { return typeSystem.getMaxScale(typeName); } - public int getDefaultPrecision(SqlTypeName typeName) { + @Override public int getDefaultPrecision(SqlTypeName typeName) { return typeSystem.getDefaultPrecision(typeName); } - public int getMaxPrecision(SqlTypeName typeName) { + @Override public int getMaxPrecision(SqlTypeName typeName) { return typeSystem.getMaxPrecision(typeName); } - public int getMaxNumericScale() { + @Override public int getMaxNumericScale() { return typeSystem.getMaxNumericScale(); } - public int getMaxNumericPrecision() { + @Override public int getMaxNumericPrecision() { return typeSystem.getMaxNumericPrecision(); } - public String getLiteral(SqlTypeName typeName, boolean isPrefix) { + @Override public String getLiteral(SqlTypeName typeName, boolean isPrefix) { return typeSystem.getLiteral(typeName, isPrefix); } - public boolean isCaseSensitive(SqlTypeName typeName) { + @Override public boolean isCaseSensitive(SqlTypeName typeName) { return typeSystem.isCaseSensitive(typeName); } - public boolean isAutoincrement(SqlTypeName typeName) { + @Override public boolean isAutoincrement(SqlTypeName typeName) { return typeSystem.isAutoincrement(typeName); } - public int getNumTypeRadix(SqlTypeName typeName) { + @Override public int getNumTypeRadix(SqlTypeName typeName) { return typeSystem.getNumTypeRadix(typeName); } - public RelDataType deriveSumType(RelDataTypeFactory typeFactory, + @Override public RelDataType deriveSumType(RelDataTypeFactory typeFactory, RelDataType argumentType) { return typeSystem.deriveSumType(typeFactory, argumentType); } - public RelDataType deriveAvgAggType(RelDataTypeFactory typeFactory, + @Override public RelDataType deriveAvgAggType(RelDataTypeFactory typeFactory, RelDataType argumentType) { return typeSystem.deriveAvgAggType(typeFactory, argumentType); } - public RelDataType deriveCovarType(RelDataTypeFactory typeFactory, + @Override public RelDataType deriveCovarType(RelDataTypeFactory typeFactory, RelDataType arg0Type, RelDataType arg1Type) { return typeSystem.deriveCovarType(typeFactory, arg0Type, arg1Type); } - public RelDataType deriveFractionalRankType(RelDataTypeFactory typeFactory) { + @Override public RelDataType deriveFractionalRankType(RelDataTypeFactory typeFactory) { return typeSystem.deriveFractionalRankType(typeFactory); } - public RelDataType deriveRankType(RelDataTypeFactory typeFactory) { + @Override public RelDataType deriveRankType(RelDataTypeFactory typeFactory) { return typeSystem.deriveRankType(typeFactory); } - public boolean isSchemaCaseSensitive() { + @Override public boolean isSchemaCaseSensitive() { return typeSystem.isSchemaCaseSensitive(); } - public boolean shouldConvertRaggedUnionTypesToVarying() { + @Override public boolean shouldConvertRaggedUnionTypesToVarying() { return typeSystem.shouldConvertRaggedUnionTypesToVarying(); } } diff --git a/core/src/main/java/org/apache/calcite/rel/type/DynamicRecordType.java b/core/src/main/java/org/apache/calcite/rel/type/DynamicRecordType.java index 196e3a00f26..a76e147c559 100644 --- a/core/src/main/java/org/apache/calcite/rel/type/DynamicRecordType.java +++ b/core/src/main/java/org/apache/calcite/rel/type/DynamicRecordType.java @@ -26,7 +26,7 @@ public abstract class DynamicRecordType extends RelDataTypeImpl { // The prefix string for dynamic star column name public static final String DYNAMIC_STAR_PREFIX = "**"; - public boolean isDynamicStruct() { + @Override public boolean isDynamicStruct() { return true; } diff --git a/core/src/main/java/org/apache/calcite/rel/type/DynamicRecordTypeImpl.java b/core/src/main/java/org/apache/calcite/rel/type/DynamicRecordTypeImpl.java index 36a960f8f8e..7ef18134d0a 100644 --- a/core/src/main/java/org/apache/calcite/rel/type/DynamicRecordTypeImpl.java +++ b/core/src/main/java/org/apache/calcite/rel/type/DynamicRecordTypeImpl.java @@ -73,7 +73,7 @@ public DynamicRecordTypeImpl(RelDataTypeFactory typeFactory) { return new SqlTypeExplicitPrecedenceList(ImmutableList.of()); } - protected void generateTypeString(StringBuilder sb, boolean withDetail) { + @Override protected void generateTypeString(StringBuilder sb, boolean withDetail) { sb.append("(DynamicRecordRow").append(getFieldNames()).append(")"); } 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 6af0d96a0b6..5c8fcd8fe93 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 @@ -57,7 +57,7 @@ public RelCrossType( return false; } - protected void generateTypeString(StringBuilder sb, boolean withDetail) { + @Override protected void generateTypeString(StringBuilder sb, boolean withDetail) { sb.append("CrossType("); for (Ord type : Ord.zip(types)) { if (type.i > 0) { 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 07223dc82f3..21fe0e13445 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 @@ -207,7 +207,7 @@ RelDataTypeField getField(String fieldName, boolean caseSensitive, * * @return abbreviated type string */ - String toString(); + @Override String toString(); /** * Gets a string representation of this type with full detail such as 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 1cd3a2085c3..0f5ff19cf64 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 @@ -109,12 +109,12 @@ protected RelDataTypeFactoryImpl(RelDataTypeSystem typeSystem) { //~ Methods ---------------------------------------------------------------- - public RelDataTypeSystem getTypeSystem() { + @Override public RelDataTypeSystem getTypeSystem() { return typeSystem; } // implement RelDataTypeFactory - public RelDataType createJavaType(Class clazz) { + @Override public RelDataType createJavaType(Class clazz) { final JavaType javaType = clazz == String.class ? new JavaType(clazz, true, getDefaultCharset(), @@ -124,7 +124,7 @@ public RelDataType createJavaType(Class clazz) { } // implement RelDataTypeFactory - public RelDataType createJoinType(RelDataType... types) { + @Override public RelDataType createJoinType(RelDataType... types) { assert types != null; assert types.length >= 1; final List flattenedTypes = new ArrayList<>(); @@ -133,14 +133,14 @@ public RelDataType createJoinType(RelDataType... types) { new RelCrossType(flattenedTypes, getFieldList(flattenedTypes))); } - public RelDataType createStructType( + @Override public RelDataType createStructType( final List typeList, final List fieldNameList) { return createStructType(StructKind.FULLY_QUALIFIED, typeList, fieldNameList); } - public RelDataType createStructType(StructKind kind, + @Override public RelDataType createStructType(StructKind kind, final List typeList, final List fieldNameList) { return createStructType(kind, typeList, @@ -156,7 +156,7 @@ private RelDataType createStructType(StructKind kind, } @SuppressWarnings("deprecation") - public RelDataType createStructType( + @Override public RelDataType createStructType( final RelDataTypeFactory.FieldInfo fieldInfo) { return canonize(StructKind.FULLY_QUALIFIED, new AbstractList() { @@ -179,7 +179,7 @@ public RelDataType createStructType( }); } - public final RelDataType createStructType( + @Override public final RelDataType createStructType( final List> fieldList) { return createStructType(fieldList, false); } @@ -207,7 +207,7 @@ private RelDataType createStructType( }, nullable); } - public RelDataType leastRestrictive(List types) { + @Override public RelDataType leastRestrictive(List types) { assert types != null; assert types.size() >= 1; RelDataType type0 = types.get(0); @@ -245,11 +245,11 @@ protected RelDataType leastRestrictiveStructuredType( type0.getFieldList().get(j).getName(), leastRestrictive( new AbstractList() { - public RelDataType get(int index) { + @Override public RelDataType get(int index) { return types.get(index).getFieldList().get(k).getType(); } - public int size() { + @Override public int size() { return types.size(); } })); @@ -310,12 +310,12 @@ private RelDataType copyRecordType( } // implement RelDataTypeFactory - public RelDataType copyType(RelDataType type) { + @Override public RelDataType copyType(RelDataType type) { return createTypeWithNullability(type, type.isNullable()); } // implement RelDataTypeFactory - public RelDataType createTypeWithNullability( + @Override public RelDataType createTypeWithNullability( final RelDataType type, final boolean nullable) { Objects.requireNonNull(type); @@ -460,7 +460,7 @@ private List fieldsOf(Class clazz) { * {@link RelDataTypeSystem#deriveDecimalMultiplyType(RelDataTypeFactory, RelDataType, RelDataType)} * to get the return type for the operation. */ - @Deprecated + @Override @Deprecated public RelDataType createDecimalProduct( RelDataType type1, RelDataType type2) { @@ -473,7 +473,7 @@ public RelDataType createDecimalProduct( * to get if double should be used for multiplication. */ @Deprecated - public boolean useDoubleMultiplication( + @Override public boolean useDoubleMultiplication( RelDataType type1, RelDataType type2) { return typeSystem.shouldUseDoubleMultiplication(this, type1, type2); @@ -484,14 +484,14 @@ public boolean useDoubleMultiplication( * {@link RelDataTypeSystem#deriveDecimalDivideType(RelDataTypeFactory, RelDataType, RelDataType)} * to get the return type for the operation. */ - @Deprecated + @Override @Deprecated public RelDataType createDecimalQuotient( RelDataType type1, RelDataType type2) { return typeSystem.deriveDecimalDivideType(this, type1, type2); } - public RelDataType decimalOf(RelDataType type) { + @Override public RelDataType decimalOf(RelDataType type) { // create decimal type and sync nullability return createTypeWithNullability(decimalOf2(type), type.isNullable()); } @@ -530,12 +530,12 @@ private RelDataType decimalOf2(RelDataType type) { } } - public Charset getDefaultCharset() { + @Override public Charset getDefaultCharset() { return Util.getDefaultCharset(); } @SuppressWarnings("deprecation") - public FieldInfoBuilder builder() { + @Override public FieldInfoBuilder builder() { return new FieldInfoBuilder(this); } @@ -581,7 +581,7 @@ public Class getJavaClass() { return clazz; } - public boolean isNullable() { + @Override public boolean isNullable() { return nullable; } @@ -590,13 +590,13 @@ public boolean isNullable() { return family != null ? family : this; } - protected void generateTypeString(StringBuilder sb, boolean withDetail) { + @Override protected void generateTypeString(StringBuilder sb, boolean withDetail) { sb.append("JavaType("); sb.append(clazz); sb.append(")"); } - public RelDataType getComponentType() { + @Override public RelDataType getComponentType() { final Class componentType = clazz.getComponentType(); if (componentType == null) { return null; @@ -631,15 +631,15 @@ public RelDataType getComponentType() { } } - public Charset getCharset() { + @Override public Charset getCharset() { return this.charset; } - public SqlCollation getCollation() { + @Override public SqlCollation getCollation() { return this.collation; } - public SqlTypeName getSqlTypeName() { + @Override public SqlTypeName getSqlTypeName() { final SqlTypeName typeName = JavaToSqlTypeConversionRules.instance().lookup(clazz); if (typeName == null) { diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFieldImpl.java b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFieldImpl.java index 4d1ac981376..909da959a4c 100644 --- a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFieldImpl.java +++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFieldImpl.java @@ -67,41 +67,41 @@ public RelDataTypeFieldImpl( } // implement RelDataTypeField - public String getName() { + @Override public String getName() { return name; } // implement RelDataTypeField - public int getIndex() { + @Override public int getIndex() { return index; } // implement RelDataTypeField - public RelDataType getType() { + @Override public RelDataType getType() { return type; } // implement Map.Entry - public final String getKey() { + @Override public final String getKey() { return getName(); } // implement Map.Entry - public final RelDataType getValue() { + @Override public final RelDataType getValue() { return getType(); } // implement Map.Entry - public RelDataType setValue(RelDataType value) { + @Override public RelDataType setValue(RelDataType value) { throw new UnsupportedOperationException(); } // for debugging - public String toString() { + @Override public String toString() { return "#" + index + ": " + name + " " + type; } - public boolean isDynamicStar() { + @Override public boolean isDynamicStar() { return type.getSqlTypeName() == SqlTypeName.DYNAMIC_STAR; } 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 979d8a2f927..512b0e6f7f4 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 @@ -77,7 +77,7 @@ protected RelDataTypeImpl() { //~ Methods ---------------------------------------------------------------- - public RelDataTypeField getField(String fieldName, boolean caseSensitive, + @Override public RelDataTypeField getField(String fieldName, boolean caseSensitive, boolean elideRecord) { for (RelDataTypeField field : fieldList) { if (Util.matches(caseSensitive, field.getName(), fieldName)) { @@ -142,41 +142,41 @@ private static void getFieldRecurse(List slots, RelDataType type, } } - public List getFieldList() { + @Override public List getFieldList() { assert fieldList != null : "fieldList must not be null, type = " + this; return fieldList; } - public List getFieldNames() { + @Override public List getFieldNames() { assert fieldList != null : "fieldList must not be null, type = " + this; return Pair.left(fieldList); } - public int getFieldCount() { + @Override public int getFieldCount() { assert fieldList != null : "fieldList must not be null, type = " + this; return fieldList.size(); } - public StructKind getStructKind() { + @Override public StructKind getStructKind() { return isStruct() ? StructKind.FULLY_QUALIFIED : StructKind.NONE; } - public RelDataType getComponentType() { + @Override public RelDataType getComponentType() { // this is not a collection type return null; } - public RelDataType getKeyType() { + @Override public RelDataType getKeyType() { // this is not a map type return null; } - public RelDataType getValueType() { + @Override public RelDataType getValueType() { // this is not a map type return null; } - public boolean isStruct() { + @Override public boolean isStruct() { return fieldList != null; } @@ -190,31 +190,31 @@ public boolean isStruct() { return digest.hashCode(); } - public String getFullTypeString() { + @Override public String getFullTypeString() { return digest; } - public boolean isNullable() { + @Override public boolean isNullable() { return false; } - public Charset getCharset() { + @Override public Charset getCharset() { return null; } - public SqlCollation getCollation() { + @Override public SqlCollation getCollation() { return null; } - public SqlIntervalQualifier getIntervalQualifier() { + @Override public SqlIntervalQualifier getIntervalQualifier() { return null; } - public int getPrecision() { + @Override public int getPrecision() { return PRECISION_NOT_SPECIFIED; } - public int getScale() { + @Override public int getScale() { return SCALE_NOT_SPECIFIED; } @@ -224,11 +224,11 @@ public int getScale() { * * @return SqlTypeName, never null */ - public SqlTypeName getSqlTypeName() { + @Override public SqlTypeName getSqlTypeName() { return null; } - public SqlIdentifier getSqlIdentifier() { + @Override public SqlIdentifier getSqlIdentifier() { SqlTypeName typeName = getSqlTypeName(); if (typeName == null) { return null; @@ -238,7 +238,7 @@ public SqlIdentifier getSqlIdentifier() { SqlParserPos.ZERO); } - public RelDataTypeFamily getFamily() { + @Override public RelDataTypeFamily getFamily() { // by default, put each type into its own family return this; } @@ -274,15 +274,15 @@ protected void computeDigest() { return sb.toString(); } - public RelDataTypePrecedenceList getPrecedenceList() { + @Override public RelDataTypePrecedenceList getPrecedenceList() { // by default, make each type have a precedence list containing // only other types in the same family return new RelDataTypePrecedenceList() { - public boolean containsType(RelDataType type) { + @Override public boolean containsType(RelDataType type) { return getFamily() == type.getFamily(); } - public int compareTypePrecedence( + @Override public int compareTypePrecedence( RelDataType type1, RelDataType type2) { assert containsType(type1); @@ -292,7 +292,7 @@ public int compareTypePrecedence( }; } - public RelDataTypeComparability getComparability() { + @Override public RelDataTypeComparability getComparability() { return RelDataTypeComparability.ALL; } @@ -379,7 +379,7 @@ public static RelDataTypeField extra(RelDataType rowType) { return rowType.getField("_extra", true, false); } - public boolean isDynamicStruct() { + @Override public boolean isDynamicStruct() { return false; } diff --git a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeSystemImpl.java b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeSystemImpl.java index 32cbc34edce..65c32aaedb7 100644 --- a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeSystemImpl.java +++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeSystemImpl.java @@ -34,7 +34,7 @@ * */ public abstract class RelDataTypeSystemImpl implements RelDataTypeSystem { - public int getMaxScale(SqlTypeName typeName) { + @Override public int getMaxScale(SqlTypeName typeName) { switch (typeName) { case DECIMAL: return getMaxNumericScale(); @@ -256,11 +256,11 @@ && getDefaultPrecision(typeName) != -1) { typeFactory.createSqlType(SqlTypeName.BIGINT), false); } - public boolean isSchemaCaseSensitive() { + @Override public boolean isSchemaCaseSensitive() { return true; } - public boolean shouldConvertRaggedUnionTypesToVarying() { + @Override public boolean shouldConvertRaggedUnionTypesToVarying() { return false; } 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 751e6a10725..55da7154a45 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 @@ -84,7 +84,7 @@ public RelRecordType(List fields) { return kind; } - protected void generateTypeString(StringBuilder sb, boolean withDetail) { + @Override protected void generateTypeString(StringBuilder sb, boolean withDetail) { sb.append("RecordType"); switch (kind) { case PEEK_FIELDS: diff --git a/core/src/main/java/org/apache/calcite/rex/RexBiVisitorImpl.java b/core/src/main/java/org/apache/calcite/rex/RexBiVisitorImpl.java index ed5ba2694e4..83a834308e7 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexBiVisitorImpl.java +++ b/core/src/main/java/org/apache/calcite/rex/RexBiVisitorImpl.java @@ -36,19 +36,19 @@ protected RexBiVisitorImpl(boolean deep) { //~ Methods ---------------------------------------------------------------- - public R visitInputRef(RexInputRef inputRef, P arg) { + @Override public R visitInputRef(RexInputRef inputRef, P arg) { return null; } - public R visitLocalRef(RexLocalRef localRef, P arg) { + @Override public R visitLocalRef(RexLocalRef localRef, P arg) { return null; } - public R visitLiteral(RexLiteral literal, P arg) { + @Override public R visitLiteral(RexLiteral literal, P arg) { return null; } - public R visitOver(RexOver over, P arg) { + @Override public R visitOver(RexOver over, P arg) { R r = visitCall(over, arg); if (!deep) { return null; @@ -65,11 +65,11 @@ public R visitOver(RexOver over, P arg) { return r; } - public R visitCorrelVariable(RexCorrelVariable correlVariable, P arg) { + @Override public R visitCorrelVariable(RexCorrelVariable correlVariable, P arg) { return null; } - public R visitCall(RexCall call, P arg) { + @Override public R visitCall(RexCall call, P arg) { if (!deep) { return null; } @@ -81,15 +81,15 @@ public R visitCall(RexCall call, P arg) { return r; } - public R visitDynamicParam(RexDynamicParam dynamicParam, P arg) { + @Override public R visitDynamicParam(RexDynamicParam dynamicParam, P arg) { return null; } - public R visitRangeRef(RexRangeRef rangeRef, P arg) { + @Override public R visitRangeRef(RexRangeRef rangeRef, P arg) { return null; } - public R visitFieldAccess(RexFieldAccess fieldAccess, P arg) { + @Override public R visitFieldAccess(RexFieldAccess fieldAccess, P arg) { if (!deep) { return null; } @@ -97,7 +97,7 @@ public R visitFieldAccess(RexFieldAccess fieldAccess, P arg) { return expr.accept(this, arg); } - public R visitSubQuery(RexSubQuery subQuery, P arg) { + @Override public R visitSubQuery(RexSubQuery subQuery, P arg) { if (!deep) { return null; } 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 8d21072feaa..5bea803685a 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexCall.java +++ b/core/src/main/java/org/apache/calcite/rex/RexCall.java @@ -170,15 +170,15 @@ private boolean digestWithType() { return isA(SqlKind.CAST) || isA(SqlKind.NEW_SPECIFICATION); } - public R accept(RexVisitor visitor) { + @Override public R accept(RexVisitor visitor) { return visitor.visitCall(this); } - public R accept(RexBiVisitor visitor, P arg) { + @Override public R accept(RexBiVisitor visitor, P arg) { return visitor.visitCall(this, arg); } - public RelDataType getType() { + @Override public RelDataType getType() { return type; } @@ -218,7 +218,7 @@ public RelDataType getType() { } } - public SqlKind getKind() { + @Override public SqlKind getKind() { return op.kind; } diff --git a/core/src/main/java/org/apache/calcite/rex/RexCallBinding.java b/core/src/main/java/org/apache/calcite/rex/RexCallBinding.java index a4316526740..da51ac6868c 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexCallBinding.java +++ b/core/src/main/java/org/apache/calcite/rex/RexCallBinding.java @@ -127,16 +127,16 @@ public List operands() { } // implement SqlOperatorBinding - public int getOperandCount() { + @Override public int getOperandCount() { return operands.size(); } // implement SqlOperatorBinding - public RelDataType getOperandType(int ordinal) { + @Override public RelDataType getOperandType(int ordinal) { return operands.get(ordinal).getType(); } - public CalciteException newError( + @Override public CalciteException newError( Resources.ExInst e) { return SqlUtil.newContextException(SqlParserPos.ZERO, e); } diff --git a/core/src/main/java/org/apache/calcite/rex/RexCopier.java b/core/src/main/java/org/apache/calcite/rex/RexCopier.java index 8a371fb0366..e73a68d5f6f 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexCopier.java +++ b/core/src/main/java/org/apache/calcite/rex/RexCopier.java @@ -48,49 +48,49 @@ private RelDataType copy(RelDataType type) { return builder.getTypeFactory().copyType(type); } - public RexNode visitOver(RexOver over) { + @Override public RexNode visitOver(RexOver over) { final boolean[] update = null; return new RexOver(copy(over.getType()), over.getAggOperator(), visitList(over.getOperands(), update), visitWindow(over.getWindow()), over.isDistinct(), over.ignoreNulls()); } - public RexNode visitCall(final RexCall call) { + @Override public RexNode visitCall(final RexCall call) { final boolean[] update = null; return builder.makeCall(copy(call.getType()), call.getOperator(), visitList(call.getOperands(), update)); } - public RexNode visitCorrelVariable(RexCorrelVariable variable) { + @Override public RexNode visitCorrelVariable(RexCorrelVariable variable) { return builder.makeCorrel(copy(variable.getType()), variable.id); } - public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { + @Override public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { return builder.makeFieldAccess(fieldAccess.getReferenceExpr().accept(this), fieldAccess.getField().getIndex()); } - public RexNode visitInputRef(RexInputRef inputRef) { + @Override public RexNode visitInputRef(RexInputRef inputRef) { return builder.makeInputRef(copy(inputRef.getType()), inputRef.getIndex()); } - public RexNode visitLocalRef(RexLocalRef localRef) { + @Override public RexNode visitLocalRef(RexLocalRef localRef) { return new RexLocalRef(localRef.getIndex(), copy(localRef.getType())); } - public RexNode visitLiteral(RexLiteral literal) { + @Override public RexNode visitLiteral(RexLiteral literal) { // Get the value as is return new RexLiteral(RexLiteral.value(literal), copy(literal.getType()), literal.getTypeName()); } - public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { + @Override public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { return builder.makeDynamicParam(copy(dynamicParam.getType()), dynamicParam.getIndex()); } - public RexNode visitRangeRef(RexRangeRef rangeRef) { + @Override public RexNode visitRangeRef(RexRangeRef rangeRef) { return builder.makeRangeReference(copy(rangeRef.getType()), rangeRef.getOffset(), false); } 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 7c3408cede4..2e2b35ae449 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexCorrelVariable.java +++ b/core/src/main/java/org/apache/calcite/rex/RexCorrelVariable.java @@ -43,11 +43,11 @@ public class RexCorrelVariable extends RexVariable { //~ Methods ---------------------------------------------------------------- - public R accept(RexVisitor visitor) { + @Override public R accept(RexVisitor visitor) { return visitor.visitCorrelVariable(this); } - public R accept(RexBiVisitor visitor, P arg) { + @Override public R accept(RexBiVisitor visitor, P arg) { return visitor.visitCorrelVariable(this, arg); } diff --git a/core/src/main/java/org/apache/calcite/rex/RexDynamicParam.java b/core/src/main/java/org/apache/calcite/rex/RexDynamicParam.java index dab2907c247..6477566ff32 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexDynamicParam.java +++ b/core/src/main/java/org/apache/calcite/rex/RexDynamicParam.java @@ -46,7 +46,7 @@ public RexDynamicParam( //~ Methods ---------------------------------------------------------------- - public SqlKind getKind() { + @Override public SqlKind getKind() { return SqlKind.DYNAMIC_PARAM; } @@ -54,11 +54,11 @@ public int getIndex() { return index; } - public R accept(RexVisitor visitor) { + @Override public R accept(RexVisitor visitor) { return visitor.visitDynamicParam(this); } - public R accept(RexBiVisitor visitor, P arg) { + @Override public R accept(RexBiVisitor visitor, P arg) { return visitor.visitDynamicParam(this, arg); } diff --git a/core/src/main/java/org/apache/calcite/rex/RexExecutorImpl.java b/core/src/main/java/org/apache/calcite/rex/RexExecutorImpl.java index c77033d3f5e..605c019771b 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexExecutorImpl.java +++ b/core/src/main/java/org/apache/calcite/rex/RexExecutorImpl.java @@ -123,7 +123,7 @@ public static RexExecutable getExecutable(RexBuilder rexBuilder, List e /** * Do constant reduction using generated code. */ - public void reduce(RexBuilder rexBuilder, List constExps, + @Override public void reduce(RexBuilder rexBuilder, List constExps, List reducedValues) { final String code = compile(rexBuilder, constExps, (list, index, storageType) -> { @@ -151,7 +151,7 @@ private static class DataContextInputGetter implements InputGetter { this.typeFactory = typeFactory; } - public Expression field(BlockBuilder list, int index, Type storageType) { + @Override public Expression field(BlockBuilder list, int index, Type storageType) { MethodCallExpression recFromCtx = Expressions.call( DataContext.ROOT, BuiltInMethod.DATA_CONTEXT_GET.method, diff --git a/core/src/main/java/org/apache/calcite/rex/RexFieldAccess.java b/core/src/main/java/org/apache/calcite/rex/RexFieldAccess.java index bd052020435..f8fc8f14db3 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexFieldAccess.java +++ b/core/src/main/java/org/apache/calcite/rex/RexFieldAccess.java @@ -80,19 +80,19 @@ public RelDataTypeField getField() { return field; } - public RelDataType getType() { + @Override public RelDataType getType() { return field.getType(); } - public SqlKind getKind() { + @Override public SqlKind getKind() { return SqlKind.FIELD_ACCESS; } - public R accept(RexVisitor visitor) { + @Override public R accept(RexVisitor visitor) { return visitor.visitFieldAccess(this); } - public R accept(RexBiVisitor visitor, P arg) { + @Override public R accept(RexBiVisitor visitor, P arg) { return visitor.visitFieldAccess(this, arg); } 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 e264a6d2181..d7124bd933c 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexInputRef.java +++ b/core/src/main/java/org/apache/calcite/rex/RexInputRef.java @@ -108,11 +108,11 @@ public static Pair of2( return SqlKind.INPUT_REF; } - public R accept(RexVisitor visitor) { + @Override public R accept(RexVisitor visitor) { return visitor.visitInputRef(this); } - public R accept(RexBiVisitor visitor, P arg) { + @Override public R accept(RexBiVisitor visitor, P arg) { return visitor.visitInputRef(this, arg); } diff --git a/core/src/main/java/org/apache/calcite/rex/RexInterpreter.java b/core/src/main/java/org/apache/calcite/rex/RexInterpreter.java index 11d91ae2764..f7336b12c8b 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexInterpreter.java +++ b/core/src/main/java/org/apache/calcite/rex/RexInterpreter.java @@ -90,51 +90,51 @@ private Comparable getOrUnbound(RexNode e) { throw unbound(e); } - public Comparable visitInputRef(RexInputRef inputRef) { + @Override public Comparable visitInputRef(RexInputRef inputRef) { return getOrUnbound(inputRef); } - public Comparable visitLocalRef(RexLocalRef localRef) { + @Override public Comparable visitLocalRef(RexLocalRef localRef) { throw unbound(localRef); } - public Comparable visitLiteral(RexLiteral literal) { + @Override public Comparable visitLiteral(RexLiteral literal) { return Util.first(literal.getValue4(), N); } - public Comparable visitOver(RexOver over) { + @Override public Comparable visitOver(RexOver over) { throw unbound(over); } - public Comparable visitCorrelVariable(RexCorrelVariable correlVariable) { + @Override public Comparable visitCorrelVariable(RexCorrelVariable correlVariable) { return getOrUnbound(correlVariable); } - public Comparable visitDynamicParam(RexDynamicParam dynamicParam) { + @Override public Comparable visitDynamicParam(RexDynamicParam dynamicParam) { return getOrUnbound(dynamicParam); } - public Comparable visitRangeRef(RexRangeRef rangeRef) { + @Override public Comparable visitRangeRef(RexRangeRef rangeRef) { throw unbound(rangeRef); } - public Comparable visitFieldAccess(RexFieldAccess fieldAccess) { + @Override public Comparable visitFieldAccess(RexFieldAccess fieldAccess) { return getOrUnbound(fieldAccess); } - public Comparable visitSubQuery(RexSubQuery subQuery) { + @Override public Comparable visitSubQuery(RexSubQuery subQuery) { throw unbound(subQuery); } - public Comparable visitTableInputRef(RexTableInputRef fieldRef) { + @Override public Comparable visitTableInputRef(RexTableInputRef fieldRef) { throw unbound(fieldRef); } - public Comparable visitPatternFieldRef(RexPatternFieldRef fieldRef) { + @Override public Comparable visitPatternFieldRef(RexPatternFieldRef fieldRef) { throw unbound(fieldRef); } - public Comparable visitCall(RexCall call) { + @Override public Comparable visitCall(RexCall call) { final List values = visitList(call.operands); switch (call.getKind()) { case IS_NOT_DISTINCT_FROM: 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 a4dd9c31fd7..d66336aab8b 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexLiteral.java +++ b/core/src/main/java/org/apache/calcite/rex/RexLiteral.java @@ -871,7 +871,7 @@ public SqlTypeName getTypeName() { return typeName; } - public RelDataType getType() { + @Override public RelDataType getType() { return type; } @@ -1114,21 +1114,21 @@ public static boolean booleanValue(RexNode node) { return (Boolean) ((RexLiteral) node).value; } - public boolean isAlwaysTrue() { + @Override public boolean isAlwaysTrue() { if (typeName != SqlTypeName.BOOLEAN) { return false; } return booleanValue(this); } - public boolean isAlwaysFalse() { + @Override public boolean isAlwaysFalse() { if (typeName != SqlTypeName.BOOLEAN) { return false; } return !booleanValue(this); } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { if (this == obj) { return true; } @@ -1137,7 +1137,7 @@ && equals(((RexLiteral) obj).value, value) && equals(((RexLiteral) obj).type, type); } - public int hashCode() { + @Override public int hashCode() { return Objects.hash(value, type); } @@ -1183,11 +1183,11 @@ private static boolean equals(Object o1, Object o2) { return Objects.equals(o1, o2); } - public R accept(RexVisitor visitor) { + @Override public R accept(RexVisitor visitor) { return visitor.visitLiteral(this); } - public R accept(RexBiVisitor visitor, P arg) { + @Override public R accept(RexBiVisitor visitor, P arg) { return visitor.visitLiteral(this, arg); } } diff --git a/core/src/main/java/org/apache/calcite/rex/RexLocalRef.java b/core/src/main/java/org/apache/calcite/rex/RexLocalRef.java index f242496e48e..7cc31e9d402 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexLocalRef.java +++ b/core/src/main/java/org/apache/calcite/rex/RexLocalRef.java @@ -60,22 +60,22 @@ public RexLocalRef(int index, RelDataType type) { return SqlKind.LOCAL_REF; } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { return this == obj || obj instanceof RexLocalRef && Objects.equals(this.type, ((RexLocalRef) obj).type) && this.index == ((RexLocalRef) obj).index; } - public int hashCode() { + @Override public int hashCode() { return Objects.hash(type, index); } - public R accept(RexVisitor visitor) { + @Override public R accept(RexVisitor visitor) { return visitor.visitLocalRef(this); } - public R accept(RexBiVisitor visitor, P arg) { + @Override public R accept(RexBiVisitor visitor, P arg) { return visitor.visitLocalRef(this, arg); } diff --git a/core/src/main/java/org/apache/calcite/rex/RexMultisetUtil.java b/core/src/main/java/org/apache/calcite/rex/RexMultisetUtil.java index f0606e2160f..953a00145df 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexMultisetUtil.java +++ b/core/src/main/java/org/apache/calcite/rex/RexMultisetUtil.java @@ -188,7 +188,7 @@ void reset() { multisetCount = 0; } - public Void visitCall(RexCall call) { + @Override public Void visitCall(RexCall call) { ++totalCount; if (MULTISET_OPERATORS.contains(call.getOperator())) { if (!call.getOperator().equals(SqlStdOperatorTable.CAST) 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 8a42b9d2ded..55bf69cd1e8 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexNode.java +++ b/core/src/main/java/org/apache/calcite/rex/RexNode.java @@ -79,7 +79,7 @@ public SqlKind getKind() { return SqlKind.OTHER; } - public String toString() { + @Override public String toString() { return digest; } diff --git a/core/src/main/java/org/apache/calcite/rex/RexOver.java b/core/src/main/java/org/apache/calcite/rex/RexOver.java index 6e006c9edd9..dcfee0b00c5 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexOver.java +++ b/core/src/main/java/org/apache/calcite/rex/RexOver.java @@ -117,11 +117,11 @@ public boolean ignoreNulls() { return sb.toString(); } - public R accept(RexVisitor visitor) { + @Override public R accept(RexVisitor visitor) { return visitor.visitOver(this); } - public R accept(RexBiVisitor visitor, P arg) { + @Override public R accept(RexBiVisitor visitor, P arg) { return visitor.visitOver(this, arg); } @@ -192,7 +192,7 @@ private static class Finder extends RexVisitorImpl { super(true); } - public Void visitOver(RexOver over) { + @Override public Void visitOver(RexOver over) { throw OverFound.INSTANCE; } } diff --git a/core/src/main/java/org/apache/calcite/rex/RexPermutationShuttle.java b/core/src/main/java/org/apache/calcite/rex/RexPermutationShuttle.java index 87dd07818d5..812a311e293 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexPermutationShuttle.java +++ b/core/src/main/java/org/apache/calcite/rex/RexPermutationShuttle.java @@ -37,7 +37,7 @@ public RexPermutationShuttle(Permutation permutation) { //~ Methods ---------------------------------------------------------------- - public RexNode visitLocalRef(RexLocalRef local) { + @Override public RexNode visitLocalRef(RexLocalRef local) { final int index = local.getIndex(); int target = permutation.getTarget(index); return new RexLocalRef( 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 24e41949df8..96a7267b0d5 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexProgram.java +++ b/core/src/main/java/org/apache/calcite/rex/RexProgram.java @@ -153,11 +153,11 @@ public List getProjectList() { */ public List> getNamedProjects() { return new AbstractList>() { - public int size() { + @Override public int size() { return projects.size(); } - public Pair get(int index) { + @Override public Pair get(int index) { return Pair.of( projects.get(index), outputRowType.getFieldList().get(index).getName()); @@ -247,7 +247,7 @@ public static RexProgram create(RelInput input) { } // description of this calc, chiefly intended for debugging - public String toString() { + @Override public String toString() { // Intended to produce similar output to explainCalc, // but without requiring a RelNode or RelOptPlanWriter. final RelWriterImpl pw = @@ -761,7 +761,7 @@ public Set getCorrelVariableNames() { final Set paramIdSet = new HashSet<>(); RexUtil.apply( new RexVisitorImpl(true) { - public Void visitCorrelVariable( + @Override public Void visitCorrelVariable( RexCorrelVariable correlVariable) { paramIdSet.add(correlVariable.getName()); return null; @@ -900,7 +900,7 @@ static class ExpansionShuttle extends RexShuttle { this.exprs = exprs; } - public RexNode visitLocalRef(RexLocalRef localRef) { + @Override public RexNode visitLocalRef(RexLocalRef localRef) { RexNode tree = exprs.get(localRef.getIndex()); return tree.accept(this); } @@ -935,20 +935,20 @@ private class Marshaller extends RexVisitorImpl { super(false); } - public RexNode visitInputRef(RexInputRef inputRef) { + @Override public RexNode visitInputRef(RexInputRef inputRef) { return inputRef; } - public RexNode visitLocalRef(RexLocalRef localRef) { + @Override public RexNode visitLocalRef(RexLocalRef localRef) { final RexNode expr = exprs.get(localRef.index); return expr.accept(this); } - public RexNode visitLiteral(RexLiteral literal) { + @Override public RexNode visitLiteral(RexLiteral literal) { return literal; } - public RexNode visitCall(RexCall call) { + @Override public RexNode visitCall(RexCall call) { final List newOperands = new ArrayList<>(); for (RexNode operand : call.getOperands()) { newOperands.add(operand.accept(this)); @@ -956,23 +956,23 @@ public RexNode visitCall(RexCall call) { return call.clone(call.getType(), newOperands); } - public RexNode visitOver(RexOver over) { + @Override public RexNode visitOver(RexOver over) { return visitCall(over); } - public RexNode visitCorrelVariable(RexCorrelVariable correlVariable) { + @Override public RexNode visitCorrelVariable(RexCorrelVariable correlVariable) { return correlVariable; } - public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { + @Override public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { return dynamicParam; } - public RexNode visitRangeRef(RexRangeRef rangeRef) { + @Override public RexNode visitRangeRef(RexRangeRef rangeRef) { return rangeRef; } - public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { + @Override public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { final RexNode referenceExpr = fieldAccess.getReferenceExpr().accept(this); return new RexFieldAccess( @@ -989,7 +989,7 @@ private class ReferenceCounter extends RexVisitorImpl { super(true); } - public Void visitLocalRef(RexLocalRef localRef) { + @Override public Void visitLocalRef(RexLocalRef localRef) { final int index = localRef.getIndex(); refCounts[index]++; return 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 488b2a0111b..1e63e3a4045 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexProgramBuilder.java +++ b/core/src/main/java/org/apache/calcite/rex/RexProgramBuilder.java @@ -164,7 +164,7 @@ private static boolean assertionsAreEnabled() { private void validate(final RexNode expr, final int fieldOrdinal) { final RexVisitor validator = new RexVisitorImpl(true) { - public Void visitInputRef(RexInputRef input) { + @Override public Void visitInputRef(RexInputRef input) { final int index = input.getIndex(); final List fields = inputRowType.getFieldList(); @@ -885,32 +885,32 @@ public List getProjectList() { /** Shuttle that visits a tree of {@link RexNode} and registers them * in a program. */ private abstract class RegisterShuttle extends RexShuttle { - public RexNode visitCall(RexCall call) { + @Override public RexNode visitCall(RexCall call) { final RexNode expr = super.visitCall(call); return registerInternal(expr, false); } - public RexNode visitOver(RexOver over) { + @Override public RexNode visitOver(RexOver over) { final RexNode expr = super.visitOver(over); return registerInternal(expr, false); } - public RexNode visitLiteral(RexLiteral literal) { + @Override public RexNode visitLiteral(RexLiteral literal) { final RexNode expr = super.visitLiteral(literal); return registerInternal(expr, false); } - public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { + @Override public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { final RexNode expr = super.visitFieldAccess(fieldAccess); return registerInternal(expr, false); } - public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { + @Override public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { final RexNode expr = super.visitDynamicParam(dynamicParam); return registerInternal(expr, false); } - public RexNode visitCorrelVariable(RexCorrelVariable variable) { + @Override public RexNode visitCorrelVariable(RexCorrelVariable variable) { final RexNode expr = super.visitCorrelVariable(variable); return registerInternal(expr, false); } @@ -928,7 +928,7 @@ protected RegisterInputShuttle(boolean valid) { this.valid = valid; } - public RexNode visitInputRef(RexInputRef input) { + @Override public RexNode visitInputRef(RexInputRef input) { final int index = input.getIndex(); if (valid) { // The expression should already be valid. Check that its @@ -954,7 +954,7 @@ public RexNode visitInputRef(RexInputRef input) { return ref; } - public RexNode visitLocalRef(RexLocalRef local) { + @Override public RexNode visitLocalRef(RexLocalRef local) { if (valid) { // The expression should already be valid. final int index = local.getIndex(); @@ -1003,7 +1003,7 @@ protected RegisterMidputShuttle( this.localExprList = localExprList; } - public RexNode visitLocalRef(RexLocalRef local) { + @Override public RexNode visitLocalRef(RexLocalRef local) { // Convert a local ref into the common-subexpression it references. final int index = local.getIndex(); return localExprList.get(index).accept(this); @@ -1023,7 +1023,7 @@ private class RegisterOutputShuttle extends RegisterShuttle { this.localExprList = localExprList; } - public RexNode visitInputRef(RexInputRef input) { + @Override public RexNode visitInputRef(RexInputRef input) { // This expression refers to the Nth project column. Lookup that // column and find out what common sub-expression IT refers to. final int index = input.getIndex(); @@ -1037,7 +1037,7 @@ public RexNode visitInputRef(RexInputRef input) { return local; } - public RexNode visitLocalRef(RexLocalRef local) { + @Override public RexNode visitLocalRef(RexLocalRef local) { // Convert a local ref into the common-subexpression it references. final int index = local.getIndex(); return localExprList.get(index).accept(this); @@ -1055,7 +1055,7 @@ private UpdateRefShuttle(List newRefs) { this.newRefs = newRefs; } - public RexNode visitLocalRef(RexLocalRef localRef) { + @Override public RexNode visitLocalRef(RexLocalRef localRef) { return newRefs.get(localRef.getIndex()); } } 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 3c57f95bba9..c64751a90aa 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexRangeRef.java +++ b/core/src/main/java/org/apache/calcite/rex/RexRangeRef.java @@ -61,7 +61,7 @@ public class RexRangeRef extends RexNode { //~ Methods ---------------------------------------------------------------- - public RelDataType getType() { + @Override public RelDataType getType() { return type; } @@ -69,11 +69,11 @@ public int getOffset() { return offset; } - public R accept(RexVisitor visitor) { + @Override public R accept(RexVisitor visitor) { return visitor.visitRangeRef(this); } - public R accept(RexBiVisitor visitor, P arg) { + @Override public R accept(RexBiVisitor visitor, P arg) { return visitor.visitRangeRef(this, arg); } 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 740c995588c..8936644d713 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 @@ public class RexShuttle implements RexVisitor { //~ Methods ---------------------------------------------------------------- - public RexNode visitOver(RexOver over) { + @Override public RexNode visitOver(RexOver over) { boolean[] update = {false}; List clonedOperands = visitList(over.operands, update); RexWindow window = visitWindow(over.getWindow()); @@ -87,7 +87,7 @@ public RexWindow visitWindow(RexWindow window) { rows); } - public RexNode visitSubQuery(RexSubQuery subQuery) { + @Override public RexNode visitSubQuery(RexSubQuery subQuery) { boolean[] update = {false}; List clonedOperands = visitList(subQuery.operands, update); if (update[0]) { @@ -105,7 +105,7 @@ public RexNode visitSubQuery(RexSubQuery subQuery) { return fieldRef; } - public RexNode visitCall(final RexCall call) { + @Override public RexNode visitCall(final RexCall call) { boolean[] update = {false}; List clonedOperands = visitList(call.operands, update); if (update[0]) { @@ -189,11 +189,11 @@ protected List visitFieldCollations( return clonedOperands.build(); } - public RexNode visitCorrelVariable(RexCorrelVariable variable) { + @Override public RexNode visitCorrelVariable(RexCorrelVariable variable) { return variable; } - public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { + @Override public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { RexNode before = fieldAccess.getReferenceExpr(); RexNode after = before.accept(this); @@ -206,23 +206,23 @@ public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { } } - public RexNode visitInputRef(RexInputRef inputRef) { + @Override public RexNode visitInputRef(RexInputRef inputRef) { return inputRef; } - public RexNode visitLocalRef(RexLocalRef localRef) { + @Override public RexNode visitLocalRef(RexLocalRef localRef) { return localRef; } - public RexNode visitLiteral(RexLiteral literal) { + @Override public RexNode visitLiteral(RexLiteral literal) { return literal; } - public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { + @Override public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { return dynamicParam; } - public RexNode visitRangeRef(RexRangeRef rangeRef) { + @Override public RexNode visitRangeRef(RexRangeRef rangeRef) { return rangeRef; } diff --git a/core/src/main/java/org/apache/calcite/rex/RexSlot.java b/core/src/main/java/org/apache/calcite/rex/RexSlot.java index 7ce5d491519..bf6dc1459cc 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexSlot.java +++ b/core/src/main/java/org/apache/calcite/rex/RexSlot.java @@ -71,11 +71,11 @@ private static AbstractList fromTo( final int start, final int end) { return new AbstractList() { - public String get(int index) { + @Override public String get(int index) { return prefix + (index + start); } - public int size() { + @Override public int size() { return end - start; } }; diff --git a/core/src/main/java/org/apache/calcite/rex/RexSqlReflectiveConvertletTable.java b/core/src/main/java/org/apache/calcite/rex/RexSqlReflectiveConvertletTable.java index 65d4fc673b7..1b2fdc00a80 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexSqlReflectiveConvertletTable.java +++ b/core/src/main/java/org/apache/calcite/rex/RexSqlReflectiveConvertletTable.java @@ -36,7 +36,7 @@ public RexSqlReflectiveConvertletTable() { //~ Methods ---------------------------------------------------------------- - public RexSqlConvertlet get(RexCall call) { + @Override public RexSqlConvertlet get(RexCall call) { RexSqlConvertlet convertlet; final SqlOperator op = call.getOperator(); diff --git a/core/src/main/java/org/apache/calcite/rex/RexSqlStandardConvertletTable.java b/core/src/main/java/org/apache/calcite/rex/RexSqlStandardConvertletTable.java index 217a6ff306c..952e1a76a4f 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexSqlStandardConvertletTable.java +++ b/core/src/main/java/org/apache/calcite/rex/RexSqlStandardConvertletTable.java @@ -249,7 +249,7 @@ private class EquivConvertlet implements RexSqlConvertlet { this.op = op; } - public SqlNode convertCall(RexToSqlNodeConverter converter, RexCall call) { + @Override public SqlNode convertCall(RexToSqlNodeConverter converter, RexCall call) { SqlNode[] operands = convertExpressionList(converter, call.operands); if (operands == null) { return null; 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 df1ae2959b0..378551bb5a2 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexSubQuery.java +++ b/core/src/main/java/org/apache/calcite/rex/RexSubQuery.java @@ -107,11 +107,11 @@ public static RexSubQuery scalar(RelNode rel) { ImmutableList.of(), rel); } - public R accept(RexVisitor visitor) { + @Override public R accept(RexVisitor visitor) { return visitor.visitSubQuery(this); } - public R accept(RexBiVisitor visitor, P arg) { + @Override public R accept(RexBiVisitor visitor, P arg) { return visitor.visitSubQuery(this, arg); } diff --git a/core/src/main/java/org/apache/calcite/rex/RexToSqlNodeConverterImpl.java b/core/src/main/java/org/apache/calcite/rex/RexToSqlNodeConverterImpl.java index 1b9c2e1c4ca..1dd4ae7fc9c 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexToSqlNodeConverterImpl.java +++ b/core/src/main/java/org/apache/calcite/rex/RexToSqlNodeConverterImpl.java @@ -42,7 +42,7 @@ public RexToSqlNodeConverterImpl(RexSqlConvertletTable convertletTable) { //~ Methods ---------------------------------------------------------------- // implement RexToSqlNodeConverter - public SqlNode convertNode(RexNode node) { + @Override public SqlNode convertNode(RexNode node) { if (node instanceof RexLiteral) { return convertLiteral((RexLiteral) node); } else if (node instanceof RexInputRef) { @@ -54,7 +54,7 @@ public SqlNode convertNode(RexNode node) { } // implement RexToSqlNodeConverter - public SqlNode convertCall(RexCall call) { + @Override public SqlNode convertCall(RexCall call) { final RexSqlConvertlet convertlet = convertletTable.get(call); if (convertlet != null) { return convertlet.convertCall(this, call); @@ -64,7 +64,7 @@ public SqlNode convertCall(RexCall call) { } // implement RexToSqlNodeConverter - public SqlNode convertLiteral(RexLiteral literal) { + @Override public SqlNode convertLiteral(RexLiteral literal) { // Numeric if (SqlTypeFamily.EXACT_NUMERIC.getTypeNames().contains( literal.getTypeName())) { @@ -131,7 +131,7 @@ public SqlNode convertLiteral(RexLiteral literal) { } // implement RexToSqlNodeConverter - public SqlNode convertInputRef(RexInputRef ref) { + @Override public SqlNode convertInputRef(RexInputRef ref) { return null; } } 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 d513be4ec00..586f2523ce2 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexUtil.java +++ b/core/src/main/java/org/apache/calcite/rex/RexUtil.java @@ -625,23 +625,23 @@ private static RexNode deref(RexProgram program, RexNode node) { static class ConstantFinder implements RexVisitor { static final ConstantFinder INSTANCE = new ConstantFinder(); - public Boolean visitLiteral(RexLiteral literal) { + @Override public Boolean visitLiteral(RexLiteral literal) { return true; } - public Boolean visitInputRef(RexInputRef inputRef) { + @Override public Boolean visitInputRef(RexInputRef inputRef) { return false; } - public Boolean visitLocalRef(RexLocalRef localRef) { + @Override public Boolean visitLocalRef(RexLocalRef localRef) { return false; } - public Boolean visitOver(RexOver over) { + @Override public Boolean visitOver(RexOver over) { return false; } - public Boolean visitSubQuery(RexSubQuery subQuery) { + @Override public Boolean visitSubQuery(RexSubQuery subQuery) { return false; } @@ -653,19 +653,19 @@ public Boolean visitSubQuery(RexSubQuery subQuery) { return false; } - public Boolean visitCorrelVariable(RexCorrelVariable correlVariable) { + @Override public Boolean visitCorrelVariable(RexCorrelVariable correlVariable) { // Correlating variables change when there is an internal restart. // Not good enough for our purposes. return false; } - public Boolean visitDynamicParam(RexDynamicParam dynamicParam) { + @Override public Boolean visitDynamicParam(RexDynamicParam dynamicParam) { // Dynamic parameters are constant WITHIN AN EXECUTION, so that's // good enough. return true; } - public Boolean visitCall(RexCall call) { + @Override public Boolean visitCall(RexCall call) { // Constant if operator meets the following conditions: // 1. It is deterministic; // 2. All its operands are constant. @@ -673,11 +673,11 @@ public Boolean visitCall(RexCall call) { && RexVisitorImpl.visitArrayAnd(this, call.getOperands()); } - public Boolean visitRangeRef(RexRangeRef rangeRef) { + @Override public Boolean visitRangeRef(RexRangeRef rangeRef) { return false; } - public Boolean visitFieldAccess(RexFieldAccess fieldAccess) { + @Override public Boolean visitFieldAccess(RexFieldAccess fieldAccess) { // ".FIELD" is constant iff "" is constant. return fieldAccess.getReferenceExpr().accept(this); } @@ -740,7 +740,7 @@ public static RexCall findOperatorCall( try { RexVisitor visitor = new RexVisitorImpl(true) { - public Void visitCall(RexCall call) { + @Override public Void visitCall(RexCall call) { if (call.getOperator().equals(operator)) { throw new Util.FoundOne(call); } @@ -765,7 +765,7 @@ public static boolean containsInputRef( try { RexVisitor visitor = new RexVisitorImpl(true) { - public Void visitInputRef(RexInputRef inputRef) { + @Override public Void visitInputRef(RexInputRef inputRef) { throw new Util.FoundOne(inputRef); } }; @@ -787,7 +787,7 @@ public static boolean containsFieldAccess(RexNode node) { try { RexVisitor visitor = new RexVisitorImpl(true) { - public Void visitFieldAccess(RexFieldAccess fieldAccess) { + @Override public Void visitFieldAccess(RexFieldAccess fieldAccess) { throw new Util.FoundOne(fieldAccess); } }; @@ -1017,7 +1017,7 @@ public static RexTableInputRef containsTableInputRef(RexNode node) { try { RexVisitor visitor = new RexVisitorImpl(true) { - public Void visitTableInputRef(RexTableInputRef inputRef) { + @Override public Void visitTableInputRef(RexTableInputRef inputRef) { throw new Util.FoundOne(inputRef); } }; @@ -2279,19 +2279,19 @@ protected RexNode lookup(RexNode expr) { return map.get(expr); } - public RexNode visitInputRef(RexInputRef inputRef) { + @Override public RexNode visitInputRef(RexInputRef inputRef) { return register(inputRef); } - public RexNode visitLiteral(RexLiteral literal) { + @Override public RexNode visitLiteral(RexLiteral literal) { return register(literal); } - public RexNode visitCorrelVariable(RexCorrelVariable correlVariable) { + @Override public RexNode visitCorrelVariable(RexCorrelVariable correlVariable) { return register(correlVariable); } - public RexNode visitCall(RexCall call) { + @Override public RexNode visitCall(RexCall call) { List normalizedOperands = new ArrayList<>(); int diffCount = 0; for (RexNode operand : call.getOperands()) { @@ -2311,15 +2311,15 @@ public RexNode visitCall(RexCall call) { return register(call); } - public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { + @Override public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { return register(dynamicParam); } - public RexNode visitRangeRef(RexRangeRef rangeRef) { + @Override public RexNode visitRangeRef(RexRangeRef rangeRef) { return register(rangeRef); } - public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { + @Override public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { final RexNode expr = fieldAccess.getReferenceExpr(); expr.accept(this); final RexNode normalizedExpr = lookup(expr); @@ -2357,7 +2357,7 @@ private static class ForwardRefFinder extends RexVisitorImpl { this.inputRowType = inputRowType; } - public Void visitInputRef(RexInputRef inputRef) { + @Override public Void visitInputRef(RexInputRef inputRef) { super.visitInputRef(inputRef); if (inputRef.getIndex() >= inputRowType.getFieldCount()) { throw new IllegalForwardRefException(); @@ -2365,7 +2365,7 @@ public Void visitInputRef(RexInputRef inputRef) { return null; } - public Void visitLocalRef(RexLocalRef inputRef) { + @Override public Void visitLocalRef(RexLocalRef inputRef) { super.visitLocalRef(inputRef); if (inputRef.getIndex() >= limit) { throw new IllegalForwardRefException(); @@ -2394,12 +2394,12 @@ public FieldAccessFinder() { fieldAccessList = new ArrayList<>(); } - public Void visitFieldAccess(RexFieldAccess fieldAccess) { + @Override public Void visitFieldAccess(RexFieldAccess fieldAccess) { fieldAccessList.add(fieldAccess); return null; } - public Void visitCall(RexCall call) { + @Override public Void visitCall(RexCall call) { visitEach(call.operands); return null; } diff --git a/core/src/main/java/org/apache/calcite/rex/RexVariable.java b/core/src/main/java/org/apache/calcite/rex/RexVariable.java index 77fdd7e875c..37634f618d4 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexVariable.java +++ b/core/src/main/java/org/apache/calcite/rex/RexVariable.java @@ -41,7 +41,7 @@ protected RexVariable( //~ Methods ---------------------------------------------------------------- - public RelDataType getType() { + @Override public RelDataType getType() { return type; } diff --git a/core/src/main/java/org/apache/calcite/rex/RexVisitorImpl.java b/core/src/main/java/org/apache/calcite/rex/RexVisitorImpl.java index c4808786a79..8a07b37668c 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexVisitorImpl.java +++ b/core/src/main/java/org/apache/calcite/rex/RexVisitorImpl.java @@ -37,19 +37,19 @@ protected RexVisitorImpl(boolean deep) { //~ Methods ---------------------------------------------------------------- - public R visitInputRef(RexInputRef inputRef) { + @Override public R visitInputRef(RexInputRef inputRef) { return null; } - public R visitLocalRef(RexLocalRef localRef) { + @Override public R visitLocalRef(RexLocalRef localRef) { return null; } - public R visitLiteral(RexLiteral literal) { + @Override public R visitLiteral(RexLiteral literal) { return null; } - public R visitOver(RexOver over) { + @Override public R visitOver(RexOver over) { R r = visitCall(over); if (!deep) { return null; @@ -64,11 +64,11 @@ public R visitOver(RexOver over) { return r; } - public R visitCorrelVariable(RexCorrelVariable correlVariable) { + @Override public R visitCorrelVariable(RexCorrelVariable correlVariable) { return null; } - public R visitCall(RexCall call) { + @Override public R visitCall(RexCall call) { if (!deep) { return null; } @@ -80,15 +80,15 @@ public R visitCall(RexCall call) { return r; } - public R visitDynamicParam(RexDynamicParam dynamicParam) { + @Override public R visitDynamicParam(RexDynamicParam dynamicParam) { return null; } - public R visitRangeRef(RexRangeRef rangeRef) { + @Override public R visitRangeRef(RexRangeRef rangeRef) { return null; } - public R visitFieldAccess(RexFieldAccess fieldAccess) { + @Override public R visitFieldAccess(RexFieldAccess fieldAccess) { if (!deep) { return null; } @@ -96,7 +96,7 @@ public R visitFieldAccess(RexFieldAccess fieldAccess) { return expr.accept(this); } - public R visitSubQuery(RexSubQuery subQuery) { + @Override public R visitSubQuery(RexSubQuery subQuery) { if (!deep) { return null; } diff --git a/core/src/main/java/org/apache/calcite/rex/RexWindow.java b/core/src/main/java/org/apache/calcite/rex/RexWindow.java index 3793fc5ad68..ca0b0358676 100644 --- a/core/src/main/java/org/apache/calcite/rex/RexWindow.java +++ b/core/src/main/java/org/apache/calcite/rex/RexWindow.java @@ -88,15 +88,15 @@ public class RexWindow { //~ Methods ---------------------------------------------------------------- - public String toString() { + @Override public String toString() { return digest; } - public int hashCode() { + @Override public int hashCode() { return digest.hashCode(); } - public boolean equals(Object that) { + @Override public boolean equals(Object that) { if (that instanceof RexWindow) { RexWindow window = (RexWindow) that; return digest.equals(window.digest); diff --git a/core/src/main/java/org/apache/calcite/runtime/AbstractImmutableList.java b/core/src/main/java/org/apache/calcite/runtime/AbstractImmutableList.java index cc58a001389..422b0414097 100644 --- a/core/src/main/java/org/apache/calcite/runtime/AbstractImmutableList.java +++ b/core/src/main/java/org/apache/calcite/runtime/AbstractImmutableList.java @@ -30,67 +30,67 @@ abstract class AbstractImmutableList implements List { protected abstract List toList(); - @Nonnull public Iterator iterator() { + @Override @Nonnull public Iterator iterator() { return toList().iterator(); } - @Nonnull public ListIterator listIterator() { + @Override @Nonnull public ListIterator listIterator() { return toList().listIterator(); } - public boolean isEmpty() { + @Override public boolean isEmpty() { return false; } - public boolean add(E t) { + @Override public boolean add(E t) { throw new UnsupportedOperationException(); } - public boolean addAll(@Nonnull Collection c) { + @Override public boolean addAll(@Nonnull Collection c) { throw new UnsupportedOperationException(); } - public boolean addAll(int index, @Nonnull Collection c) { + @Override public boolean addAll(int index, @Nonnull Collection c) { throw new UnsupportedOperationException(); } - public boolean removeAll(@Nonnull Collection c) { + @Override public boolean removeAll(@Nonnull Collection c) { throw new UnsupportedOperationException(); } - public boolean retainAll(@Nonnull Collection c) { + @Override public boolean retainAll(@Nonnull Collection c) { throw new UnsupportedOperationException(); } - public void clear() { + @Override public void clear() { throw new UnsupportedOperationException(); } - public E set(int index, E element) { + @Override public E set(int index, E element) { throw new UnsupportedOperationException(); } - public void add(int index, E element) { + @Override public void add(int index, E element) { throw new UnsupportedOperationException(); } - public E remove(int index) { + @Override public E remove(int index) { throw new UnsupportedOperationException(); } - @Nonnull public ListIterator listIterator(int index) { + @Override @Nonnull public ListIterator listIterator(int index) { return toList().listIterator(index); } - @Nonnull public List subList(int fromIndex, int toIndex) { + @Override @Nonnull public List subList(int fromIndex, int toIndex) { return toList().subList(fromIndex, toIndex); } - public boolean contains(Object o) { + @Override public boolean contains(Object o) { return indexOf(o) >= 0; } - public boolean containsAll(@Nonnull Collection c) { + @Override public boolean containsAll(@Nonnull Collection c) { for (Object o : c) { if (!contains(o)) { return false; @@ -99,7 +99,7 @@ public boolean containsAll(@Nonnull Collection c) { return true; } - public boolean remove(Object o) { + @Override public boolean remove(Object o) { throw new UnsupportedOperationException(); } } diff --git a/core/src/main/java/org/apache/calcite/runtime/ArrayBindable.java b/core/src/main/java/org/apache/calcite/runtime/ArrayBindable.java index d40bfa5a4b8..a88bc861f48 100644 --- a/core/src/main/java/org/apache/calcite/runtime/ArrayBindable.java +++ b/core/src/main/java/org/apache/calcite/runtime/ArrayBindable.java @@ -24,5 +24,5 @@ */ public interface ArrayBindable extends Bindable, Typed { // override - Class getElementType(); + @Override Class getElementType(); } diff --git a/core/src/main/java/org/apache/calcite/runtime/ArrayComparator.java b/core/src/main/java/org/apache/calcite/runtime/ArrayComparator.java index a44c4794b0e..f72e9cc2e40 100644 --- a/core/src/main/java/org/apache/calcite/runtime/ArrayComparator.java +++ b/core/src/main/java/org/apache/calcite/runtime/ArrayComparator.java @@ -47,7 +47,7 @@ private static Comparator[] comparators(boolean[] descendings) { return comparators; } - public int compare(Object[] o1, Object[] o2) { + @Override public int compare(Object[] o1, Object[] o2) { for (int i = 0; i < comparators.length; i++) { Comparator comparator = comparators[i]; int c = comparator.compare(o1[i], o2[i]); diff --git a/core/src/main/java/org/apache/calcite/runtime/ArrayEnumeratorCursor.java b/core/src/main/java/org/apache/calcite/runtime/ArrayEnumeratorCursor.java index 6775340f5ef..11a8bc1a300 100644 --- a/core/src/main/java/org/apache/calcite/runtime/ArrayEnumeratorCursor.java +++ b/core/src/main/java/org/apache/calcite/runtime/ArrayEnumeratorCursor.java @@ -33,7 +33,7 @@ public ArrayEnumeratorCursor(Enumerator enumerator) { super(enumerator); } - protected Getter createGetter(int ordinal) { + @Override protected Getter createGetter(int ordinal) { return new ArrayGetter(ordinal); } } diff --git a/core/src/main/java/org/apache/calcite/runtime/ConsList.java b/core/src/main/java/org/apache/calcite/runtime/ConsList.java index 445cf7e1b1d..83cc303d41c 100644 --- a/core/src/main/java/org/apache/calcite/runtime/ConsList.java +++ b/core/src/main/java/org/apache/calcite/runtime/ConsList.java @@ -53,7 +53,7 @@ private ConsList(E first, List rest) { this.rest = rest; } - public E get(int index) { + @Override public E get(int index) { for (ConsList c = this;; c = (ConsList) c.rest) { if (index == 0) { return c.first; @@ -65,7 +65,7 @@ public E get(int index) { } } - public int size() { + @Override public int size() { int s = 1; for (ConsList c = this;; c = (ConsList) c.rest, ++s) { if (!(c.rest instanceof ConsList)) { @@ -88,7 +88,7 @@ public int size() { return toList().toString(); } - protected final List toList() { + @Override protected final List toList() { final List list = new ArrayList<>(); for (ConsList c = this;; c = (ConsList) c.rest) { list.add(c.first); @@ -111,11 +111,11 @@ protected final List toList() { return toList().listIterator(index); } - @Nonnull public Object[] toArray() { + @Override @Nonnull public Object[] toArray() { return toList().toArray(); } - @Nonnull public T[] toArray(@Nonnull T[] a) { + @Override @Nonnull public T[] toArray(@Nonnull T[] a) { final int s = size(); if (s > a.length) { a = Arrays.copyOf(a, s); @@ -135,11 +135,11 @@ protected final List toList() { } } - public int indexOf(Object o) { + @Override public int indexOf(Object o) { return toList().indexOf(o); } - public int lastIndexOf(Object o) { + @Override public int lastIndexOf(Object o) { return toList().lastIndexOf(o); } } diff --git a/core/src/main/java/org/apache/calcite/runtime/Enumerables.java b/core/src/main/java/org/apache/calcite/runtime/Enumerables.java index 11143910211..ce45f39eccf 100644 --- a/core/src/main/java/org/apache/calcite/runtime/Enumerables.java +++ b/core/src/main/java/org/apache/calcite/runtime/Enumerables.java @@ -76,7 +76,7 @@ public static Enumerable match( Matcher matcher, Emitter emitter, int history, int future) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { final Enumerator inputEnumerator = enumerable.enumerator(); @@ -94,12 +94,12 @@ public Enumerator enumerator() { /** Match counter is 1-based in Oracle. */ final AtomicInteger matchCounter = new AtomicInteger(1); - public TResult current() { + @Override public TResult current() { Objects.requireNonNull(resultRow); return resultRow; } - public boolean moveNext() { + @Override public boolean moveNext() { for (;;) { resultRow = emitRows.pollFirst(); if (resultRow != null) { @@ -170,11 +170,11 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { throw new UnsupportedOperationException(); } - public void close() { + @Override public void close() { inputEnumerator.close(); } }; diff --git a/core/src/main/java/org/apache/calcite/runtime/EnumeratorCursor.java b/core/src/main/java/org/apache/calcite/runtime/EnumeratorCursor.java index 042f88c31d0..43923030ad5 100644 --- a/core/src/main/java/org/apache/calcite/runtime/EnumeratorCursor.java +++ b/core/src/main/java/org/apache/calcite/runtime/EnumeratorCursor.java @@ -43,15 +43,15 @@ protected EnumeratorCursor(Enumerator enumerator) { this.enumerator = enumerator; } - protected T current() { + @Override protected T current() { return enumerator.current(); } - public boolean next() { + @Override public boolean next() { return enumerator.moveNext(); } - public void close() { + @Override public void close() { enumerator.close(); } } diff --git a/core/src/main/java/org/apache/calcite/runtime/FlatLists.java b/core/src/main/java/org/apache/calcite/runtime/FlatLists.java index 84c4b3b33c2..41bde64f8d1 100644 --- a/core/src/main/java/org/apache/calcite/runtime/FlatLists.java +++ b/core/src/main/java/org/apache/calcite/runtime/FlatLists.java @@ -278,7 +278,7 @@ public static ImmutableMap append(Map map, K k, V v) { * @param element type */ public abstract static class AbstractFlatList extends AbstractImmutableList implements RandomAccess { - protected final List toList() { + @Override protected final List toList() { //noinspection unchecked return Arrays.asList((T[]) toArray()); } @@ -311,11 +311,11 @@ protected static class Flat1List this.t0 = t0; } - public String toString() { + @Override public String toString() { return "[" + t0 + "]"; } - public T get(int index) { + @Override public T get(int index) { switch (index) { case 0: return t0; @@ -324,15 +324,15 @@ public T get(int index) { } } - public int size() { + @Override public int size() { return 1; } - public Iterator iterator() { + @Override public Iterator iterator() { return Collections.singletonList(t0).iterator(); } - public boolean equals(Object o) { + @Override public boolean equals(Object o) { if (this == o) { return true; } @@ -345,13 +345,13 @@ public boolean equals(Object o) { && Objects.equals(t0, ((List) o).get(0)); } - public int hashCode() { + @Override public int hashCode() { int h = 1; h = h * 31 + Utilities.hash(t0); return h; } - public int indexOf(Object o) { + @Override public int indexOf(Object o) { if (o == null) { if (t0 == null) { return 0; @@ -364,7 +364,7 @@ public int indexOf(Object o) { return -1; } - public int lastIndexOf(Object o) { + @Override public int lastIndexOf(Object o) { if (o == null) { if (t0 == null) { return 0; @@ -377,7 +377,7 @@ public int lastIndexOf(Object o) { return -1; } - @SuppressWarnings({"unchecked" }) + @Override @SuppressWarnings({"unchecked" }) public T2[] toArray(T2[] a) { if (a.length < 1) { // Make a new array of a's runtime type, but my contents: @@ -387,15 +387,15 @@ public T2[] toArray(T2[] a) { return a; } - public Object[] toArray() { + @Override public Object[] toArray() { return new Object[] {t0}; } - public int compareTo(List o) { + @Override public int compareTo(List o) { return ComparableListImpl.compare((List) this, o); } - public List append(T e) { + @Override public List append(T e) { return new Flat2List<>(t0, e); } } @@ -425,11 +425,11 @@ protected static class Flat2List this.t1 = t1; } - public String toString() { + @Override public String toString() { return "[" + t0 + ", " + t1 + "]"; } - public T get(int index) { + @Override public T get(int index) { switch (index) { case 0: return t0; @@ -440,15 +440,15 @@ public T get(int index) { } } - public int size() { + @Override public int size() { return 2; } - public Iterator iterator() { + @Override public Iterator iterator() { return Arrays.asList(t0, t1).iterator(); } - public boolean equals(Object o) { + @Override public boolean equals(Object o) { if (this == o) { return true; } @@ -464,14 +464,14 @@ public boolean equals(Object o) { return false; } - public int hashCode() { + @Override public int hashCode() { int h = 1; h = h * 31 + Utilities.hash(t0); h = h * 31 + Utilities.hash(t1); return h; } - public int indexOf(Object o) { + @Override public int indexOf(Object o) { if (o == null) { if (t0 == null) { return 0; @@ -490,7 +490,7 @@ public int indexOf(Object o) { return -1; } - public int lastIndexOf(Object o) { + @Override public int lastIndexOf(Object o) { if (o == null) { if (t1 == null) { return 1; @@ -509,7 +509,7 @@ public int lastIndexOf(Object o) { return -1; } - @SuppressWarnings({"unchecked" }) + @Override @SuppressWarnings({"unchecked" }) public T2[] toArray(T2[] a) { if (a.length < 2) { // Make a new array of a's runtime type, but my contents: @@ -520,15 +520,15 @@ public T2[] toArray(T2[] a) { return a; } - public Object[] toArray() { + @Override public Object[] toArray() { return new Object[] {t0, t1}; } - public int compareTo(List o) { + @Override public int compareTo(List o) { return ComparableListImpl.compare((List) this, o); } - public List append(T e) { + @Override public List append(T e) { return new Flat3List<>(t0, t1, e); } } @@ -560,11 +560,11 @@ protected static class Flat3List this.t2 = t2; } - public String toString() { + @Override public String toString() { return "[" + t0 + ", " + t1 + ", " + t2 + "]"; } - public T get(int index) { + @Override public T get(int index) { switch (index) { case 0: return t0; @@ -577,15 +577,15 @@ public T get(int index) { } } - public int size() { + @Override public int size() { return 3; } - public Iterator iterator() { + @Override public Iterator iterator() { return Arrays.asList(t0, t1, t2).iterator(); } - public boolean equals(Object o) { + @Override public boolean equals(Object o) { if (this == o) { return true; } @@ -600,7 +600,7 @@ public boolean equals(Object o) { && Arrays.asList(t0, t1, t2).equals(o); } - public int hashCode() { + @Override public int hashCode() { int h = 1; h = h * 31 + Utilities.hash(t0); h = h * 31 + Utilities.hash(t1); @@ -608,7 +608,7 @@ public int hashCode() { return h; } - public int indexOf(Object o) { + @Override public int indexOf(Object o) { if (o == null) { if (t0 == null) { return 0; @@ -633,7 +633,7 @@ public int indexOf(Object o) { return -1; } - public int lastIndexOf(Object o) { + @Override public int lastIndexOf(Object o) { if (o == null) { if (t2 == null) { return 2; @@ -658,7 +658,7 @@ public int lastIndexOf(Object o) { return -1; } - @SuppressWarnings({"unchecked" }) + @Override @SuppressWarnings({"unchecked" }) public T2[] toArray(T2[] a) { if (a.length < 3) { // Make a new array of a's runtime type, but my contents: @@ -670,15 +670,15 @@ public T2[] toArray(T2[] a) { return a; } - public Object[] toArray() { + @Override public Object[] toArray() { return new Object[] {t0, t1, t2}; } - public int compareTo(List o) { + @Override public int compareTo(List o) { return ComparableListImpl.compare((List) this, o); } - public List append(T e) { + @Override public List append(T e) { return new Flat4List<>(t0, t1, t2, e); } } @@ -712,11 +712,11 @@ protected static class Flat4List this.t3 = t3; } - public String toString() { + @Override public String toString() { return "[" + t0 + ", " + t1 + ", " + t2 + ", " + t3 + "]"; } - public T get(int index) { + @Override public T get(int index) { switch (index) { case 0: return t0; @@ -731,15 +731,15 @@ public T get(int index) { } } - public int size() { + @Override public int size() { return 4; } - public Iterator iterator() { + @Override public Iterator iterator() { return Arrays.asList(t0, t1, t2, t3).iterator(); } - public boolean equals(Object o) { + @Override public boolean equals(Object o) { if (this == o) { return true; } @@ -755,7 +755,7 @@ public boolean equals(Object o) { && Arrays.asList(t0, t1, t2, t3).equals(o); } - public int hashCode() { + @Override public int hashCode() { int h = 1; h = h * 31 + Utilities.hash(t0); h = h * 31 + Utilities.hash(t1); @@ -764,7 +764,7 @@ public int hashCode() { return h; } - public int indexOf(Object o) { + @Override public int indexOf(Object o) { if (o == null) { if (t0 == null) { return 0; @@ -795,7 +795,7 @@ public int indexOf(Object o) { return -1; } - public int lastIndexOf(Object o) { + @Override public int lastIndexOf(Object o) { if (o == null) { if (t3 == null) { return 3; @@ -826,7 +826,7 @@ public int lastIndexOf(Object o) { return -1; } - @SuppressWarnings({"unchecked" }) + @Override @SuppressWarnings({"unchecked" }) public T2[] toArray(T2[] a) { if (a.length < 4) { // Make a new array of a's runtime type, but my contents: @@ -839,15 +839,15 @@ public T2[] toArray(T2[] a) { return a; } - public Object[] toArray() { + @Override public Object[] toArray() { return new Object[] {t0, t1, t2, t3}; } - public int compareTo(List o) { + @Override public int compareTo(List o) { return ComparableListImpl.compare((List) this, o); } - public List append(T e) { + @Override public List append(T e) { return new Flat5List<>(t0, t1, t2, t3, e); } } @@ -883,11 +883,11 @@ protected static class Flat5List this.t4 = t4; } - public String toString() { + @Override public String toString() { return "[" + t0 + ", " + t1 + ", " + t2 + ", " + t3 + ", " + t4 + "]"; } - public T get(int index) { + @Override public T get(int index) { switch (index) { case 0: return t0; @@ -904,15 +904,15 @@ public T get(int index) { } } - public int size() { + @Override public int size() { return 5; } - public Iterator iterator() { + @Override public Iterator iterator() { return Arrays.asList(t0, t1, t2, t3, t4).iterator(); } - public boolean equals(Object o) { + @Override public boolean equals(Object o) { if (this == o) { return true; } @@ -929,7 +929,7 @@ public boolean equals(Object o) { && Arrays.asList(t0, t1, t2, t3, t4).equals(o); } - public int hashCode() { + @Override public int hashCode() { int h = 1; h = h * 31 + Utilities.hash(t0); h = h * 31 + Utilities.hash(t1); @@ -939,7 +939,7 @@ public int hashCode() { return h; } - public int indexOf(Object o) { + @Override public int indexOf(Object o) { if (o == null) { if (t0 == null) { return 0; @@ -976,7 +976,7 @@ public int indexOf(Object o) { return -1; } - public int lastIndexOf(Object o) { + @Override public int lastIndexOf(Object o) { if (o == null) { if (t4 == null) { return 4; @@ -1013,7 +1013,7 @@ public int lastIndexOf(Object o) { return -1; } - @SuppressWarnings({"unchecked" }) + @Override @SuppressWarnings({"unchecked" }) public T2[] toArray(T2[] a) { if (a.length < 5) { // Make a new array of a's runtime type, but my contents: @@ -1027,15 +1027,15 @@ public T2[] toArray(T2[] a) { return a; } - public Object[] toArray() { + @Override public Object[] toArray() { return new Object[] {t0, t1, t2, t3, t4}; } - public int compareTo(List o) { + @Override public int compareTo(List o) { return ComparableListImpl.compare((List) this, o); } - public List append(T e) { + @Override public List append(T e) { return new Flat6List<>(t0, t1, t2, t3, t4, e); } } @@ -1073,12 +1073,12 @@ protected static class Flat6List this.t5 = t5; } - public String toString() { + @Override public String toString() { return "[" + t0 + ", " + t1 + ", " + t2 + ", " + t3 + ", " + t4 + ", " + t5 + "]"; } - public T get(int index) { + @Override public T get(int index) { switch (index) { case 0: return t0; @@ -1097,15 +1097,15 @@ public T get(int index) { } } - public int size() { + @Override public int size() { return 6; } - public Iterator iterator() { + @Override public Iterator iterator() { return Arrays.asList(t0, t1, t2, t3, t4, t5).iterator(); } - public boolean equals(Object o) { + @Override public boolean equals(Object o) { if (this == o) { return true; } @@ -1123,7 +1123,7 @@ public boolean equals(Object o) { && Arrays.asList(t0, t1, t2, t3, t4, t5).equals(o); } - public int hashCode() { + @Override public int hashCode() { int h = 1; h = h * 31 + Utilities.hash(t0); h = h * 31 + Utilities.hash(t1); @@ -1134,7 +1134,7 @@ public int hashCode() { return h; } - public int indexOf(Object o) { + @Override public int indexOf(Object o) { if (o == null) { if (t0 == null) { return 0; @@ -1177,7 +1177,7 @@ public int indexOf(Object o) { return -1; } - public int lastIndexOf(Object o) { + @Override public int lastIndexOf(Object o) { if (o == null) { if (t5 == null) { return 5; @@ -1220,7 +1220,7 @@ public int lastIndexOf(Object o) { return -1; } - @SuppressWarnings({"unchecked" }) + @Override @SuppressWarnings({"unchecked" }) public T2[] toArray(T2[] a) { if (a.length < 6) { // Make a new array of a's runtime type, but my contents: @@ -1235,15 +1235,15 @@ public T2[] toArray(T2[] a) { return a; } - public Object[] toArray() { + @Override public Object[] toArray() { return new Object[] {t0, t1, t2, t3, t4, t5}; } - public int compareTo(List o) { + @Override public int compareTo(List o) { return ComparableListImpl.compare((List) this, o); } - public List append(T e) { + @Override public List append(T e) { return ImmutableNullableList.of(t0, t1, t2, t3, t5, e); } } @@ -1257,24 +1257,24 @@ private static class ComparableEmptyList private ComparableEmptyList() { } - public T get(int index) { + @Override public T get(int index) { throw new IndexOutOfBoundsException(); } - public int hashCode() { + @Override public int hashCode() { return 1; // same as Collections.emptyList() } - public boolean equals(Object o) { + @Override public boolean equals(Object o) { return o == this || o instanceof List && ((List) o).isEmpty(); } - public int size() { + @Override public int size() { return 0; } - public int compareTo(List o) { + @Override public int compareTo(List o) { return ComparableListImpl.compare((List) this, o); } } @@ -1305,15 +1305,15 @@ protected ComparableListImpl(List list) { this.list = list; } - public T get(int index) { + @Override public T get(int index) { return list.get(index); } - public int size() { + @Override public int size() { return list.size(); } - public int compareTo(List o) { + @Override public int compareTo(List o) { return compare(list, o); } diff --git a/core/src/main/java/org/apache/calcite/runtime/GeoFunctions.java b/core/src/main/java/org/apache/calcite/runtime/GeoFunctions.java index c7c2019f4b9..7b1fb251b0f 100644 --- a/core/src/main/java/org/apache/calcite/runtime/GeoFunctions.java +++ b/core/src/main/java/org/apache/calcite/runtime/GeoFunctions.java @@ -568,15 +568,15 @@ public GridEnumerable(Envelope envelope, BigDecimal deltaX, return new Object[] {geom, id, x + 1, y + 1, baseX + x, baseY + y}; } - public boolean moveNext() { + @Override public boolean moveNext() { return ++id < area; } - public void reset() { + @Override public void reset() { id = -1; } - public void close() { + @Override public void close() { } }; } diff --git a/core/src/main/java/org/apache/calcite/runtime/Geometries.java b/core/src/main/java/org/apache/calcite/runtime/Geometries.java index c8e9919cd75..0805a81d649 100644 --- a/core/src/main/java/org/apache/calcite/runtime/Geometries.java +++ b/core/src/main/java/org/apache/calcite/runtime/Geometries.java @@ -222,30 +222,30 @@ static class SimpleGeom implements Geom { return g.toString(); } - public int compareTo(Geom o) { + @Override public int compareTo(Geom o) { return toString().compareTo(o.toString()); } - public Geometry g() { + @Override public Geometry g() { return g; } - public Type type() { + @Override public Type type() { return Geometries.type(g); } - public SpatialReference sr() { + @Override public SpatialReference sr() { return SPATIAL_REFERENCE; } - public Geom transform(int srid) { + @Override public Geom transform(int srid) { if (srid == SPATIAL_REFERENCE.getID()) { return this; } return bind(g, srid); } - public Geom wrap(Geometry g) { + @Override public Geom wrap(Geometry g) { return new SimpleGeom(g); } } @@ -262,23 +262,23 @@ static class MapGeom implements Geom { return mg.toString(); } - public int compareTo(Geom o) { + @Override public int compareTo(Geom o) { return toString().compareTo(o.toString()); } - public Geometry g() { + @Override public Geometry g() { return mg.getGeometry(); } - public Type type() { + @Override public Type type() { return Geometries.type(mg.getGeometry()); } - public SpatialReference sr() { + @Override public SpatialReference sr() { return mg.getSpatialReference(); } - public Geom transform(int srid) { + @Override public Geom transform(int srid) { if (srid == NO_SRID) { return new SimpleGeom(mg.getGeometry()); } @@ -288,7 +288,7 @@ public Geom transform(int srid) { return bind(mg.getGeometry(), srid); } - public Geom wrap(Geometry g) { + @Override public Geom wrap(Geometry g) { return bind(g, this.mg.getSpatialReference()); } } diff --git a/core/src/main/java/org/apache/calcite/runtime/HilbertCurve2D.java b/core/src/main/java/org/apache/calcite/runtime/HilbertCurve2D.java index 6a32a30c788..c4b0c6500e3 100644 --- a/core/src/main/java/org/apache/calcite/runtime/HilbertCurve2D.java +++ b/core/src/main/java/org/apache/calcite/runtime/HilbertCurve2D.java @@ -75,7 +75,7 @@ long setNormalizedLongitude(long lonNormal) { return (long) (lonNormal * 360d / (precision - 1)); } - public long toIndex(double x, double y) { + @Override public long toIndex(double x, double y) { final long normX = getNormalizedLongitude(x); final long normY = getNormalizedLatitude(y); final BitVector[] p = { @@ -92,7 +92,7 @@ public long toIndex(double x, double y) { return hilbert.toLong(); } - public Point toPoint(long i) { + @Override public Point toPoint(long i) { final BitVector h = BitVectorFactories.OPTIMAL.apply(resolution * 2); h.copyFrom(i); final BitVector[] p = { @@ -107,7 +107,7 @@ public Point toPoint(long i) { return new Point((double) x, (double) y); } - public List toRanges(double xMin, double yMin, double xMax, + @Override public List toRanges(double xMin, double yMin, double xMax, double yMax, RangeComputeHints hints) { final CompactHilbertCurve chc = new CompactHilbertCurve(new int[] {resolution, resolution}); diff --git a/core/src/main/java/org/apache/calcite/runtime/ObjectEnumeratorCursor.java b/core/src/main/java/org/apache/calcite/runtime/ObjectEnumeratorCursor.java index 233ffa3be53..43818820d8c 100644 --- a/core/src/main/java/org/apache/calcite/runtime/ObjectEnumeratorCursor.java +++ b/core/src/main/java/org/apache/calcite/runtime/ObjectEnumeratorCursor.java @@ -36,19 +36,19 @@ public ObjectEnumeratorCursor(Enumerator enumerator) { this.enumerator = enumerator; } - protected Getter createGetter(int ordinal) { + @Override protected Getter createGetter(int ordinal) { return new ObjectGetter(ordinal); } - protected Object current() { + @Override protected Object current() { return enumerator.current(); } - public boolean next() { + @Override public boolean next() { return enumerator.moveNext(); } - public void close() { + @Override public void close() { enumerator.close(); } } diff --git a/core/src/main/java/org/apache/calcite/runtime/Pattern.java b/core/src/main/java/org/apache/calcite/runtime/Pattern.java index 1818fb6cc4a..e555380de30 100644 --- a/core/src/main/java/org/apache/calcite/runtime/Pattern.java +++ b/core/src/main/java/org/apache/calcite/runtime/Pattern.java @@ -154,7 +154,7 @@ abstract class AbstractPattern implements Pattern { this.op = Objects.requireNonNull(op); } - public Automaton toAutomaton() { + @Override public Automaton toAutomaton() { return new AutomatonBuilder().add(this).build(); } } diff --git a/core/src/main/java/org/apache/calcite/runtime/PredicateImpl.java b/core/src/main/java/org/apache/calcite/runtime/PredicateImpl.java index db80565978d..614a22f0a7e 100644 --- a/core/src/main/java/org/apache/calcite/runtime/PredicateImpl.java +++ b/core/src/main/java/org/apache/calcite/runtime/PredicateImpl.java @@ -35,10 +35,10 @@ * implement {@link java.util.function.Predicate} directly. */ public abstract class PredicateImpl implements Predicate { - public final boolean apply(@Nullable T input) { + @Override public final boolean apply(@Nullable T input) { return test(input); } /** Overrides {@code java.util.function.Predicate#test} in JDK8 and higher. */ - public abstract boolean test(@Nullable T t); + @Override public abstract boolean test(@Nullable T t); } diff --git a/core/src/main/java/org/apache/calcite/runtime/RecordEnumeratorCursor.java b/core/src/main/java/org/apache/calcite/runtime/RecordEnumeratorCursor.java index e1efdcf4891..d470c913ecf 100644 --- a/core/src/main/java/org/apache/calcite/runtime/RecordEnumeratorCursor.java +++ b/core/src/main/java/org/apache/calcite/runtime/RecordEnumeratorCursor.java @@ -42,7 +42,7 @@ public RecordEnumeratorCursor( this.clazz = clazz; } - protected Getter createGetter(int ordinal) { + @Override protected Getter createGetter(int ordinal) { return new FieldGetter(clazz.getFields()[ordinal]); } } 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 17dc7efab68..8bccaeeb6ac 100644 --- a/core/src/main/java/org/apache/calcite/runtime/Resources.java +++ b/core/src/main/java/org/apache/calcite/runtime/Resources.java @@ -137,6 +137,7 @@ private static T create(final String base, new InvocationHandler() { final Map cache = new ConcurrentHashMap<>(); + @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (args == null || args.length == 0) { @@ -752,38 +753,47 @@ public interface PropertyAccessor { enum EmptyPropertyAccessor implements PropertyAccessor { INSTANCE; + @Override public boolean isSet(Prop p) { return false; } + @Override public int intValue(IntProp p) { return p.defaultValue(); } + @Override public int intValue(IntProp p, int defaultValue) { return defaultValue; } + @Override public String stringValue(StringProp p) { return p.defaultValue(); } + @Override public String stringValue(StringProp p, String defaultValue) { return defaultValue; } + @Override public boolean booleanValue(BooleanProp p) { return p.defaultValue(); } + @Override public boolean booleanValue(BooleanProp p, boolean defaultValue) { return defaultValue; } + @Override public double doubleValue(DoubleProp p) { return p.defaultValue(); } + @Override public double doubleValue(DoubleProp p, double defaultValue) { return defaultValue; } @@ -937,10 +947,12 @@ private static InputStream openPropertiesFile(Class clazz) { }); } + @Override public Enumeration getKeys() { return bundle.getKeys(); } + @Override protected Object handleGetObject(String key) { return bundle.getObject(key); } @@ -1040,10 +1052,12 @@ private static class PropertiesAccessor implements PropertyAccessor { this.properties = properties; } + @Override public boolean isSet(Prop p) { return properties.containsKey(p.key); } + @Override public int intValue(IntProp p) { final String s = properties.getProperty(p.key); if (s != null) { @@ -1053,11 +1067,13 @@ public int intValue(IntProp p) { return p.defaultValue; } + @Override public int intValue(IntProp p, int defaultValue) { final String s = properties.getProperty(p.key); return s == null ? defaultValue : Integer.parseInt(s, 10); } + @Override public String stringValue(StringProp p) { final String s = properties.getProperty(p.key); if (s != null) { @@ -1067,11 +1083,13 @@ public String stringValue(StringProp p) { return p.defaultValue; } + @Override public String stringValue(StringProp p, String defaultValue) { final String s = properties.getProperty(p.key); return s == null ? defaultValue : s; } + @Override public boolean booleanValue(BooleanProp p) { final String s = properties.getProperty(p.key); if (s != null) { @@ -1081,11 +1099,13 @@ public boolean booleanValue(BooleanProp p) { return p.defaultValue; } + @Override public boolean booleanValue(BooleanProp p, boolean defaultValue) { final String s = properties.getProperty(p.key); return s == null ? defaultValue : Boolean.parseBoolean(s); } + @Override public double doubleValue(DoubleProp p) { final String s = properties.getProperty(p.key); if (s != null) { @@ -1095,6 +1115,7 @@ public double doubleValue(DoubleProp p) { return p.defaultValue; } + @Override public double doubleValue(DoubleProp p, double defaultValue) { final String s = properties.getProperty(p.key); return s == null ? defaultValue : Double.parseDouble(s); diff --git a/core/src/main/java/org/apache/calcite/runtime/ResultSetEnumerable.java b/core/src/main/java/org/apache/calcite/runtime/ResultSetEnumerable.java index b29e890a27a..9dc39a7893a 100644 --- a/core/src/main/java/org/apache/calcite/runtime/ResultSetEnumerable.java +++ b/core/src/main/java/org/apache/calcite/runtime/ResultSetEnumerable.java @@ -246,7 +246,7 @@ private static void setDynamicParam(PreparedStatement preparedStatement, } } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { if (preparedStatementEnricher == null) { return enumeratorBasedOnStatement(); } else { @@ -361,11 +361,11 @@ private static class ResultSetEnumerator implements Enumerator { this.rowBuilder = rowBuilderFactory.apply(resultSet); } - public T current() { + @Override public T current() { return rowBuilder.apply(); } - public boolean moveNext() { + @Override public boolean moveNext() { try { return resultSet.next(); } catch (SQLException e) { @@ -373,7 +373,7 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { try { resultSet.beforeFirst(); } catch (SQLException e) { @@ -381,7 +381,7 @@ public void reset() { } } - public void close() { + @Override public void close() { ResultSet savedResultSet = resultSet; if (savedResultSet != null) { try { diff --git a/core/src/main/java/org/apache/calcite/runtime/SortedMultiMap.java b/core/src/main/java/org/apache/calcite/runtime/SortedMultiMap.java index 0f162e4c18c..7b2448c5c94 100644 --- a/core/src/main/java/org/apache/calcite/runtime/SortedMultiMap.java +++ b/core/src/main/java/org/apache/calcite/runtime/SortedMultiMap.java @@ -47,11 +47,11 @@ public void putMulti(K key, V value) { public Iterator arrays(final Comparator comparator) { final Iterator> iterator = values().iterator(); return new Iterator() { - public boolean hasNext() { + @Override public boolean hasNext() { return iterator.hasNext(); } - public V[] next() { + @Override public V[] next() { List list = iterator.next(); @SuppressWarnings("unchecked") final V[] vs = (V[]) list.toArray(); @@ -59,7 +59,7 @@ public V[] next() { return vs; } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } }; diff --git a/core/src/main/java/org/apache/calcite/runtime/SpaceFillingCurve2D.java b/core/src/main/java/org/apache/calcite/runtime/SpaceFillingCurve2D.java index c685bb383f5..bde003d8201 100644 --- a/core/src/main/java/org/apache/calcite/runtime/SpaceFillingCurve2D.java +++ b/core/src/main/java/org/apache/calcite/runtime/SpaceFillingCurve2D.java @@ -70,15 +70,15 @@ protected AbstractRange(long lower, long upper) { this.upper = upper; } - public long lower() { + @Override public long lower() { return lower; } - public long upper() { + @Override public long upper() { return upper; } - public IndexRangeTuple tuple() { + @Override public IndexRangeTuple tuple() { return new IndexRangeTuple(lower, upper, contained()); } } @@ -89,7 +89,7 @@ class CoveredRange extends AbstractRange { super(lower, upper); } - public boolean contained() { + @Override public boolean contained() { return true; } @@ -104,7 +104,7 @@ class OverlappingRange extends AbstractRange { super(lower, upper); } - public boolean contained() { + @Override public boolean contained() { return false; } @@ -115,7 +115,7 @@ public boolean contained() { /** Lexicographic ordering for {@link IndexRange}. */ class IndexRangeOrdering extends Ordering { - public int compare(IndexRange x, IndexRange y) { + @Override public int compare(IndexRange x, IndexRange y) { final int c1 = Long.compare(x.lower(), y.lower()); if (c1 != 0) { return c1; 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 2c552909e5a..95eeb04f54d 100644 --- a/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java +++ b/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java @@ -128,7 +128,7 @@ public class SqlFunctions { } final Enumerator> product = Linq4j.product(enumerators); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return Linq4j.transform(product, List::toArray); } }; @@ -2727,7 +2727,7 @@ public static Function1> flatList() { final List list = (List) inputObject; final Enumerator> enumerator = Linq4j.enumerator(list); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { @Override public boolean moveNext() { @@ -2831,7 +2831,7 @@ public static Enumerable> pro final List>> enumerators, final int fieldCount, final boolean withOrdinality) { return new AbstractEnumerable>() { - public Enumerator> enumerator() { + @Override public Enumerator> enumerator() { return new ProductComparableListEnumerator<>(enumerators, fieldCount, withOrdinality); } @@ -2985,7 +2985,7 @@ private static class ProductComparableListEnumerator return hasNext; } - public FlatLists.ComparableList current() { + @Override public FlatLists.ComparableList current() { int i = 0; for (Object element : (Object[]) elements) { Object[] a; diff --git a/core/src/main/java/org/apache/calcite/runtime/TrustAllSslSocketFactory.java b/core/src/main/java/org/apache/calcite/runtime/TrustAllSslSocketFactory.java index 9218bdb0af3..b5ef3899f40 100644 --- a/core/src/main/java/org/apache/calcite/runtime/TrustAllSslSocketFactory.java +++ b/core/src/main/java/org/apache/calcite/runtime/TrustAllSslSocketFactory.java @@ -112,16 +112,16 @@ public static SSLSocketFactory createSSLSocketFactory() { /** Implementation of {@link X509TrustManager} that trusts all * certificates. */ private static class DummyTrustManager implements X509TrustManager { - public X509Certificate[] getAcceptedIssuers() { + @Override public X509Certificate[] getAcceptedIssuers() { return null; } - public void checkClientTrusted( + @Override public void checkClientTrusted( X509Certificate[] certs, String authType) { } - public void checkServerTrusted( + @Override public void checkServerTrusted( X509Certificate[] certs, String authType) { } 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 9422029e4df..77d2847a919 100644 --- a/core/src/main/java/org/apache/calcite/runtime/Unit.java +++ b/core/src/main/java/org/apache/calcite/runtime/Unit.java @@ -27,11 +27,11 @@ public class Unit implements Comparable { private Unit() { } - public int compareTo(Unit that) { + @Override public int compareTo(Unit that) { return 0; } - public String toString() { + @Override public String toString() { return "{}"; } } diff --git a/core/src/main/java/org/apache/calcite/schema/SchemaPlus.java b/core/src/main/java/org/apache/calcite/schema/SchemaPlus.java index 8043560394f..b57da521206 100644 --- a/core/src/main/java/org/apache/calcite/schema/SchemaPlus.java +++ b/core/src/main/java/org/apache/calcite/schema/SchemaPlus.java @@ -57,7 +57,7 @@ public interface SchemaPlus extends Schema { String getName(); // override with stricter return - SchemaPlus getSubSchema(String name); + @Override SchemaPlus getSubSchema(String name); /** Adds a schema as a sub-schema of this schema, and returns the wrapped * object. */ @@ -75,7 +75,7 @@ public interface SchemaPlus extends Schema { /** Adds a lattice to this schema. */ void add(String name, Lattice lattice); - boolean isMutable(); + @Override boolean isMutable(); /** Returns an underlying object. */ T unwrap(Class clazz); diff --git a/core/src/main/java/org/apache/calcite/schema/Schemas.java b/core/src/main/java/org/apache/calcite/schema/Schemas.java index 126e7e1eae3..1f9ba5391f5 100644 --- a/core/src/main/java/org/apache/calcite/schema/Schemas.java +++ b/core/src/main/java/org/apache/calcite/schema/Schemas.java @@ -380,19 +380,19 @@ private static CalcitePrepare.Context makeContext( final ImmutableList objectPath = objectPath_ == null ? null : ImmutableList.copyOf(objectPath_); return new CalcitePrepare.Context() { - public JavaTypeFactory getTypeFactory() { + @Override public JavaTypeFactory getTypeFactory() { return typeFactory; } - public CalciteSchema getRootSchema() { + @Override public CalciteSchema getRootSchema() { return schema.root(); } - public CalciteSchema getMutableRootSchema() { + @Override public CalciteSchema getMutableRootSchema() { return getRootSchema(); } - public List getDefaultSchemaPath() { + @Override public List getDefaultSchemaPath() { // schemaPath is usually null. If specified, it overrides schema // as the context within which the SQL is validated. if (schemaPath == null) { @@ -401,23 +401,23 @@ public List getDefaultSchemaPath() { return schemaPath; } - public List getObjectPath() { + @Override public List getObjectPath() { return objectPath; } - public CalciteConnectionConfig config() { + @Override public CalciteConnectionConfig config() { return connectionConfig; } - public DataContext getDataContext() { + @Override public DataContext getDataContext() { return dataContext; } - public RelRunner getRelRunner() { + @Override public RelRunner getRelRunner() { throw new UnsupportedOperationException(); } - public CalcitePrepare.SparkHandler spark() { + @Override public CalcitePrepare.SparkHandler spark() { final boolean enable = config().spark(); return CalcitePrepare.Dummy.getSparkHandler(enable); } @@ -555,19 +555,19 @@ private static class DummyDataContext implements DataContext { this.map = ImmutableMap.of(); } - public SchemaPlus getRootSchema() { + @Override public SchemaPlus getRootSchema() { return rootSchema; } - public JavaTypeFactory getTypeFactory() { + @Override public JavaTypeFactory getTypeFactory() { return connection.getTypeFactory(); } - public QueryProvider getQueryProvider() { + @Override public QueryProvider getQueryProvider() { return connection; } - public Object get(String name) { + @Override public Object get(String name) { return map.get(name); } } @@ -594,34 +594,34 @@ private static class PathImpl return pairs.hashCode(); } - public Pair get(int index) { + @Override public Pair get(int index) { return pairs.get(index); } - public int size() { + @Override public int size() { return pairs.size(); } - public Path parent() { + @Override public Path parent() { if (pairs.isEmpty()) { throw new IllegalArgumentException("at root"); } return new PathImpl(pairs.subList(0, pairs.size() - 1)); } - public List names() { + @Override public List names() { return new AbstractList() { - public String get(int index) { + @Override public String get(int index) { return pairs.get(index + 1).left; } - public int size() { + @Override public int size() { return pairs.size() - 1; } }; } - public List schemas() { + @Override public List schemas() { return Pair.right(pairs); } } diff --git a/core/src/main/java/org/apache/calcite/schema/Statistics.java b/core/src/main/java/org/apache/calcite/schema/Statistics.java index 21e8ab62451..c9bc7273de7 100644 --- a/core/src/main/java/org/apache/calcite/schema/Statistics.java +++ b/core/src/main/java/org/apache/calcite/schema/Statistics.java @@ -70,11 +70,11 @@ public static Statistic of(final Double rowCount, collations == null ? null : ImmutableList.copyOf(collations); return new Statistic() { - public Double getRowCount() { + @Override public Double getRowCount() { return rowCount; } - public boolean isKey(ImmutableBitSet columns) { + @Override public boolean isKey(ImmutableBitSet columns) { for (ImmutableBitSet key : keysCopy) { if (columns.contains(key)) { return true; @@ -83,15 +83,15 @@ public boolean isKey(ImmutableBitSet columns) { return false; } - public List getKeys() { + @Override public List getKeys() { return keysCopy; } - public List getReferentialConstraints() { + @Override public List getReferentialConstraints() { return referentialConstraintsCopy; } - public List getCollations() { + @Override public List getCollations() { return collationsCopy; } }; 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 2c01b1958eb..2888a658045 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 @@ -55,15 +55,15 @@ public class AbstractSchema implements Schema { public AbstractSchema() { } - public boolean isMutable() { + @Override public boolean isMutable() { return true; } - public Schema snapshot(SchemaVersion version) { + @Override public Schema snapshot(SchemaVersion version) { return this; } - public Expression getExpression(SchemaPlus parentSchema, String name) { + @Override public Expression getExpression(SchemaPlus parentSchema, String name) { return Schemas.subSchemaExpression(parentSchema, name, getClass()); } @@ -81,11 +81,11 @@ protected Map getTableMap() { return ImmutableMap.of(); } - public final Set getTableNames() { + @Override public final Set getTableNames() { return getTableMap().keySet(); } - public final Table getTable(String name) { + @Override public final Table getTable(String name) { return getTableMap().get(name); } @@ -103,11 +103,11 @@ protected Map getTypeMap() { return ImmutableMap.of(); } - public RelProtoDataType getType(String name) { + @Override public RelProtoDataType getType(String name) { return getTypeMap().get(name); } - public Set getTypeNames() { + @Override public Set getTypeNames() { return getTypeMap().keySet(); } @@ -128,11 +128,11 @@ protected Multimap getFunctionMultimap() { return ImmutableMultimap.of(); } - public final Collection getFunctions(String name) { + @Override public final Collection getFunctions(String name) { return getFunctionMultimap().get(name); // never null } - public final Set getFunctionNames() { + @Override public final Set getFunctionNames() { return getFunctionMultimap().keySet(); } @@ -150,11 +150,11 @@ protected Map getSubSchemaMap() { return ImmutableMap.of(); } - public final Set getSubSchemaNames() { + @Override public final Set getSubSchemaNames() { return getSubSchemaMap().keySet(); } - public final Schema getSubSchema(String name) { + @Override public final Schema getSubSchema(String name) { return getSubSchemaMap().get(name); } @@ -165,7 +165,7 @@ public static class Factory implements SchemaFactory { private Factory() {} - public Schema create(SchemaPlus parentSchema, String name, + @Override public Schema create(SchemaPlus parentSchema, String name, Map operand) { return new AbstractSchema(); } diff --git a/core/src/main/java/org/apache/calcite/schema/impl/AbstractTable.java b/core/src/main/java/org/apache/calcite/schema/impl/AbstractTable.java index 3f93c7ee380..dad2035878f 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/AbstractTable.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/AbstractTable.java @@ -38,15 +38,15 @@ protected AbstractTable() { } // Default implementation. Override if you have statistics. - public Statistic getStatistic() { + @Override public Statistic getStatistic() { return Statistics.UNKNOWN; } - public Schema.TableType getJdbcTableType() { + @Override public Schema.TableType getJdbcTableType() { return Schema.TableType.TABLE; } - public C unwrap(Class aClass) { + @Override public C unwrap(Class aClass) { if (aClass.isInstance(this)) { return aClass.cast(this); } 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 f28651e931f..48ae55ab9a2 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 @@ -50,19 +50,19 @@ public AbstractTableQueryable(QueryProvider queryProvider, this.tableName = tableName; } - public Expression getExpression() { + @Override public Expression getExpression() { return table.getExpression(schema, tableName, Queryable.class); } - public QueryProvider getProvider() { + @Override public QueryProvider getProvider() { return queryProvider; } - public Type getElementType() { + @Override public Type getElementType() { return table.getElementType(); } - public Iterator iterator() { + @Override public Iterator iterator() { return Linq4j.enumeratorIterator(enumerator()); } } diff --git a/core/src/main/java/org/apache/calcite/schema/impl/AggregateFunctionImpl.java b/core/src/main/java/org/apache/calcite/schema/impl/AggregateFunctionImpl.java index 45d83beffbc..47157ccc7ba 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/AggregateFunctionImpl.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/AggregateFunctionImpl.java @@ -129,15 +129,15 @@ public static AggregateFunctionImpl create(Class clazz) { return null; } - public List getParameters() { + @Override public List getParameters() { return parameters; } - public RelDataType getReturnType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getReturnType(RelDataTypeFactory typeFactory) { return typeFactory.createJavaType(resultType); } - public AggImplementor getImplementor(boolean windowContext) { + @Override public AggImplementor getImplementor(boolean windowContext) { return new RexImpTable.UserDefinedAggReflectiveImplementor(this); } } diff --git a/core/src/main/java/org/apache/calcite/schema/impl/DelegatingSchema.java b/core/src/main/java/org/apache/calcite/schema/impl/DelegatingSchema.java index 4cd1af3d4c9..91a0e82083e 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/DelegatingSchema.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/DelegatingSchema.java @@ -47,47 +47,47 @@ public DelegatingSchema(Schema schema) { return "DelegatingSchema(delegate=" + schema + ")"; } - public boolean isMutable() { + @Override public boolean isMutable() { return schema.isMutable(); } - public Schema snapshot(SchemaVersion version) { + @Override public Schema snapshot(SchemaVersion version) { return schema.snapshot(version); } - public Expression getExpression(SchemaPlus parentSchema, String name) { + @Override public Expression getExpression(SchemaPlus parentSchema, String name) { return schema.getExpression(parentSchema, name); } - public Table getTable(String name) { + @Override public Table getTable(String name) { return schema.getTable(name); } - public Set getTableNames() { + @Override public Set getTableNames() { return schema.getTableNames(); } - public RelProtoDataType getType(String name) { + @Override public RelProtoDataType getType(String name) { return schema.getType(name); } - public Set getTypeNames() { + @Override public Set getTypeNames() { return schema.getTypeNames(); } - public Collection getFunctions(String name) { + @Override public Collection getFunctions(String name) { return schema.getFunctions(name); } - public Set getFunctionNames() { + @Override public Set getFunctionNames() { return schema.getFunctionNames(); } - public Schema getSubSchema(String name) { + @Override public Schema getSubSchema(String name) { return schema.getSubSchema(name); } - public Set getSubSchemaNames() { + @Override public Set getSubSchemaNames() { return schema.getSubSchemaNames(); } } 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 f07cda4ace8..12485e7f6e7 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 @@ -91,7 +91,7 @@ public ListTransientTable(String name, RelDataType rowType) { final AtomicBoolean cancelFlag = DataContext.Variable.CANCEL_FLAG.get(root); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { private final List list = new ArrayList(rows); private int i = -1; @@ -123,7 +123,7 @@ public Enumerator enumerator() { }; } - public Expression getExpression(SchemaPlus schema, String tableName, + @Override public Expression getExpression(SchemaPlus schema, String tableName, Class clazz) { return Schemas.tableExpression(schema, elementType, tableName, clazz); } @@ -131,7 +131,7 @@ public Expression getExpression(SchemaPlus schema, String tableName, @Override public Queryable asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { return new AbstractTableQueryable(queryProvider, schema, this, tableName) { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { //noinspection unchecked return (Enumerator) Linq4j.enumerator(rows); } diff --git a/core/src/main/java/org/apache/calcite/schema/impl/LongSchemaVersion.java b/core/src/main/java/org/apache/calcite/schema/impl/LongSchemaVersion.java index 399d1b3436c..fc52962fc26 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/LongSchemaVersion.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/LongSchemaVersion.java @@ -26,7 +26,7 @@ public LongSchemaVersion(long value) { this.value = value; } - public boolean isBefore(SchemaVersion other) { + @Override public boolean isBefore(SchemaVersion other) { if (!(other instanceof LongSchemaVersion)) { throw new IllegalArgumentException( "Cannot compare a LongSchemaVersion object with a " @@ -36,7 +36,7 @@ public boolean isBefore(SchemaVersion other) { return this.value < ((LongSchemaVersion) other).value; } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { if (this == obj) { return true; } @@ -48,11 +48,11 @@ public boolean equals(Object obj) { return this.value == ((LongSchemaVersion) obj).value; } - public int hashCode() { + @Override public int hashCode() { return Long.valueOf(value).hashCode(); } - public String toString() { + @Override public String toString() { return String.valueOf(value); } } diff --git a/core/src/main/java/org/apache/calcite/schema/impl/ModifiableViewTable.java b/core/src/main/java/org/apache/calcite/schema/impl/ModifiableViewTable.java index 2caa91d123d..18331fe6d4d 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/ModifiableViewTable.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/ModifiableViewTable.java @@ -70,20 +70,20 @@ public ModifiableViewTable(Type elementType, RelProtoDataType rowType, this.initializerExpressionFactory = new ModifiableViewTableInitializerExpressionFactory(); } - public RexNode getConstraint(RexBuilder rexBuilder, + @Override public RexNode getConstraint(RexBuilder rexBuilder, RelDataType tableRowType) { return rexBuilder.copy(constraint); } - public ImmutableIntList getColumnMapping() { + @Override public ImmutableIntList getColumnMapping() { return columnMapping; } - public Table getTable() { + @Override public Table getTable() { return table; } - public Path getTablePath() { + @Override public Path getTablePath() { return tablePath; } 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 d01daf7c74f..85aca05a7fd 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 @@ -56,7 +56,7 @@ public ReflectiveFunctionBase(Method method) { * * @return Parameters; never null */ - public List getParameters() { + @Override public List getParameters() { return parameters; } @@ -118,19 +118,19 @@ public ParameterListBuilder add(final Class type, final String name, + (optional ? "?" : ""); } - public int getOrdinal() { + @Override public int getOrdinal() { return ordinal; } - public String getName() { + @Override public String getName() { return name; } - public RelDataType getType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getType(RelDataTypeFactory typeFactory) { return typeFactory.createJavaType(type); } - public boolean isOptional() { + @Override public boolean isOptional() { return optional; } }); diff --git a/core/src/main/java/org/apache/calcite/schema/impl/ScalarFunctionImpl.java b/core/src/main/java/org/apache/calcite/schema/impl/ScalarFunctionImpl.java index 4c2dc012605..36198500ca1 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/ScalarFunctionImpl.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/ScalarFunctionImpl.java @@ -151,11 +151,11 @@ public static ScalarFunction createUnsafe(Method method) { return new ScalarFunctionImpl(method, implementor); } - public RelDataType getReturnType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getReturnType(RelDataTypeFactory typeFactory) { return typeFactory.createJavaType(method.getReturnType()); } - public CallImplementor getImplementor() { + @Override public CallImplementor getImplementor() { return implementor; } 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 71e4bdad4e2..1a0f03803fc 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 @@ -76,7 +76,7 @@ public static StarTable of(Lattice lattice, List tables) { return Schema.TableType.STAR; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { final List typeList = new ArrayList<>(); final List fieldCounts = new ArrayList<>(); for (Table table : tables) { @@ -92,7 +92,7 @@ public RelDataType getRowType(RelDataTypeFactory typeFactory) { return typeFactory.createStructType(typeList, lattice.uniqueColumnNames()); } - public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable table) { + @Override public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable table) { // Create a table scan of infinite cost. return new StarTableScan(context.getCluster(), table); } diff --git a/core/src/main/java/org/apache/calcite/schema/impl/TableFunctionImpl.java b/core/src/main/java/org/apache/calcite/schema/impl/TableFunctionImpl.java index 295d690461b..0ecf9125382 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/TableFunctionImpl.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/TableFunctionImpl.java @@ -92,12 +92,12 @@ public static TableFunction create(final Method method) { return new TableFunctionImpl(method, implementor); } - public RelDataType getRowType(RelDataTypeFactory typeFactory, + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory, List arguments) { return apply(arguments).getRowType(typeFactory); } - public Type getElementType(List arguments) { + @Override public Type getElementType(List arguments) { final Table table = apply(arguments); if (table instanceof QueryableTable) { QueryableTable queryableTable = (QueryableTable) table; @@ -109,14 +109,14 @@ public Type getElementType(List arguments) { + table.getClass()); } - public CallImplementor getImplementor() { + @Override public CallImplementor getImplementor() { return implementor; } private static CallImplementor createImplementor(final Method method) { return RexImpTable.createImplementor( new ReflectiveCallNotNullImplementor(method) { - public Expression implement(RexToLixTranslator translator, + @Override public Expression implement(RexToLixTranslator translator, RexCall call, List translatedOperands) { Expression expr = super.implement(translator, call, translatedOperands); diff --git a/core/src/main/java/org/apache/calcite/schema/impl/TableMacroImpl.java b/core/src/main/java/org/apache/calcite/schema/impl/TableMacroImpl.java index 91cdfc6265f..754eee0ab12 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/TableMacroImpl.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/TableMacroImpl.java @@ -71,7 +71,7 @@ public static TableMacro create(final Method method) { * @param arguments Arguments * @return Table */ - public TranslatableTable apply(List arguments) { + @Override public TranslatableTable apply(List arguments) { try { Object o = null; if (!Modifier.isStatic(method.getModifiers())) { 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 1e439d27e48..5ae67162b63 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 @@ -104,17 +104,17 @@ public List getViewPath() { return Schema.TableType.VIEW; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return protoRowType.apply(typeFactory); } - public Queryable asQueryable(QueryProvider queryProvider, + @Override public Queryable asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { return queryProvider.createQuery( getExpression(schema, tableName, Queryable.class), elementType); } - public RelNode toRel( + @Override public RelNode toRel( RelOptTable.ToRelContext context, RelOptTable relOptTable) { return expandView(context, relOptTable.getRowType(), viewSql).rel; diff --git a/core/src/main/java/org/apache/calcite/schema/impl/ViewTableMacro.java b/core/src/main/java/org/apache/calcite/schema/impl/ViewTableMacro.java index 8bdbbccc5ee..83424a3df8c 100644 --- a/core/src/main/java/org/apache/calcite/schema/impl/ViewTableMacro.java +++ b/core/src/main/java/org/apache/calcite/schema/impl/ViewTableMacro.java @@ -63,11 +63,11 @@ public ViewTableMacro(CalciteSchema schema, String viewSql, schemaPath == null ? null : ImmutableList.copyOf(schemaPath); } - public List getParameters() { + @Override public List getParameters() { return Collections.emptyList(); } - public TranslatableTable apply(List arguments) { + @Override public TranslatableTable apply(List arguments) { final CalciteConnection connection = MaterializedViewTable.MATERIALIZATION_CONNECTION; CalcitePrepare.AnalyzeViewResult parsed = diff --git a/core/src/main/java/org/apache/calcite/sql/ExplicitOperatorBinding.java b/core/src/main/java/org/apache/calcite/sql/ExplicitOperatorBinding.java index e42a461c0cc..cc8a0f8e414 100644 --- a/core/src/main/java/org/apache/calcite/sql/ExplicitOperatorBinding.java +++ b/core/src/main/java/org/apache/calcite/sql/ExplicitOperatorBinding.java @@ -67,16 +67,16 @@ private ExplicitOperatorBinding( //~ Methods ---------------------------------------------------------------- // implement SqlOperatorBinding - public int getOperandCount() { + @Override public int getOperandCount() { return types.size(); } // implement SqlOperatorBinding - public RelDataType getOperandType(int ordinal) { + @Override public RelDataType getOperandType(int ordinal) { return types.get(ordinal); } - public CalciteException newError( + @Override public CalciteException newError( Resources.ExInst e) { if (delegate != null) { return delegate.newError(e); @@ -85,7 +85,7 @@ public CalciteException newError( } } - public boolean isOperandNull(int ordinal, boolean allowCast) { + @Override public boolean isOperandNull(int ordinal, boolean allowCast) { // NOTE jvs 1-May-2006: This call is only relevant // for SQL validation, so anywhere else, just say // everything's OK. diff --git a/core/src/main/java/org/apache/calcite/sql/SqlAbstractDateTimeLiteral.java b/core/src/main/java/org/apache/calcite/sql/SqlAbstractDateTimeLiteral.java index 65fa6bee212..cc7873a5ac6 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlAbstractDateTimeLiteral.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlAbstractDateTimeLiteral.java @@ -65,20 +65,20 @@ public int getPrec() { /** * Returns e.g. DATE '1969-07-21'. */ - public abstract String toString(); + @Override public abstract String toString(); /** * Returns e.g. 1969-07-21. */ public abstract String toFormattedString(); - public RelDataType createSqlType(RelDataTypeFactory typeFactory) { + @Override public RelDataType createSqlType(RelDataTypeFactory typeFactory) { return typeFactory.createSqlType( getTypeName(), getPrec()); } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlAccessType.java b/core/src/main/java/org/apache/calcite/sql/SqlAccessType.java index 7f9ee24733e..d33a7e55575 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlAccessType.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlAccessType.java @@ -50,7 +50,7 @@ public boolean allowsAccess(SqlAccessEnum access) { return accessEnums.contains(access); } - public String toString() { + @Override public String toString() { return accessEnums.toString(); } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlAggFunction.java b/core/src/main/java/org/apache/calcite/sql/SqlAggFunction.java index 9555a0b4e15..cdff6391fcc 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlAggFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlAggFunction.java @@ -111,7 +111,7 @@ protected SqlAggFunction( //~ Methods ---------------------------------------------------------------- - public T unwrap(Class clazz) { + @Override public T unwrap(Class clazz) { return clazz.isInstance(this) ? clazz.cast(this) : null; } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlAsOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlAsOperator.java index 514c29aac67..5bb9e2256e5 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlAsOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlAsOperator.java @@ -64,7 +64,7 @@ protected SqlAsOperator(String name, SqlKind kind, int prec, //~ Methods ---------------------------------------------------------------- - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -93,7 +93,7 @@ public void unparse( writer.endList(frame); } - public void validateCall( + @Override public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, @@ -111,7 +111,7 @@ public void validateCall( } } - public void acceptCall( + @Override public void acceptCall( SqlVisitor visitor, SqlCall call, boolean onlyExpressions, @@ -124,7 +124,7 @@ public void acceptCall( } } - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlBasicCall.java b/core/src/main/java/org/apache/calcite/sql/SqlBasicCall.java index 0a141f70e40..b1d99d9760a 100755 --- a/core/src/main/java/org/apache/calcite/sql/SqlBasicCall.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlBasicCall.java @@ -51,7 +51,7 @@ public SqlBasicCall( this.functionQuantifier = functionQualifier; } - public SqlKind getKind() { + @Override public SqlKind getKind() { return operator.getKind(); } @@ -67,7 +67,7 @@ public void setOperator(SqlOperator operator) { this.operator = Objects.requireNonNull(operator); } - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return operator; } @@ -75,7 +75,7 @@ public SqlNode[] getOperands() { return operands; } - public List getOperandList() { + @Override public List getOperandList() { return UnmodifiableArrayList.of(operands); // not immutable, but quick } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlBinaryOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlBinaryOperator.java index 287c3171453..eb7fcb19461 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlBinaryOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlBinaryOperator.java @@ -70,11 +70,11 @@ public SqlBinaryOperator( //~ Methods ---------------------------------------------------------------- - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.BINARY; } - public String getSignatureTemplate(final int operandsCount) { + @Override public String getSignatureTemplate(final int operandsCount) { Util.discard(operandsCount); // op0 opname op1 @@ -95,7 +95,7 @@ public String getSignatureTemplate(final int operandsCount) { return !getName().equals("."); } - protected RelDataType adjustType( + @Override protected RelDataType adjustType( SqlValidator validator, final SqlCall call, RelDataType type) { @@ -141,7 +141,7 @@ private RelDataType convertType(SqlValidator validator, SqlCall call, RelDataTyp return type; } - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlBinaryStringLiteral.java b/core/src/main/java/org/apache/calcite/sql/SqlBinaryStringLiteral.java index 9c225da287b..eb7a7e3458b 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlBinaryStringLiteral.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlBinaryStringLiteral.java @@ -54,7 +54,7 @@ public BitString getBitString() { return new SqlBinaryStringLiteral((BitString) value, pos); } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { @@ -62,7 +62,7 @@ public void unparse( writer.literal("X'" + ((BitString) value).toHexString() + "'"); } - protected SqlAbstractStringLiteral concat1(List literals) { + @Override protected SqlAbstractStringLiteral concat1(List literals) { return new SqlBinaryStringLiteral( BitString.concat( Util.transform(literals, 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 8678c7e4e44..80cf8bfc8e8 100755 --- a/core/src/main/java/org/apache/calcite/sql/SqlCall.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlCall.java @@ -88,7 +88,7 @@ public int operandCount() { operandList.toArray(new SqlNode[0])); } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { @@ -112,11 +112,11 @@ public void unparse( * {@link SqlOperator#validateCall}. Derived classes may override (as do, * for example {@link SqlSelect} and {@link SqlUpdate}). */ - public void validate(SqlValidator validator, SqlValidatorScope scope) { + @Override public void validate(SqlValidator validator, SqlValidatorScope scope) { validator.validateCall(this, scope); } - public void findValidOptions( + @Override public void findValidOptions( SqlValidator validator, SqlValidatorScope scope, SqlParserPos pos, @@ -135,11 +135,11 @@ public void findValidOptions( // no valid options } - public R accept(SqlVisitor visitor) { + @Override public R accept(SqlVisitor visitor) { return visitor.visit(this); } - public boolean equalsDeep(SqlNode node, Litmus litmus) { + @Override public boolean equalsDeep(SqlNode node, Litmus litmus) { if (node == this) { return true; } @@ -175,7 +175,7 @@ protected String getCallSignature( return SqlUtil.getOperatorSignature(getOperator(), signatureList); } - public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { + @Override public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { // Delegate to operator. final SqlCallBinding binding = new SqlCallBinding(scope.getValidator(), scope, this); diff --git a/core/src/main/java/org/apache/calcite/sql/SqlCallBinding.java b/core/src/main/java/org/apache/calcite/sql/SqlCallBinding.java index c0bda8dd71e..8448ef4e338 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlCallBinding.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlCallBinding.java @@ -227,7 +227,7 @@ public SqlCall permutedCall() { return call.getOperator().createCall(call.pos, operandList); } - public SqlMonotonicity getOperandMonotonicity(int ordinal) { + @Override public SqlMonotonicity getOperandMonotonicity(int ordinal) { return call.getOperandList().get(ordinal).getMonotonicity(scope); } @@ -375,7 +375,7 @@ private T valueAs(SqlNode node, Class clazz) { return validator.getParentCursor(paramName); } - public CalciteException newError( + @Override public CalciteException newError( Resources.ExInst e) { return validator.newValidationError(call, e); } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlCharStringLiteral.java b/core/src/main/java/org/apache/calcite/sql/SqlCharStringLiteral.java index 15c7c6d9793..bab807f53da 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlCharStringLiteral.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlCharStringLiteral.java @@ -61,7 +61,7 @@ public SqlCollation getCollation() { return new SqlCharStringLiteral((NlsString) value, pos); } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { @@ -76,7 +76,7 @@ public void unparse( writer.literal(nlsString.asSql(true, true, writer.getDialect())); } - protected SqlAbstractStringLiteral concat1(List literals) { + @Override protected SqlAbstractStringLiteral concat1(List literals) { return new SqlCharStringLiteral( NlsString.concat( Util.transform(literals, diff --git a/core/src/main/java/org/apache/calcite/sql/SqlCollation.java b/core/src/main/java/org/apache/calcite/sql/SqlCollation.java index cadc89e783c..36cb6312e82 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlCollation.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlCollation.java @@ -274,7 +274,7 @@ protected static SqlCollation getCoercibilityDyadic( } } - public String toString() { + @Override public String toString() { return "COLLATE " + collationName; } 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 93bba29ab79..5d3c263f75b 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java @@ -122,11 +122,11 @@ public SqlDataTypeSpec( //~ Methods ---------------------------------------------------------------- - public SqlNode clone(SqlParserPos pos) { + @Override public SqlNode clone(SqlParserPos pos) { return new SqlDataTypeSpec(typeNameSpec, timeZone, pos); } - public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { + @Override public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { return SqlMonotonicity.CONSTANT; } @@ -183,19 +183,19 @@ public SqlDataTypeSpec getComponentTypeSpec() { return new SqlDataTypeSpec(elementTypeName, timeZone, getParserPosition()); } - public void unparse(SqlWriter writer, int leftPrec, int rightPrec) { + @Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) { typeNameSpec.unparse(writer, leftPrec, rightPrec); } - public void validate(SqlValidator validator, SqlValidatorScope scope) { + @Override public void validate(SqlValidator validator, SqlValidatorScope scope) { validator.validateDataType(this); } - public R accept(SqlVisitor visitor) { + @Override public R accept(SqlVisitor visitor) { return visitor.visit(this); } - public boolean equalsDeep(SqlNode node, Litmus litmus) { + @Override public boolean equalsDeep(SqlNode node, Litmus litmus) { if (!(node instanceof SqlDataTypeSpec)) { return litmus.fail("{} != {}", this, node); } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlDateLiteral.java b/core/src/main/java/org/apache/calcite/sql/SqlDateLiteral.java index 62f862f712a..bc302a3c025 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlDateLiteral.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlDateLiteral.java @@ -53,15 +53,15 @@ protected DateString getDate() { /** * Returns e.g. '1969-07-21'. */ - public String toFormattedString() { + @Override public String toFormattedString() { return getDate().toString(); } - public RelDataType createSqlType(RelDataTypeFactory typeFactory) { + @Override public RelDataType createSqlType(RelDataTypeFactory typeFactory) { return typeFactory.createSqlType(getTypeName()); } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlDdl.java b/core/src/main/java/org/apache/calcite/sql/SqlDdl.java index 3abbcf8b45e..ae97be418e8 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlDdl.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlDdl.java @@ -34,7 +34,7 @@ public SqlDdl(SqlOperator operator, SqlParserPos pos) { this.operator = Objects.requireNonNull(operator); } - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return operator; } } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlDelete.java b/core/src/main/java/org/apache/calcite/sql/SqlDelete.java index e9772f1cbd2..a76c40c2e62 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlDelete.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlDelete.java @@ -58,11 +58,11 @@ public SqlDelete( return SqlKind.DELETE; } - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return OPERATOR; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableNullableList.of(targetTable, condition, alias); } @@ -137,7 +137,7 @@ public SqlSelect getSourceSelect() { writer.endList(frame); } - public void validate(SqlValidator validator, SqlValidatorScope scope) { + @Override public void validate(SqlValidator validator, SqlValidatorScope scope) { validator.validateDelete(this); } 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 38c823cee6b..49726c2896c 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlDialect.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlDialect.java @@ -1395,11 +1395,11 @@ private ContextImpl(DatabaseProduct databaseProduct, this.jethroInfo = Objects.requireNonNull(jethroInfo); } - @Nonnull public DatabaseProduct databaseProduct() { + @Override @Nonnull public DatabaseProduct databaseProduct() { return databaseProduct; } - public Context withDatabaseProduct( + @Override public Context withDatabaseProduct( @Nonnull DatabaseProduct databaseProduct) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, @@ -1408,11 +1408,11 @@ public Context withDatabaseProduct( conformance, nullCollation, dataTypeSystem, jethroInfo); } - public String databaseProductName() { + @Override public String databaseProductName() { return databaseProductName; } - public Context withDatabaseProductName(String databaseProductName) { + @Override public Context withDatabaseProductName(String databaseProductName) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, literalQuoteString, literalEscapedQuoteString, @@ -1420,11 +1420,11 @@ public Context withDatabaseProductName(String databaseProductName) { conformance, nullCollation, dataTypeSystem, jethroInfo); } - public String databaseVersion() { + @Override public String databaseVersion() { return databaseVersion; } - public Context withDatabaseVersion(String databaseVersion) { + @Override public Context withDatabaseVersion(String databaseVersion) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, literalQuoteString, literalEscapedQuoteString, @@ -1432,11 +1432,11 @@ public Context withDatabaseVersion(String databaseVersion) { conformance, nullCollation, dataTypeSystem, jethroInfo); } - public int databaseMajorVersion() { + @Override public int databaseMajorVersion() { return databaseMajorVersion; } - public Context withDatabaseMajorVersion(int databaseMajorVersion) { + @Override public Context withDatabaseMajorVersion(int databaseMajorVersion) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, literalQuoteString, literalEscapedQuoteString, @@ -1444,11 +1444,11 @@ public Context withDatabaseMajorVersion(int databaseMajorVersion) { conformance, nullCollation, dataTypeSystem, jethroInfo); } - public int databaseMinorVersion() { + @Override public int databaseMinorVersion() { return databaseMinorVersion; } - public Context withDatabaseMinorVersion(int databaseMinorVersion) { + @Override public Context withDatabaseMinorVersion(int databaseMinorVersion) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, literalQuoteString, literalEscapedQuoteString, @@ -1456,11 +1456,11 @@ public Context withDatabaseMinorVersion(int databaseMinorVersion) { conformance, nullCollation, dataTypeSystem, jethroInfo); } - public String literalQuoteString() { + @Override public String literalQuoteString() { return literalQuoteString; } - public Context withLiteralQuoteString(String literalQuoteString) { + @Override public Context withLiteralQuoteString(String literalQuoteString) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, literalQuoteString, literalEscapedQuoteString, @@ -1468,11 +1468,11 @@ public Context withLiteralQuoteString(String literalQuoteString) { conformance, nullCollation, dataTypeSystem, jethroInfo); } - public String literalEscapedQuoteString() { + @Override public String literalEscapedQuoteString() { return literalEscapedQuoteString; } - public Context withLiteralEscapedQuoteString( + @Override public Context withLiteralEscapedQuoteString( String literalEscapedQuoteString) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, @@ -1481,11 +1481,11 @@ public Context withLiteralEscapedQuoteString( conformance, nullCollation, dataTypeSystem, jethroInfo); } - public String identifierQuoteString() { + @Override public String identifierQuoteString() { return identifierQuoteString; } - @Nonnull public Context withIdentifierQuoteString( + @Override @Nonnull public Context withIdentifierQuoteString( String identifierQuoteString) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, @@ -1494,11 +1494,11 @@ public String identifierQuoteString() { conformance, nullCollation, dataTypeSystem, jethroInfo); } - @Nonnull public Casing unquotedCasing() { + @Override @Nonnull public Casing unquotedCasing() { return unquotedCasing; } - @Nonnull public Context withUnquotedCasing(Casing unquotedCasing) { + @Override @Nonnull public Context withUnquotedCasing(Casing unquotedCasing) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, literalQuoteString, literalEscapedQuoteString, @@ -1506,11 +1506,11 @@ public String identifierQuoteString() { conformance, nullCollation, dataTypeSystem, jethroInfo); } - @Nonnull public Casing quotedCasing() { + @Override @Nonnull public Casing quotedCasing() { return quotedCasing; } - @Nonnull public Context withQuotedCasing(Casing quotedCasing) { + @Override @Nonnull public Context withQuotedCasing(Casing quotedCasing) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, literalQuoteString, literalEscapedQuoteString, @@ -1518,11 +1518,11 @@ public String identifierQuoteString() { conformance, nullCollation, dataTypeSystem, jethroInfo); } - public boolean caseSensitive() { + @Override public boolean caseSensitive() { return caseSensitive; } - @Nonnull public Context withCaseSensitive(boolean caseSensitive) { + @Override @Nonnull public Context withCaseSensitive(boolean caseSensitive) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, literalQuoteString, literalEscapedQuoteString, @@ -1530,11 +1530,11 @@ public boolean caseSensitive() { conformance, nullCollation, dataTypeSystem, jethroInfo); } - @Nonnull public SqlConformance conformance() { + @Override @Nonnull public SqlConformance conformance() { return conformance; } - @Nonnull public Context withConformance(SqlConformance conformance) { + @Override @Nonnull public Context withConformance(SqlConformance conformance) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, literalQuoteString, literalEscapedQuoteString, @@ -1542,11 +1542,11 @@ public boolean caseSensitive() { conformance, nullCollation, dataTypeSystem, jethroInfo); } - @Nonnull public NullCollation nullCollation() { + @Override @Nonnull public NullCollation nullCollation() { return nullCollation; } - @Nonnull public Context withNullCollation( + @Override @Nonnull public Context withNullCollation( @Nonnull NullCollation nullCollation) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, @@ -1555,11 +1555,11 @@ public boolean caseSensitive() { conformance, nullCollation, dataTypeSystem, jethroInfo); } - @Nonnull public RelDataTypeSystem dataTypeSystem() { + @Override @Nonnull public RelDataTypeSystem dataTypeSystem() { return dataTypeSystem; } - public Context withDataTypeSystem(@Nonnull RelDataTypeSystem dataTypeSystem) { + @Override public Context withDataTypeSystem(@Nonnull RelDataTypeSystem dataTypeSystem) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, literalQuoteString, literalEscapedQuoteString, @@ -1567,11 +1567,11 @@ public Context withDataTypeSystem(@Nonnull RelDataTypeSystem dataTypeSystem) { conformance, nullCollation, dataTypeSystem, jethroInfo); } - @Nonnull public JethroDataSqlDialect.JethroInfo jethroInfo() { + @Override @Nonnull public JethroDataSqlDialect.JethroInfo jethroInfo() { return jethroInfo; } - public Context withJethroInfo(JethroDataSqlDialect.JethroInfo jethroInfo) { + @Override public Context withJethroInfo(JethroDataSqlDialect.JethroInfo jethroInfo) { return new ContextImpl(databaseProduct, databaseProductName, databaseVersion, databaseMajorVersion, databaseMinorVersion, literalQuoteString, literalEscapedQuoteString, diff --git a/core/src/main/java/org/apache/calcite/sql/SqlDialectFactoryImpl.java b/core/src/main/java/org/apache/calcite/sql/SqlDialectFactoryImpl.java index d150794c912..11094273835 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlDialectFactoryImpl.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlDialectFactoryImpl.java @@ -69,7 +69,7 @@ public class SqlDialectFactoryImpl implements SqlDialectFactory { private final JethroDataSqlDialect.JethroInfoCache jethroCache = JethroDataSqlDialect.createCache(); - public SqlDialect create(DatabaseMetaData databaseMetaData) { + @Override public SqlDialect create(DatabaseMetaData databaseMetaData) { String databaseProductName; int databaseMajorVersion; int databaseMinorVersion; diff --git a/core/src/main/java/org/apache/calcite/sql/SqlDynamicParam.java b/core/src/main/java/org/apache/calcite/sql/SqlDynamicParam.java index 1e2a084bec9..0cdb794727a 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlDynamicParam.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlDynamicParam.java @@ -45,11 +45,11 @@ public SqlDynamicParam( //~ Methods ---------------------------------------------------------------- - public SqlNode clone(SqlParserPos pos) { + @Override public SqlNode clone(SqlParserPos pos) { return new SqlDynamicParam(index, pos); } - public SqlKind getKind() { + @Override public SqlKind getKind() { return SqlKind.DYNAMIC_PARAM; } @@ -57,26 +57,26 @@ public int getIndex() { return index; } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { writer.dynamicParam(index); } - public void validate(SqlValidator validator, SqlValidatorScope scope) { + @Override public void validate(SqlValidator validator, SqlValidatorScope scope) { validator.validateDynamicParam(this); } - public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { + @Override public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { return SqlMonotonicity.CONSTANT; } - public R accept(SqlVisitor visitor) { + @Override public R accept(SqlVisitor visitor) { return visitor.visit(this); } - public boolean equalsDeep(SqlNode node, Litmus litmus) { + @Override public boolean equalsDeep(SqlNode node, Litmus litmus) { if (!(node instanceof SqlDynamicParam)) { return litmus.fail("{} != {}", this, node); } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlExplain.java b/core/src/main/java/org/apache/calcite/sql/SqlExplain.java index 79ccc5fbf17..7af8bd6fd54 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlExplain.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlExplain.java @@ -74,11 +74,11 @@ public SqlExplain(SqlParserPos pos, return SqlKind.EXPLAIN; } - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return OPERATOR; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableNullableList.of(explicandum, detailLevel, depth, format); } 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 a77280dbcbe..885be2090a8 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlFilterOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlFilterOperator.java @@ -62,7 +62,7 @@ public SqlFilterOperator() { writer.endList(frame); } - public void validateCall( + @Override public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, @@ -89,7 +89,7 @@ public void validateCall( } } - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlFunction.java b/core/src/main/java/org/apache/calcite/sql/SqlFunction.java index e2128e669ef..4000b0eacbc 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlFunction.java @@ -134,7 +134,7 @@ protected SqlFunction( //~ Methods ---------------------------------------------------------------- - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.FUNCTION; } @@ -167,7 +167,7 @@ public List getParamNames() { return Functions.generate(getParamTypes().size(), i -> "arg" + i); } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -191,7 +191,7 @@ public boolean isQuantifierAllowed() { return false; } - public void validateCall( + @Override public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, @@ -219,7 +219,7 @@ protected void validateQuantifier(SqlValidator validator, SqlCall call) { } } - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlFunctionalOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlFunctionalOperator.java index ca26a1586a1..17ecc12fd90 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlFunctionalOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlFunctionalOperator.java @@ -47,7 +47,7 @@ public SqlFunctionalOperator( //~ Methods ---------------------------------------------------------------- - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/SqlHint.java b/core/src/main/java/org/apache/calcite/sql/SqlHint.java index bbdc0fee538..558afb5159f 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlHint.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlHint.java @@ -84,11 +84,11 @@ public SqlHint( //~ Methods ---------------------------------------------------------------- - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return OPERATOR; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableList.of(name, options); } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlIdentifier.java b/core/src/main/java/org/apache/calcite/sql/SqlIdentifier.java index d3380758f6e..3db2bad0419 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlIdentifier.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlIdentifier.java @@ -127,7 +127,7 @@ public static SqlIdentifier star(List names, SqlParserPos pos, //~ Methods ---------------------------------------------------------------- - public SqlKind getKind() { + @Override public SqlKind getKind() { return SqlKind.IDENTIFIER; } @@ -277,18 +277,18 @@ public SqlIdentifier skipLast(int n) { return getComponent(0, names.size() - n); } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { SqlUtil.unparseSqlIdentifierSyntax(writer, this, false); } - public void validate(SqlValidator validator, SqlValidatorScope scope) { + @Override public void validate(SqlValidator validator, SqlValidatorScope scope) { validator.validateIdentifier(this, scope); } - public void validateExpr(SqlValidator validator, SqlValidatorScope scope) { + @Override public void validateExpr(SqlValidator validator, SqlValidatorScope scope) { // First check for builtin functions which don't have parentheses, // like "LOCALTIME". final SqlCall call = validator.makeNullaryCall(this); @@ -300,7 +300,7 @@ public void validateExpr(SqlValidator validator, SqlValidatorScope scope) { validator.validateIdentifier(this, scope); } - public boolean equalsDeep(SqlNode node, Litmus litmus) { + @Override public boolean equalsDeep(SqlNode node, Litmus litmus) { if (!(node instanceof SqlIdentifier)) { return litmus.fail("{} != {}", this, node); } @@ -316,7 +316,7 @@ public boolean equalsDeep(SqlNode node, Litmus litmus) { return litmus.succeed(); } - public R accept(SqlVisitor visitor) { + @Override public R accept(SqlVisitor visitor) { return visitor.visit(this); } @@ -356,7 +356,7 @@ public boolean isComponentQuoted(int i) { && componentPositions.get(i).isQuoted(); } - public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { + @Override public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { // for "star" column, whether it's static or dynamic return not_monotonic directly. if (Util.last(names).equals("") || DynamicRecordType.isDynamicStarColName(Util.last(names))) { return SqlMonotonicity.NOT_MONOTONIC; diff --git a/core/src/main/java/org/apache/calcite/sql/SqlInfixOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlInfixOperator.java index 8d716f87b36..10489adb8a4 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlInfixOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlInfixOperator.java @@ -56,7 +56,7 @@ protected SqlInfixOperator( //~ Methods ---------------------------------------------------------------- - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/SqlInsert.java b/core/src/main/java/org/apache/calcite/sql/SqlInsert.java index b3dccd7008b..30f8cf24fca 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlInsert.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlInsert.java @@ -67,11 +67,11 @@ public SqlInsert(SqlParserPos pos, return SqlKind.INSERT; } - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return OPERATOR; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableNullableList.of(keywords, targetTable, source, columnList); } @@ -154,7 +154,7 @@ public final SqlNode getModifierNode(SqlInsertKeyword modifier) { source.unparse(writer, 0, 0); } - public void validate(SqlValidator validator, SqlValidatorScope scope) { + @Override public void validate(SqlValidator validator, SqlValidatorScope scope) { validator.validateInsert(this); } } 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 d0d49bb3770..bbaae81fc17 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlIntervalLiteral.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlIntervalLiteral.java @@ -68,7 +68,7 @@ private SqlIntervalLiteral( return new SqlIntervalLiteral((IntervalValue) value, getTypeName(), pos); } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { @@ -76,7 +76,7 @@ public void unparse( } @SuppressWarnings("deprecation") - public int signum() { + @Override public int signum() { return ((IntervalValue) value).signum(); } @@ -109,7 +109,7 @@ public static class IntervalValue { this.intervalStr = intervalStr; } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { if (!(obj instanceof IntervalValue)) { return false; } @@ -120,7 +120,7 @@ public boolean equals(Object obj) { Litmus.IGNORE); } - public int hashCode() { + @Override public int hashCode() { return Objects.hash(sign, intervalStr, intervalQualifier); } @@ -147,7 +147,7 @@ public int signum() { return 0; } - public String toString() { + @Override public String toString() { return intervalStr; } } 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 e0d0cd9f7e4..f67b9452177 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlIntervalQualifier.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlIntervalQualifier.java @@ -178,17 +178,17 @@ public SqlTypeName typeName() { } } - public void validate( + @Override public void validate( SqlValidator validator, SqlValidatorScope scope) { validator.validateIntervalQualifier(this); } - public R accept(SqlVisitor visitor) { + @Override public R accept(SqlVisitor visitor) { return visitor.visit(this); } - public boolean equalsDeep(SqlNode node, Litmus litmus) { + @Override public boolean equalsDeep(SqlNode node, Litmus litmus) { final String thisString = this.toString(); final String thatString = node.toString(); if (!thisString.equals(thatString)) { @@ -305,12 +305,12 @@ public TimeUnit getUnit() { return Util.first(timeUnitRange.endUnit, timeUnitRange.startUnit); } - public SqlNode clone(SqlParserPos pos) { + @Override public SqlNode clone(SqlParserPos pos) { return new SqlIntervalQualifier(timeUnitRange.startUnit, startPrecision, timeUnitRange.endUnit, fractionalSecondPrecision, pos); } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlJdbcFunctionCall.java b/core/src/main/java/org/apache/calcite/sql/SqlJdbcFunctionCall.java index c04babcd4e7..058ed591480 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlJdbcFunctionCall.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlJdbcFunctionCall.java @@ -435,7 +435,7 @@ private static String constructFuncList(String... functionNames) { return sb.toString(); } - public SqlCall createCall( + @Override public SqlCall createCall( SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands) { @@ -460,11 +460,11 @@ public SqlCall getLookupCall() { return lookupCall; } - public String getAllowedSignatures(String name) { + @Override public String getAllowedSignatures(String name) { return lookupMakeCallObj.getOperator().getAllowedSignatures(name); } - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { @@ -480,7 +480,7 @@ public RelDataType deriveType( return validateOperands(validator, scope, call); } - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( SqlOperatorBinding opBinding) { // only expected to come here if validator called this method SqlCallBinding callBinding = (SqlCallBinding) opBinding; @@ -511,7 +511,7 @@ public RelDataType inferReturnType( callBinding.getScope(), newCall); } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -581,15 +581,15 @@ public SimpleMakeCall(SqlOperator operator) { this.operator = operator; } - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return operator; } - public SqlCall createCall(SqlParserPos pos, SqlNode... operands) { + @Override public SqlCall createCall(SqlParserPos pos, SqlNode... operands) { return operator.createCall(pos, operands); } - public String isValidArgCount(SqlCallBinding binding) { + @Override public String isValidArgCount(SqlCallBinding binding) { return null; // any number of arguments is valid } } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlJoin.java b/core/src/main/java/org/apache/calcite/sql/SqlJoin.java index 21663e83e37..41342bc853b 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlJoin.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlJoin.java @@ -74,7 +74,7 @@ public SqlJoin(SqlParserPos pos, SqlNode left, SqlLiteral natural, //~ Methods ---------------------------------------------------------------- - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return OPERATOR; } @@ -82,7 +82,7 @@ public SqlOperator getOperator() { return SqlKind.JOIN; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableNullableList.of(left, natural, joinType, right, conditionType, condition); } @@ -175,11 +175,11 @@ private SqlJoinOperator() { //~ Methods ---------------------------------------------------------------- - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.SPECIAL; } - public SqlCall createCall( + @Override public SqlCall createCall( SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands) { 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 c3b7981f093..809c7fde508 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlLiteral.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlLiteral.java @@ -232,11 +232,11 @@ public static boolean valueMatchesType( } } - public SqlLiteral clone(SqlParserPos pos) { + @Override public SqlLiteral clone(SqlParserPos pos) { return new SqlLiteral(value, typeName, pos); } - public @Nonnull SqlKind getKind() { + @Override public @Nonnull SqlKind getKind() { return SqlKind.LITERAL; } @@ -550,15 +550,15 @@ public String toValue() { } } - public void validate(SqlValidator validator, SqlValidatorScope scope) { + @Override public void validate(SqlValidator validator, SqlValidatorScope scope) { validator.validateLiteral(this); } - public R accept(SqlVisitor visitor) { + @Override public R accept(SqlVisitor visitor) { return visitor.visit(this); } - public boolean equalsDeep(SqlNode node, Litmus litmus) { + @Override public boolean equalsDeep(SqlNode node, Litmus litmus) { if (!(node instanceof SqlLiteral)) { return litmus.fail("{} != {}", this, node); } @@ -569,7 +569,7 @@ public boolean equalsDeep(SqlNode node, Litmus litmus) { return litmus.succeed(); } - public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { + @Override public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { return SqlMonotonicity.CONSTANT; } @@ -618,7 +618,7 @@ public static SqlLiteral createSample( return new SqlLiteral(sampleSpec, SqlTypeName.SYMBOL, pos); } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { if (!(obj instanceof SqlLiteral)) { return false; } @@ -626,7 +626,7 @@ public boolean equals(Object obj) { return Objects.equals(value, that.value); } - public int hashCode() { + @Override public int hashCode() { return (value == null) ? 0 : value.hashCode(); } @@ -715,7 +715,7 @@ public String getStringValue() { return ((NlsString) value).getValue(); } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlMerge.java b/core/src/main/java/org/apache/calcite/sql/SqlMerge.java index 665897e08dc..167aa8b0a2e 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlMerge.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlMerge.java @@ -63,7 +63,7 @@ public SqlMerge(SqlParserPos pos, //~ Methods ---------------------------------------------------------------- - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return OPERATOR; } @@ -71,7 +71,7 @@ public SqlOperator getOperator() { return SqlKind.MERGE; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableNullableList.of(targetTable, condition, source, updateCall, insertCall, sourceSelect, alias); } @@ -207,7 +207,7 @@ public void setSourceSelect(SqlSelect sourceSelect) { } } - public void validate(SqlValidator validator, SqlValidatorScope scope) { + @Override public void validate(SqlValidator validator, SqlValidatorScope scope) { validator.validateMerge(this); } } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlNode.java b/core/src/main/java/org/apache/calcite/sql/SqlNode.java index 27af71439e2..d4cb3bcef93 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlNode.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlNode.java @@ -71,7 +71,7 @@ public abstract class SqlNode implements Cloneable { * along too much baggage from early versions of Java */ @Deprecated @SuppressWarnings("MethodDoesntCallSuperMethod") - public Object clone() { + @Override public Object clone() { return clone(getParserPosition()); } @@ -125,7 +125,7 @@ public static SqlNode[] cloneArray(SqlNode[] nodes) { return clones; } - public String toString() { + @Override public String toString() { return toSqlString(c -> c.withDialect(AnsiSqlDialect.DEFAULT) .withAlwaysUseParentheses(false) .withSelectListItemsOnSeparateLines(false) diff --git a/core/src/main/java/org/apache/calcite/sql/SqlNodeList.java b/core/src/main/java/org/apache/calcite/sql/SqlNodeList.java index 937945d5f2e..0d17ada3036 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlNodeList.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlNodeList.java @@ -43,7 +43,7 @@ public class SqlNodeList extends SqlNode implements Iterable { */ public static final SqlNodeList EMPTY = new SqlNodeList(SqlParserPos.ZERO) { - public void add(SqlNode node) { + @Override public void add(SqlNode node) { throw new UnsupportedOperationException(); } }; @@ -88,7 +88,7 @@ public SqlNodeList( //~ Methods ---------------------------------------------------------------- // implement Iterable - public Iterator iterator() { + @Override public Iterator iterator() { return list.iterator(); } @@ -100,7 +100,7 @@ public void add(SqlNode node) { list.add(node); } - public SqlNodeList clone(SqlParserPos pos) { + @Override public SqlNodeList clone(SqlParserPos pos) { return new SqlNodeList(list, pos); } @@ -116,7 +116,7 @@ public int size() { return list.size(); } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { @@ -137,17 +137,17 @@ void andOrList(SqlWriter writer, SqlBinaryOperator sepOp) { writer.list(SqlWriter.FrameTypeEnum.WHERE_LIST, sepOp, this); } - public void validate(SqlValidator validator, SqlValidatorScope scope) { + @Override public void validate(SqlValidator validator, SqlValidatorScope scope) { for (SqlNode child : list) { child.validate(validator, scope); } } - public R accept(SqlVisitor visitor) { + @Override public R accept(SqlVisitor visitor) { return visitor.visit(this); } - public boolean equalsDeep(SqlNode node, Litmus litmus) { + @Override public boolean equalsDeep(SqlNode node, Litmus litmus) { if (!(node instanceof SqlNodeList)) { return litmus.fail("{} != {}", this, node); } @@ -201,7 +201,7 @@ public static SqlNodeList of(SqlNode node1, SqlNode node2, SqlNode... nodes) { return list; } - public void validateExpr(SqlValidator validator, SqlValidatorScope scope) { + @Override public void validateExpr(SqlValidator validator, SqlValidatorScope scope) { // While a SqlNodeList is not always a valid expression, this // implementation makes that assumption. It just validates the members // of the list. diff --git a/core/src/main/java/org/apache/calcite/sql/SqlNullTreatmentOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlNullTreatmentOperator.java index 298ae2f09c6..2e1afd1c92d 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlNullTreatmentOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlNullTreatmentOperator.java @@ -48,7 +48,7 @@ public SqlNullTreatmentOperator(SqlKind kind) { writer.keyword(getName()); } - public void validateCall( + @Override public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, diff --git a/core/src/main/java/org/apache/calcite/sql/SqlNumericLiteral.java b/core/src/main/java/org/apache/calcite/sql/SqlNumericLiteral.java index 40584f9b6bc..d1c0c7e14e0 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlNumericLiteral.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlNumericLiteral.java @@ -70,14 +70,14 @@ public boolean isExact() { isExact, pos); } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { writer.literal(toValue()); } - public String toValue() { + @Override public String toValue() { BigDecimal bd = (BigDecimal) value; if (isExact) { return value.toString(); @@ -85,7 +85,7 @@ public String toValue() { return Util.toScientificNotation(bd); } - public RelDataType createSqlType(RelDataTypeFactory typeFactory) { + @Override public RelDataType createSqlType(RelDataTypeFactory typeFactory) { if (isExact) { int scaleValue = scale.intValue(); if (0 == scaleValue) { 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 310b325f65a..c69596bf157 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlOperator.java @@ -213,7 +213,7 @@ public SqlKind getKind() { return kind; } - public String toString() { + @Override public String toString() { return name; } @@ -366,7 +366,7 @@ protected void unparseListClause( } // override Object - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { if (!(obj instanceof SqlOperator)) { return false; } 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 aabf09e8825..fce400a630f 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlOperatorBinding.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlOperatorBinding.java @@ -205,11 +205,11 @@ public SqlMonotonicity getOperandMonotonicity(int ordinal) { */ public List collectOperandTypes() { return new AbstractList() { - public RelDataType get(int index) { + @Override public RelDataType get(int index) { return getOperandType(index); } - public int size() { + @Override public int size() { return getOperandCount(); } }; 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 e21fe4d4e5c..50a967051be 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlOrderBy.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlOrderBy.java @@ -60,11 +60,11 @@ public SqlOrderBy(SqlParserPos pos, SqlNode query, SqlNodeList orderList, return SqlKind.ORDER_BY; } - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return OPERATOR; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableNullableList.of(query, orderList, offset, fetch); } @@ -75,11 +75,11 @@ private Operator() { super("ORDER BY", SqlKind.ORDER_BY, 0); } - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.POSTFIX; } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, 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 99b7a63cb3b..68f46eee028 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlOverOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlOverOperator.java @@ -57,7 +57,7 @@ public SqlOverOperator() { //~ Methods ---------------------------------------------------------------- - public void validateCall( + @Override public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, @@ -78,7 +78,7 @@ public void validateCall( validator.validateWindow(window, scope, aggCall); } - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { @@ -122,7 +122,7 @@ public RelDataType deriveType( * * @param visitor Visitor */ - public void acceptCall( + @Override public void acceptCall( SqlVisitor visitor, SqlCall call, boolean onlyExpressions, diff --git a/core/src/main/java/org/apache/calcite/sql/SqlPostfixOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlPostfixOperator.java index a4e0b7ef4b9..c55085ce0f8 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlPostfixOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlPostfixOperator.java @@ -50,16 +50,16 @@ public SqlPostfixOperator( //~ Methods ---------------------------------------------------------------- - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.POSTFIX; } - public String getSignatureTemplate(final int operandsCount) { + @Override public String getSignatureTemplate(final int operandsCount) { Util.discard(operandsCount); return "{1} {0}"; } - protected RelDataType adjustType( + @Override protected RelDataType adjustType( SqlValidator validator, SqlCall call, RelDataType type) { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlPrefixOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlPrefixOperator.java index 9217d763c19..5c0bfe7d98b 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlPrefixOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlPrefixOperator.java @@ -51,16 +51,16 @@ public SqlPrefixOperator( //~ Methods ---------------------------------------------------------------- - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.PREFIX; } - public String getSignatureTemplate(final int operandsCount) { + @Override public String getSignatureTemplate(final int operandsCount) { Util.discard(operandsCount); return "{0}{1}"; } - protected RelDataType adjustType( + @Override protected RelDataType adjustType( SqlValidator validator, SqlCall call, RelDataType type) { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlProcedureCallOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlProcedureCallOperator.java index f127f733349..d6575389224 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlProcedureCallOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlProcedureCallOperator.java @@ -36,7 +36,7 @@ public SqlProcedureCallOperator() { //~ Methods ---------------------------------------------------------------- // override SqlOperator - public SqlNode rewriteCall(SqlValidator validator, SqlCall call) { + @Override public SqlNode rewriteCall(SqlValidator validator, SqlCall call) { // for now, rewrite "CALL f(x)" to "SELECT f(x) FROM VALUES(0)" // TODO jvs 18-Jan-2005: rewrite to SELECT * FROM TABLE f(x) // once we support function calls as tables 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 77e262411e5..7f4a6f0d496 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlSampleSpec.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlSampleSpec.java @@ -94,7 +94,7 @@ public String getName() { return name; } - public String toString() { + @Override public String toString() { return "SUBSTITUTE(" + CalciteSqlDialect.DEFAULT.quoteStringLiteral(name) + ")"; @@ -153,7 +153,7 @@ public int getRepeatableSeed() { return repeatableSeed; } - public String toString() { + @Override public String toString() { StringBuilder b = new StringBuilder(); b.append(isBernoulli ? "BERNOULLI" : "SYSTEM"); b.append('('); diff --git a/core/src/main/java/org/apache/calcite/sql/SqlSelect.java b/core/src/main/java/org/apache/calcite/sql/SqlSelect.java index b05600d8d55..5b3a92502cf 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlSelect.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlSelect.java @@ -82,7 +82,7 @@ public SqlSelect(SqlParserPos pos, //~ Methods ---------------------------------------------------------------- - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return SqlSelectOperator.INSTANCE; } @@ -228,7 +228,7 @@ public boolean hasHints() { return this.hints != null && this.hints.size() > 0; } - public void validate(SqlValidator validator, SqlValidatorScope scope) { + @Override public void validate(SqlValidator validator, SqlValidatorScope scope) { validator.validateQuery(this, scope, validator.getUnknownType()); } 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 5d12b71ad48..56d75784066 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlSelectOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlSelectOperator.java @@ -53,11 +53,11 @@ private SqlSelectOperator() { //~ Methods ---------------------------------------------------------------- - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.SPECIAL; } - public SqlCall createCall( + @Override public SqlCall createCall( SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands) { @@ -123,7 +123,7 @@ public SqlSelect createCall( hints); } - public void acceptCall( + @Override public void acceptCall( SqlVisitor visitor, SqlCall call, boolean onlyExpressions, @@ -135,7 +135,7 @@ public void acceptCall( } @SuppressWarnings("deprecation") - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -236,7 +236,7 @@ public void unparse( writer.endList(selectFrame); } - public boolean argumentMustBeScalar(int ordinal) { + @Override public boolean argumentMustBeScalar(int ordinal) { return ordinal == SqlSelect.WHERE_OPERAND; } } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlSetOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlSetOperator.java index 2d19a9b3901..6d0f48c4f41 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlSetOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlSetOperator.java @@ -82,7 +82,7 @@ public boolean isDistinct() { return !all; } - public void validateCall( + @Override public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, diff --git a/core/src/main/java/org/apache/calcite/sql/SqlSpecialOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlSpecialOperator.java index e17ea19b8ed..3754952ec34 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlSpecialOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlSpecialOperator.java @@ -64,7 +64,7 @@ public SqlSpecialOperator( //~ Methods ---------------------------------------------------------------- - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.SPECIAL; } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlSplittableAggFunction.java b/core/src/main/java/org/apache/calcite/sql/SqlSplittableAggFunction.java index 9e213bd8a2f..5ec772f084f 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlSplittableAggFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlSplittableAggFunction.java @@ -126,18 +126,18 @@ interface Registry { class CountSplitter implements SqlSplittableAggFunction { public static final CountSplitter INSTANCE = new CountSplitter(); - public AggregateCall split(AggregateCall aggregateCall, + @Override public AggregateCall split(AggregateCall aggregateCall, Mappings.TargetMapping mapping) { return aggregateCall.transform(mapping); } - public AggregateCall other(RelDataTypeFactory typeFactory, AggregateCall e) { + @Override public AggregateCall other(RelDataTypeFactory typeFactory, AggregateCall e) { return AggregateCall.create(SqlStdOperatorTable.COUNT, false, false, false, ImmutableIntList.of(), -1, RelCollations.EMPTY, typeFactory.createSqlType(SqlTypeName.BIGINT), null); } - public AggregateCall topSplit(RexBuilder rexBuilder, + @Override public AggregateCall topSplit(RexBuilder rexBuilder, Registry extra, int offset, RelDataType inputRowType, AggregateCall aggregateCall, int leftSubTotal, int rightSubTotal) { final List merges = new ArrayList<>(); @@ -173,7 +173,7 @@ public AggregateCall topSplit(RexBuilder rexBuilder, * become {@code 1}; otherwise * {@code CASE WHEN arg0 IS NOT NULL THEN 1 ELSE 0 END}. */ - public RexNode singleton(RexBuilder rexBuilder, RelDataType inputRowType, + @Override public RexNode singleton(RexBuilder rexBuilder, RelDataType inputRowType, AggregateCall aggregateCall) { final List predicates = new ArrayList<>(); for (Integer arg : aggregateCall.getArgList()) { @@ -196,7 +196,7 @@ public RexNode singleton(RexBuilder rexBuilder, RelDataType inputRowType, } } - public AggregateCall merge(AggregateCall top, AggregateCall bottom) { + @Override public AggregateCall merge(AggregateCall top, AggregateCall bottom) { if (bottom.getAggregation().getKind() == SqlKind.COUNT && (top.getAggregation().getKind() == SqlKind.SUM || top.getAggregation().getKind() == SqlKind.SUM0)) { @@ -216,23 +216,23 @@ public AggregateCall merge(AggregateCall top, AggregateCall bottom) { class SelfSplitter implements SqlSplittableAggFunction { public static final SelfSplitter INSTANCE = new SelfSplitter(); - public RexNode singleton(RexBuilder rexBuilder, + @Override public RexNode singleton(RexBuilder rexBuilder, RelDataType inputRowType, AggregateCall aggregateCall) { final int arg = aggregateCall.getArgList().get(0); final RelDataTypeField field = inputRowType.getFieldList().get(arg); return rexBuilder.makeInputRef(field.getType(), arg); } - public AggregateCall split(AggregateCall aggregateCall, + @Override public AggregateCall split(AggregateCall aggregateCall, Mappings.TargetMapping mapping) { return aggregateCall.transform(mapping); } - public AggregateCall other(RelDataTypeFactory typeFactory, AggregateCall e) { + @Override public AggregateCall other(RelDataTypeFactory typeFactory, AggregateCall e) { return null; // no aggregate function required on other side } - public AggregateCall topSplit(RexBuilder rexBuilder, + @Override public AggregateCall topSplit(RexBuilder rexBuilder, Registry extra, int offset, RelDataType inputRowType, AggregateCall aggregateCall, int leftSubTotal, int rightSubTotal) { assert (leftSubTotal >= 0) != (rightSubTotal >= 0); @@ -242,7 +242,7 @@ public AggregateCall topSplit(RexBuilder rexBuilder, RelCollations.EMPTY); } - public AggregateCall merge(AggregateCall top, AggregateCall bottom) { + @Override public AggregateCall merge(AggregateCall top, AggregateCall bottom) { if (top.getAggregation().getKind() == bottom.getAggregation().getKind()) { return AggregateCall.create(bottom.getAggregation(), bottom.isDistinct(), bottom.isApproximate(), false, @@ -257,7 +257,7 @@ public AggregateCall merge(AggregateCall top, AggregateCall bottom) { /** Common splitting strategy for {@code SUM} and {@code SUM0} functions. */ abstract class AbstractSumSplitter implements SqlSplittableAggFunction { - public RexNode singleton(RexBuilder rexBuilder, + @Override public RexNode singleton(RexBuilder rexBuilder, RelDataType inputRowType, AggregateCall aggregateCall) { final int arg = aggregateCall.getArgList().get(0); final RelDataTypeField field = inputRowType.getFieldList().get(arg); @@ -267,12 +267,12 @@ public RexNode singleton(RexBuilder rexBuilder, return rexBuilder.makeInputRef(type, arg); } - public AggregateCall split(AggregateCall aggregateCall, + @Override public AggregateCall split(AggregateCall aggregateCall, Mappings.TargetMapping mapping) { return aggregateCall.transform(mapping); } - public AggregateCall other(RelDataTypeFactory typeFactory, AggregateCall e) { + @Override public AggregateCall other(RelDataTypeFactory typeFactory, AggregateCall e) { return AggregateCall.create(SqlStdOperatorTable.COUNT, false, false, false, ImmutableIntList.of(), -1, @@ -280,7 +280,7 @@ public AggregateCall other(RelDataTypeFactory typeFactory, AggregateCall e) { typeFactory.createSqlType(SqlTypeName.BIGINT), null); } - public AggregateCall topSplit(RexBuilder rexBuilder, + @Override public AggregateCall topSplit(RexBuilder rexBuilder, Registry extra, int offset, RelDataType inputRowType, AggregateCall aggregateCall, int leftSubTotal, int rightSubTotal) { final List merges = new ArrayList<>(); @@ -311,7 +311,7 @@ public AggregateCall topSplit(RexBuilder rexBuilder, aggregateCall.type, aggregateCall.name); } - public AggregateCall merge(AggregateCall top, AggregateCall bottom) { + @Override public AggregateCall merge(AggregateCall top, AggregateCall bottom) { SqlKind topKind = top.getAggregation().getKind(); if (topKind == bottom.getAggregation().getKind() && (topKind == SqlKind.SUM diff --git a/core/src/main/java/org/apache/calcite/sql/SqlSyntax.java b/core/src/main/java/org/apache/calcite/sql/SqlSyntax.java index 0f53ee1693a..d43484d61f1 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlSyntax.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlSyntax.java @@ -27,7 +27,7 @@ public enum SqlSyntax { * Function syntax, as in "Foo(x, y)". */ FUNCTION { - public void unparse( + @Override public void unparse( SqlWriter writer, SqlOperator operator, SqlCall call, @@ -42,7 +42,7 @@ public void unparse( * for example "COUNT(*)". */ FUNCTION_STAR { - public void unparse( + @Override public void unparse( SqlWriter writer, SqlOperator operator, SqlCall call, @@ -56,7 +56,7 @@ public void unparse( * Binary operator syntax, as in "x + y". */ BINARY { - public void unparse( + @Override public void unparse( SqlWriter writer, SqlOperator operator, SqlCall call, @@ -70,7 +70,7 @@ public void unparse( * Prefix unary operator syntax, as in "- x". */ PREFIX { - public void unparse( + @Override public void unparse( SqlWriter writer, SqlOperator operator, SqlCall call, @@ -87,7 +87,7 @@ public void unparse( * Postfix unary operator syntax, as in "x ++". */ POSTFIX { - public void unparse( + @Override public void unparse( SqlWriter writer, SqlOperator operator, SqlCall call, @@ -105,7 +105,7 @@ public void unparse( * THEN 2 ELSE 3 END". */ SPECIAL { - public void unparse( + @Override public void unparse( SqlWriter writer, SqlOperator operator, SqlCall call, @@ -124,7 +124,7 @@ public void unparse( * @see SqlConformance#allowNiladicParentheses() */ FUNCTION_ID { - public void unparse( + @Override public void unparse( SqlWriter writer, SqlOperator operator, SqlCall call, @@ -138,7 +138,7 @@ public void unparse( * Syntax of an internal operator, which does not appear in the SQL. */ INTERNAL { - public void unparse( + @Override public void unparse( SqlWriter writer, SqlOperator operator, SqlCall call, 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 7c2386b3568..3d72c45a37e 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlTableRef.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlTableRef.java @@ -50,11 +50,11 @@ public SqlTableRef(SqlParserPos pos, SqlIdentifier tableName, SqlNodeList hints) //~ Methods ---------------------------------------------------------------- - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return OPERATOR; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableList.of(tableName, hints); } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlTimeLiteral.java b/core/src/main/java/org/apache/calcite/sql/SqlTimeLiteral.java index 20ec2f50918..20944ffb964 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlTimeLiteral.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlTimeLiteral.java @@ -48,18 +48,18 @@ protected TimeString getTime() { return new SqlTimeLiteral((TimeString) value, precision, hasTimeZone, pos); } - public String toString() { + @Override public String toString() { return "TIME '" + toFormattedString() + "'"; } /** * Returns e.g. '03:05:67.456'. */ - public String toFormattedString() { + @Override public String toFormattedString() { return getTime().toString(precision); } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlTimestampLiteral.java b/core/src/main/java/org/apache/calcite/sql/SqlTimestampLiteral.java index 47de667b5c4..8ee775a1e6c 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlTimestampLiteral.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlTimestampLiteral.java @@ -44,14 +44,14 @@ public class SqlTimestampLiteral extends SqlAbstractDateTimeLiteral { hasTimeZone, pos); } - public String toString() { + @Override public String toString() { return "TIMESTAMP '" + toFormattedString() + "'"; } /** * Returns e.g. '03:05:67.456'. */ - public String toFormattedString() { + @Override public String toFormattedString() { TimestampString ts = getTimestamp(); if (precision > 0) { ts = ts.round(precision); @@ -59,7 +59,7 @@ public String toFormattedString() { return ts.toString(precision); } - public void unparse( + @Override public void unparse( SqlWriter writer, int leftPrec, int rightPrec) { diff --git a/core/src/main/java/org/apache/calcite/sql/SqlUnnestOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlUnnestOperator.java index 6e87a924d6a..eb1da8c5ea9 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlUnnestOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlUnnestOperator.java @@ -121,7 +121,7 @@ private boolean allowAliasUnnestItems(SqlOperatorBinding operatorBinding) { } } - public boolean argumentMustBeScalar(int ordinal) { + @Override public boolean argumentMustBeScalar(int ordinal) { return false; } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlUpdate.java b/core/src/main/java/org/apache/calcite/sql/SqlUpdate.java index 611e181d0a8..1aef579bc50 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlUpdate.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlUpdate.java @@ -65,11 +65,11 @@ public SqlUpdate(SqlParserPos pos, return SqlKind.UPDATE; } - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return OPERATOR; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableNullableList.of(targetTable, targetColumnList, sourceExpressionList, condition, alias); } @@ -178,7 +178,7 @@ public void setSourceSelect(SqlSelect sourceSelect) { writer.endList(frame); } - public void validate(SqlValidator validator, SqlValidatorScope scope) { + @Override public void validate(SqlValidator validator, SqlValidatorScope scope) { validator.validateUpdate(this); } } diff --git a/core/src/main/java/org/apache/calcite/sql/SqlValuesOperator.java b/core/src/main/java/org/apache/calcite/sql/SqlValuesOperator.java index 3e45ec1d1e4..0175f89a316 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlValuesOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlValuesOperator.java @@ -28,7 +28,7 @@ public SqlValuesOperator() { //~ Methods ---------------------------------------------------------------- - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, 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 ceba7e0f461..88223aaed5f 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlWindow.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlWindow.java @@ -140,7 +140,7 @@ public static SqlWindow create(SqlIdentifier declName, SqlIdentifier refName, //~ Methods ---------------------------------------------------------------- - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return SqlWindowOperator.INSTANCE; } @@ -148,7 +148,7 @@ public SqlOperator getOperator() { return SqlKind.WINDOW; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableNullableList.of(declName, refName, partitionList, orderList, isRows, lowerBound, upperBound, allowPartial); } @@ -790,7 +790,7 @@ enum Bound implements Symbolizable { this.sql = sql; } - public String toString() { + @Override public String toString() { return sql; } } @@ -803,11 +803,11 @@ private SqlWindowOperator() { super("WINDOW", SqlKind.WINDOW, 2, true, null, null, null); } - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.SPECIAL; } - public SqlCall createCall( + @Override public SqlCall createCall( SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands) { @@ -825,7 +825,7 @@ public SqlCall createCall( pos); } - public void acceptCall( + @Override public void acceptCall( SqlVisitor visitor, SqlCall call, boolean onlyExpressions, @@ -849,7 +849,7 @@ public void acceptCall( } } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/SqlWith.java b/core/src/main/java/org/apache/calcite/sql/SqlWith.java index 9363e229141..e9fb1c801ee 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlWith.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlWith.java @@ -49,7 +49,7 @@ public SqlWith(SqlParserPos pos, SqlNodeList withList, SqlNode body) { return SqlWithOperator.INSTANCE; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableList.of(withList, body); } @@ -85,7 +85,7 @@ private SqlWithOperator() { //~ Methods ---------------------------------------------------------------- - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/SqlWithItem.java b/core/src/main/java/org/apache/calcite/sql/SqlWithItem.java index 686f772286b..b0c67be237f 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlWithItem.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlWithItem.java @@ -44,7 +44,7 @@ public SqlWithItem(SqlParserPos pos, SqlIdentifier name, return SqlKind.WITH_ITEM; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableNullableList.of(name, columnList, query); } @@ -64,7 +64,7 @@ public List getOperandList() { } } - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return SqlWithItemOperator.INSTANCE; } @@ -82,7 +82,7 @@ private static class SqlWithItemOperator extends SqlSpecialOperator { //~ Methods ---------------------------------------------------------------- - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, 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 d5402a6a18c..38da619e286 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlWithinGroupOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlWithinGroupOperator.java @@ -52,7 +52,7 @@ public SqlWithinGroupOperator() { writer.endList(orderFrame); } - public void validateCall( + @Override public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, @@ -73,7 +73,7 @@ public void validateCall( validator.validateAggregateParams(aggCall, null, orderList, scope); } - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { 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 b26489ed2ae..1c5cb015e99 100644 --- a/core/src/main/java/org/apache/calcite/sql/SqlWriter.java +++ b/core/src/main/java/org/apache/calcite/sql/SqlWriter.java @@ -263,7 +263,7 @@ enum FrameTypeEnum implements FrameType { this.needsIndent = needsIndent; } - public boolean needsIndent() { + @Override public boolean needsIndent() { return needsIndent; } @@ -275,17 +275,17 @@ public boolean needsIndent() { */ public static FrameType create(final String name) { return new FrameType() { - public String getName() { + @Override public String getName() { return name; } - public boolean needsIndent() { + @Override public boolean needsIndent() { return true; } }; } - public String getName() { + @Override public String getName() { return name(); } } diff --git a/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisorGetHintsFunction.java b/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisorGetHintsFunction.java index e41d15a86a5..cbd2a1893a2 100644 --- a/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisorGetHintsFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisorGetHintsFunction.java @@ -71,20 +71,20 @@ public class SqlAdvisorGetHintsFunction .add(int.class, "pos") .build(); - public CallImplementor getImplementor() { + @Override public CallImplementor getImplementor() { return IMPLEMENTOR; } - public RelDataType getRowType(RelDataTypeFactory typeFactory, + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory, List arguments) { return typeFactory.createJavaType(SqlAdvisorHint.class); } - public Type getElementType(List arguments) { + @Override public Type getElementType(List arguments) { return SqlAdvisorHint.class; } - public List getParameters() { + @Override public List getParameters() { return PARAMETERS; } diff --git a/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisorGetHintsFunction2.java b/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisorGetHintsFunction2.java index 27562508eed..68b2924865d 100644 --- a/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisorGetHintsFunction2.java +++ b/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisorGetHintsFunction2.java @@ -73,20 +73,20 @@ public class SqlAdvisorGetHintsFunction2 .add(int.class, "pos") .build(); - public CallImplementor getImplementor() { + @Override public CallImplementor getImplementor() { return IMPLEMENTOR; } - public RelDataType getRowType(RelDataTypeFactory typeFactory, + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory, List arguments) { return typeFactory.createJavaType(SqlAdvisorHint2.class); } - public Type getElementType(List arguments) { + @Override public Type getElementType(List arguments) { return SqlAdvisorHint2.class; } - public List getParameters() { + @Override public List getParameters() { return PARAMETERS; } diff --git a/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisorValidator.java b/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisorValidator.java index 37ee866b6b4..a4d157fd7dd 100644 --- a/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisorValidator.java +++ b/core/src/main/java/org/apache/calcite/sql/advise/SqlAdvisorValidator.java @@ -75,7 +75,7 @@ public SqlAdvisorValidator( /** * Registers the identifier and its scope into a map keyed by ParserPosition. */ - public void validateIdentifier(SqlIdentifier id, SqlValidatorScope scope) { + @Override public void validateIdentifier(SqlIdentifier id, SqlValidatorScope scope) { registerId(id, scope); try { super.validateIdentifier(id, scope); @@ -95,18 +95,18 @@ private void registerId(SqlIdentifier id, SqlValidatorScope scope) { } } - public SqlNode expand(SqlNode expr, SqlValidatorScope scope) { + @Override public SqlNode expand(SqlNode expr, SqlValidatorScope scope) { // Disable expansion. It doesn't help us come up with better hints. return expr; } - public SqlNode expandSelectExpr(SqlNode expr, + @Override public SqlNode expandSelectExpr(SqlNode expr, SelectScope scope, SqlSelect select) { // Disable expansion. It doesn't help us come up with better hints. return expr; } - public SqlNode expandOrderExpr(SqlSelect select, SqlNode orderExpr) { + @Override public SqlNode expandOrderExpr(SqlSelect select, SqlNode orderExpr) { // Disable expansion. It doesn't help us come up with better hints. return orderExpr; } @@ -114,7 +114,7 @@ public SqlNode expandOrderExpr(SqlSelect select, SqlNode orderExpr) { /** * Calls the parent class method and mask Farrago exception thrown. */ - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidatorScope scope, SqlNode operand) { // REVIEW Do not mask Error (indicates a serious system problem) or @@ -134,7 +134,7 @@ public RelDataType deriveType( // we do not need to validate from clause for traversing the parse tree // because there is no SqlIdentifier in from clause that need to be // registered into {@link #idPositions} map - protected void validateFrom( + @Override protected void validateFrom( SqlNode node, RelDataType targetRowType, SqlValidatorScope scope) { @@ -148,7 +148,7 @@ protected void validateFrom( /** * Calls the parent class method and masks Farrago exception thrown. */ - protected void validateWhereClause(SqlSelect select) { + @Override protected void validateWhereClause(SqlSelect select) { try { super.validateWhereClause(select); } catch (CalciteException e) { @@ -159,7 +159,7 @@ protected void validateWhereClause(SqlSelect select) { /** * Calls the parent class method and masks Farrago exception thrown. */ - protected void validateHavingClause(SqlSelect select) { + @Override protected void validateHavingClause(SqlSelect select) { try { super.validateHavingClause(select); } catch (CalciteException e) { @@ -167,7 +167,7 @@ protected void validateHavingClause(SqlSelect select) { } } - protected void validateOver(SqlCall call, SqlValidatorScope scope) { + @Override protected void validateOver(SqlCall call, SqlValidatorScope scope) { try { final OverScope overScope = (OverScope) getOverScope(call); final SqlNode relation = call.operand(0); @@ -183,7 +183,7 @@ protected void validateOver(SqlCall call, SqlValidatorScope scope) { } } - protected void validateNamespace(final SqlValidatorNamespace namespace, + @Override protected void validateNamespace(final SqlValidatorNamespace namespace, RelDataType targetRowType) { // Only attempt to validate each namespace once. Otherwise if // validation fails, we may end up cycling. @@ -199,7 +199,7 @@ protected void validateNamespace(final SqlValidatorNamespace namespace, return true; } - protected boolean shouldAllowOverRelation() { + @Override protected boolean shouldAllowOverRelation() { return true; // no reason not to be lenient } } diff --git a/core/src/main/java/org/apache/calcite/sql/advise/SqlSimpleParser.java b/core/src/main/java/org/apache/calcite/sql/advise/SqlSimpleParser.java index 7e98225f64d..f1d64f14679 100644 --- a/core/src/main/java/org/apache/calcite/sql/advise/SqlSimpleParser.java +++ b/core/src/main/java/org/apache/calcite/sql/advise/SqlSimpleParser.java @@ -43,14 +43,14 @@ enum TokenType { /** Left parenthesis. */ LPAREN { - public String sql() { + @Override public String sql() { return "("; } }, /** Right parenthesis. */ RPAREN { - public String sql() { + @Override public String sql() { return ")"; } }, @@ -68,7 +68,7 @@ public String sql() { */ SQID, COMMENT, COMMA { - public String sql() { + @Override public String sql() { return ","; } }, @@ -454,7 +454,7 @@ public static class Token { this.s = s; } - public String toString() { + @Override public String toString() { return (s == null) ? type.toString() : (type + "(" + s + ")"); } @@ -484,7 +484,7 @@ static class Query extends Token { this.tokenList = new ArrayList<>(tokenList); } - public void unparse(StringBuilder buf) { + @Override public void unparse(StringBuilder buf) { int k = -1; for (Token token : tokenList) { if (++k > 0) { diff --git a/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateForeignSchema.java b/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateForeignSchema.java index 9c6b667990b..a2c25586813 100644 --- a/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateForeignSchema.java +++ b/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateForeignSchema.java @@ -106,12 +106,12 @@ public List> options() { private static List> options( final SqlNodeList optionList) { return new AbstractList>() { - public Pair get(int index) { + @Override public Pair get(int index) { return Pair.of((SqlIdentifier) optionList.get(index * 2), optionList.get(index * 2 + 1)); } - public int size() { + @Override public int size() { return optionList.size() / 2; } }; diff --git a/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateMaterializedView.java b/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateMaterializedView.java index 26fd93327ea..dbd93c1592e 100644 --- a/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateMaterializedView.java +++ b/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateMaterializedView.java @@ -52,7 +52,7 @@ public class SqlCreateMaterializedView extends SqlCreate { this.query = Objects.requireNonNull(query); } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableNullableList.of(name, columnList, query); } diff --git a/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateTable.java b/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateTable.java index 6e033180b6d..8f97b954ec4 100644 --- a/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateTable.java +++ b/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateTable.java @@ -50,7 +50,7 @@ protected SqlCreateTable(SqlParserPos pos, boolean replace, boolean ifNotExists, this.query = query; // for "CREATE TABLE ... AS query"; may be null } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableNullableList.of(name, columnList, query); } diff --git a/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateView.java b/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateView.java index ab05ecf4919..7751f2b523b 100644 --- a/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateView.java +++ b/core/src/main/java/org/apache/calcite/sql/ddl/SqlCreateView.java @@ -50,7 +50,7 @@ public class SqlCreateView extends SqlCreate { this.query = Objects.requireNonNull(query); } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableNullableList.of(name, columnList, query); } diff --git a/core/src/main/java/org/apache/calcite/sql/ddl/SqlDropObject.java b/core/src/main/java/org/apache/calcite/sql/ddl/SqlDropObject.java index 8ca55853906..ccc4a2fa166 100644 --- a/core/src/main/java/org/apache/calcite/sql/ddl/SqlDropObject.java +++ b/core/src/main/java/org/apache/calcite/sql/ddl/SqlDropObject.java @@ -43,7 +43,7 @@ public abstract class SqlDropObject extends SqlDrop { this.name = name; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableList.of(name); } diff --git a/core/src/main/java/org/apache/calcite/sql/ddl/SqlDropSchema.java b/core/src/main/java/org/apache/calcite/sql/ddl/SqlDropSchema.java index 73c9493f0f6..b06022977b6 100644 --- a/core/src/main/java/org/apache/calcite/sql/ddl/SqlDropSchema.java +++ b/core/src/main/java/org/apache/calcite/sql/ddl/SqlDropSchema.java @@ -48,7 +48,7 @@ public class SqlDropSchema extends SqlDrop { this.name = name; } - public List getOperandList() { + @Override public List getOperandList() { return ImmutableList.of( SqlLiteral.createBoolean(foreign, SqlParserPos.ZERO), name); } diff --git a/core/src/main/java/org/apache/calcite/sql/dialect/JethroDataSqlDialect.java b/core/src/main/java/org/apache/calcite/sql/dialect/JethroDataSqlDialect.java index abd2c79bfae..8a6a9c7f8db 100644 --- a/core/src/main/java/org/apache/calcite/sql/dialect/JethroDataSqlDialect.java +++ b/core/src/main/java/org/apache/calcite/sql/dialect/JethroDataSqlDialect.java @@ -175,7 +175,7 @@ public interface JethroInfoCache { private static class JethroInfoCacheImpl implements JethroInfoCache { final Map map = new HashMap<>(); - public JethroInfo get(final DatabaseMetaData metaData) { + @Override public JethroInfo get(final DatabaseMetaData metaData) { try { assert "JethroData".equals(metaData.getDatabaseProductName()); String productVersion = metaData.getDatabaseProductVersion(); diff --git a/core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java b/core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java index 19ad82091df..469588d7294 100644 --- a/core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java +++ b/core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java @@ -101,7 +101,7 @@ public MysqlSqlDialect(Context context) { return true; } - public boolean supportsAliasedValues() { + @Override public boolean supportsAliasedValues() { // MySQL supports VALUES only in INSERT; not in a FROM clause return false; } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlAbstractTimeFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlAbstractTimeFunction.java index 1ee37ab77c9..1c9caff0610 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlAbstractTimeFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlAbstractTimeFunction.java @@ -54,11 +54,11 @@ protected SqlAbstractTimeFunction(String name, SqlTypeName typeName) { //~ Methods ---------------------------------------------------------------- - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.FUNCTION_ID; } - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( SqlOperatorBinding opBinding) { // REVIEW jvs 20-Feb-2005: Need to take care of time zones. int precision = 0; @@ -84,7 +84,7 @@ public RelDataType inferReturnType( } // Plans referencing context variables should never be cached - public boolean isDynamicFunction() { + @Override public boolean isDynamicFunction() { return true; } } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlBaseContextVariable.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlBaseContextVariable.java index 5aa9c6837b1..8c0d9cf8abf 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlBaseContextVariable.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlBaseContextVariable.java @@ -40,7 +40,7 @@ protected SqlBaseContextVariable(String name, //~ Methods ---------------------------------------------------------------- - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.FUNCTION_ID; } @@ -50,7 +50,7 @@ public SqlSyntax getSyntax() { } // Plans referencing context variables should never be cached - public boolean isDynamicFunction() { + @Override public boolean isDynamicFunction() { return true; } } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlBetweenOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlBetweenOperator.java index 2da2a54d892..54b60cf08eb 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlBetweenOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlBetweenOperator.java @@ -119,7 +119,7 @@ public boolean isNegated() { return negated; } - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( SqlOperatorBinding opBinding) { ExplicitOperatorBinding newOpBinding = new ExplicitOperatorBinding( @@ -129,7 +129,7 @@ public RelDataType inferReturnType( newOpBinding); } - public String getSignatureTemplate(final int operandsCount) { + @Override public String getSignatureTemplate(final int operandsCount) { Util.discard(operandsCount); return "{1} {0} {2} AND {3}"; } @@ -140,7 +140,7 @@ public String getSignatureTemplate(final int operandsCount) { + flag.name(); } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -172,7 +172,7 @@ public void unparse( writer.endList(frame); } - public ReduceResult reduceExpr(int opOrdinal, TokenSequence list) { + @Override public ReduceResult reduceExpr(int opOrdinal, TokenSequence list) { SqlOperator op = list.op(opOrdinal); assert op == this; @@ -233,7 +233,7 @@ public ReduceResult reduceExpr(int opOrdinal, TokenSequence list) { * Finds an AND operator in an expression. */ private static class AndFinder extends SqlBasicVisitor { - public Void visit(SqlCall call) { + @Override public Void visit(SqlCall call) { final SqlOperator operator = call.getOperator(); if (operator == SqlStdOperatorTable.AND) { throw Util.FoundOne.NULL; diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlCase.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlCase.java index b2d737afa1a..2c7f5b2748c 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlCase.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlCase.java @@ -97,11 +97,11 @@ public static SqlCase createSwitched(SqlParserPos pos, SqlNode value, return SqlKind.CASE; } - public SqlOperator getOperator() { + @Override public SqlOperator getOperator() { return SqlStdOperatorTable.CASE; } - public List getOperandList() { + @Override public List getOperandList() { return UnmodifiableArrayList.of(value, whenList, thenList, elseExpr); } 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 73868aafc2a..bdbfb06aec2 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 @@ -139,7 +139,7 @@ private SqlCaseOperator() { //~ Methods ---------------------------------------------------------------- - public void validateCall( + @Override public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, @@ -159,7 +159,7 @@ public void validateCall( } } - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { @@ -168,7 +168,7 @@ public RelDataType deriveType( return validateOperands(validator, scope, call); } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { SqlCase caseCall = (SqlCase) callBinding.getCall(); @@ -212,7 +212,7 @@ public boolean checkOperandTypes( return true; } - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( SqlOperatorBinding opBinding) { // REVIEW jvs 4-June-2005: can't these be unified? if (!(opBinding instanceof SqlCallBinding)) { @@ -314,15 +314,15 @@ private RelDataType inferTypeFromOperands(SqlOperatorBinding opBinding) { return typeFactory.leastRestrictive(thenTypes); } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.any(); } - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.SPECIAL; } - public SqlCall createCall( + @Override public SqlCall createCall( SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands) { diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlCastFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlCastFunction.java index 28d856e3e4d..5d6e49eee70 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlCastFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlCastFunction.java @@ -94,7 +94,7 @@ public SqlCastFunction() { //~ Methods ---------------------------------------------------------------- - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( SqlOperatorBinding opBinding) { assert opBinding.getOperandCount() == 2; RelDataType ret = opBinding.getOperandType(1); @@ -120,12 +120,12 @@ public RelDataType inferReturnType( return ret; } - public String getSignatureTemplate(final int operandsCount) { + @Override public String getSignatureTemplate(final int operandsCount) { assert operandsCount == 2; return "{0}({1} AS {2})"; } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.of(2); } @@ -134,7 +134,7 @@ public SqlOperandCountRange getOperandCountRange() { * Operators (such as "ROW" and "AS") which do not check their arguments can * override this method. */ - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { final SqlNode left = callBinding.operand(0); @@ -169,11 +169,11 @@ public boolean checkOperandTypes( return true; } - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.SPECIAL; } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlCoalesceFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlCoalesceFunction.java index 79f058e1b87..1dcfe477f9e 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlCoalesceFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlCoalesceFunction.java @@ -54,7 +54,7 @@ public SqlCoalesceFunction() { //~ Methods ---------------------------------------------------------------- // override SqlOperator - public SqlNode rewriteCall(SqlValidator validator, SqlCall call) { + @Override public SqlNode rewriteCall(SqlValidator validator, SqlCall call) { validateQuantifier(validator, call); // check DISTINCT/ALL List operands = call.getOperandList(); diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlColumnListConstructor.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlColumnListConstructor.java index 55028e4e2a4..14c0321eb60 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlColumnListConstructor.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlColumnListConstructor.java @@ -43,7 +43,7 @@ public SqlColumnListConstructor() { //~ Methods ---------------------------------------------------------------- - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlConvertFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlConvertFunction.java index eb4ff4a6a8c..2d10cc1d978 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlConvertFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlConvertFunction.java @@ -41,7 +41,7 @@ protected SqlConvertFunction(String name) { //~ Methods ---------------------------------------------------------------- - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -53,7 +53,7 @@ public void unparse( writer.endFunCall(frame); } - public String getSignatureTemplate(final int operandsCount) { + @Override public String getSignatureTemplate(final int operandsCount) { switch (operandsCount) { case 2: return "{0}({1} USING {2})"; diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlCountAggFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlCountAggFunction.java index cd3c8a68d58..4a7c8d32658 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlCountAggFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlCountAggFunction.java @@ -65,18 +65,18 @@ public SqlCountAggFunction(String name, } @SuppressWarnings("deprecation") - public List getParameterTypes(RelDataTypeFactory typeFactory) { + @Override public List getParameterTypes(RelDataTypeFactory typeFactory) { return ImmutableList.of( typeFactory.createTypeWithNullability( typeFactory.createSqlType(SqlTypeName.ANY), true)); } @SuppressWarnings("deprecation") - public RelDataType getReturnType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getReturnType(RelDataTypeFactory typeFactory) { return typeFactory.createSqlType(SqlTypeName.BIGINT); } - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlCurrentDateFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlCurrentDateFunction.java index 6df32ac6d27..623377b821f 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlCurrentDateFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlCurrentDateFunction.java @@ -43,7 +43,7 @@ public SqlCurrentDateFunction() { //~ Methods ---------------------------------------------------------------- - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.FUNCTION_ID; } @@ -52,7 +52,7 @@ public SqlSyntax getSyntax() { } // Plans referencing context variables should never be cached - public boolean isDynamicFunction() { + @Override public boolean isDynamicFunction() { return true; } } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlCursorConstructor.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlCursorConstructor.java index c906a75e0ef..7d23c4123ea 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlCursorConstructor.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlCursorConstructor.java @@ -46,7 +46,7 @@ public SqlCursorConstructor() { //~ Methods ---------------------------------------------------------------- - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { @@ -56,7 +56,7 @@ public RelDataType deriveType( return super.deriveType(validator, scope, call); } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -68,7 +68,7 @@ public void unparse( writer.endList(frame); } - public boolean argumentMustBeScalar(int ordinal) { + @Override public boolean argumentMustBeScalar(int ordinal) { return false; } } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlDatePartFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlDatePartFunction.java index f43ee05fa1a..31fbc284e0e 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlDatePartFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlDatePartFunction.java @@ -62,16 +62,16 @@ public SqlDatePartFunction(String name, TimeUnit timeUnit) { operands.get(0)); } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.of(1); } - public String getSignatureTemplate(int operandsCount) { + @Override public String getSignatureTemplate(int operandsCount) { assert 1 == operandsCount; return "{0}({1})"; } - public boolean checkOperandTypes(SqlCallBinding callBinding, + @Override public boolean checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure) { // Use #checkOperandTypes instead of #checkSingleOperandType to enable implicit // type coercion. REVIEW Danny 2019-09-10, because we declare that the operand diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlDatetimePlusOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlDatetimePlusOperator.java index 0827c59ed57..dd83c265518 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlDatetimePlusOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlDatetimePlusOperator.java @@ -53,7 +53,7 @@ public class SqlDatetimePlusOperator extends SqlSpecialOperator { unitType, leftType); } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlDatetimeSubtractionOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlDatetimeSubtractionOperator.java index c08a0786fc7..e63303e02d8 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlDatetimeSubtractionOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlDatetimeSubtractionOperator.java @@ -53,7 +53,7 @@ public SqlDatetimeSubtractionOperator() { //~ Methods ---------------------------------------------------------------- - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlDotOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlDotOperator.java index 874707c4632..72e164d76de 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlDotOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlDotOperator.java @@ -123,7 +123,7 @@ public class SqlDotOperator extends SqlSpecialOperator { return type; } - public void validateCall( + @Override public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlExtractFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlExtractFunction.java index 375f30e6683..a580f5d0e4c 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlExtractFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlExtractFunction.java @@ -47,12 +47,12 @@ public SqlExtractFunction() { //~ Methods ---------------------------------------------------------------- - public String getSignatureTemplate(int operandsCount) { + @Override public String getSignatureTemplate(int operandsCount) { Util.discard(operandsCount); return "{0}({1} FROM {2})"; } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlFirstLastValueAggFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlFirstLastValueAggFunction.java index 17828446fd7..100639ca4a4 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlFirstLastValueAggFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlFirstLastValueAggFunction.java @@ -63,14 +63,14 @@ public SqlFirstLastValueAggFunction(boolean firstFlag) { //~ Methods ---------------------------------------------------------------- @SuppressWarnings("deprecation") - public List getParameterTypes(RelDataTypeFactory typeFactory) { + @Override public List getParameterTypes(RelDataTypeFactory typeFactory) { return ImmutableList.of( typeFactory.createTypeWithNullability( typeFactory.createSqlType(SqlTypeName.ANY), true)); } @SuppressWarnings("deprecation") - public RelDataType getReturnType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getReturnType(RelDataTypeFactory typeFactory) { return typeFactory.createTypeWithNullability( typeFactory.createSqlType(SqlTypeName.ANY), true); } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlGeoFunctions.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlGeoFunctions.java index 7638d426424..dcd4baac58b 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlGeoFunctions.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlGeoFunctions.java @@ -101,7 +101,7 @@ public static class GridTable implements ScannableTable { .build(); } - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { if (geom != null && deltaX != null && deltaY != null) { final Geometry geometry = geom.g(); final Envelope envelope = new Envelope(); @@ -115,19 +115,19 @@ public Enumerable scan(DataContext root) { return Linq4j.emptyEnumerable(); } - public Statistic getStatistic() { + @Override public Statistic getStatistic() { return Statistics.of(100d, ImmutableList.of(ImmutableBitSet.of(0, 1))); } - public Schema.TableType getJdbcTableType() { + @Override public Schema.TableType getJdbcTableType() { return Schema.TableType.OTHER; } - public boolean isRolledUp(String column) { + @Override public boolean isRolledUp(String column) { return false; } - public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, + @Override public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, SqlNode parent, CalciteConnectionConfig config) { return false; } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlHistogramAggFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlHistogramAggFunction.java index 6e200dcfa8a..e13ef20e390 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlHistogramAggFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlHistogramAggFunction.java @@ -62,7 +62,7 @@ public SqlHistogramAggFunction(RelDataType type) { //~ Methods ---------------------------------------------------------------- @SuppressWarnings("deprecation") - public List getParameterTypes(RelDataTypeFactory typeFactory) { + @Override public List getParameterTypes(RelDataTypeFactory typeFactory) { return ImmutableList.of(type); } @@ -72,7 +72,7 @@ public RelDataType getType() { } @SuppressWarnings("deprecation") - public RelDataType getReturnType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getReturnType(RelDataTypeFactory typeFactory) { return type; } } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlInOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlInOperator.java index 3851a14e539..d4d28190520 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlInOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlInOperator.java @@ -87,7 +87,7 @@ public boolean isNotIn() { return litmus.succeed(); } - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { @@ -185,7 +185,7 @@ private static boolean anyNullable(List fieldList) { return false; } - public boolean argumentMustBeScalar(int ordinal) { + @Override public boolean argumentMustBeScalar(int ordinal) { // Argument #0 must be scalar, argument #1 can be a list (1, 2) or // a query (select deptno from emp). So, only coerce argument #0 into // a scalar sub-query. For example, in diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlLikeOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlLikeOperator.java index 0e934c98642..89e889b1af8 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlLikeOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlLikeOperator.java @@ -92,11 +92,11 @@ public boolean isNegated() { return negated; } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.between(2, 3); } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { switch (callBinding.getOperandCount()) { @@ -128,7 +128,7 @@ public boolean checkOperandTypes( throwOnFailure); } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -145,7 +145,7 @@ public void unparse( writer.endList(frame); } - public ReduceResult reduceExpr( + @Override public ReduceResult reduceExpr( final int opOrdinal, TokenSequence list) { // Example: diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlLiteralChainOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlLiteralChainOperator.java index 8b2d96daf18..6cd82396278 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlLiteralChainOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlLiteralChainOperator.java @@ -93,7 +93,7 @@ private boolean argTypesValid(SqlCallBinding callBinding) { return true; } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { if (!argTypesValid(callBinding)) { @@ -109,7 +109,7 @@ public boolean checkOperandTypes( // total size. // REVIEW mb 8/8/04: Possibly this can be achieved by combining // the strategy useFirstArgType with a new transformer. - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( SqlOperatorBinding opBinding) { // Here we know all the operands have the same type, // which has a size (precision), but not a scale. @@ -126,11 +126,11 @@ public RelDataType inferReturnType( return opBinding.getTypeFactory().createSqlType(typeName, size); } - public String getAllowedSignatures(String opName) { + @Override public String getAllowedSignatures(String opName) { return opName + "(...)"; } - public void validateCall( + @Override public void validateCall( SqlCall call, SqlValidator validator, SqlValidatorScope scope, @@ -148,7 +148,7 @@ public void validateCall( } } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, 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 7fe4db7900e..61300d1b910 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 @@ -54,7 +54,7 @@ public SqlMapValueConstructor() { false); } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { final List argTypes = SqlTypeUtil.deriveType(callBinding, callBinding.operands()); diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlMinMaxAggFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlMinMaxAggFunction.java index f6c3b2236d4..4fd9764a38c 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlMinMaxAggFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlMinMaxAggFunction.java @@ -118,7 +118,7 @@ public int getMinMaxKind() { } @SuppressWarnings("deprecation") - public List getParameterTypes(RelDataTypeFactory typeFactory) { + @Override public List getParameterTypes(RelDataTypeFactory typeFactory) { switch (minMaxKind) { case MINMAX_PRIMITIVE: case MINMAX_COMPARABLE: @@ -131,7 +131,7 @@ public List getParameterTypes(RelDataTypeFactory typeFactory) { } @SuppressWarnings("deprecation") - public RelDataType getReturnType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getReturnType(RelDataTypeFactory typeFactory) { switch (minMaxKind) { case MINMAX_PRIMITIVE: case MINMAX_COMPARABLE: diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetMemberOfOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetMemberOfOperator.java index ebff588c652..1d51fb74719 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetMemberOfOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetMemberOfOperator.java @@ -51,7 +51,7 @@ public SqlMultisetMemberOfOperator() { //~ Methods ---------------------------------------------------------------- - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { if (!OperandTypes.MULTISET.checkSingleOperandType( @@ -77,7 +77,7 @@ public boolean checkOperandTypes( return true; } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.of(2); } } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetQueryConstructor.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetQueryConstructor.java index 72a76df26ec..2eaec975a9b 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetQueryConstructor.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlMultisetQueryConstructor.java @@ -61,7 +61,7 @@ protected SqlMultisetQueryConstructor(String name, SqlKind kind) { //~ Methods ---------------------------------------------------------------- - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( SqlOperatorBinding opBinding) { RelDataType type = getComponentType( @@ -82,7 +82,7 @@ private RelDataType getComponentType( return typeFactory.leastRestrictive(argTypes); } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { final List argTypes = SqlTypeUtil.deriveType(callBinding, callBinding.operands()); @@ -99,7 +99,7 @@ public boolean checkOperandTypes( return true; } - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidator validator, SqlValidatorScope scope, SqlCall call) { @@ -113,7 +113,7 @@ public RelDataType deriveType( false); } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -125,7 +125,7 @@ public void unparse( writer.endList(frame); } - public boolean argumentMustBeScalar(int ordinal) { + @Override public boolean argumentMustBeScalar(int ordinal) { return false; } } 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 b4604b98c8a..d91f54e13f5 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 @@ -61,7 +61,7 @@ protected SqlMultisetValueConstructor(String name, SqlKind kind) { //~ Methods ---------------------------------------------------------------- - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( SqlOperatorBinding opBinding) { RelDataType type = getComponentType( @@ -82,7 +82,7 @@ protected RelDataType getComponentType( return typeFactory.leastRestrictive(argTypes); } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { final List argTypes = @@ -103,7 +103,7 @@ public boolean checkOperandTypes( return true; } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlNewOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlNewOperator.java index 3370dd71851..f5e73849351 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlNewOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlNewOperator.java @@ -39,14 +39,14 @@ public SqlNewOperator() { //~ Methods ---------------------------------------------------------------- // override SqlOperator - public SqlNode rewriteCall(SqlValidator validator, SqlCall call) { + @Override public SqlNode rewriteCall(SqlValidator validator, SqlCall call) { // New specification is purely syntactic, so we rewrite it as a // direct call to the constructor method. return call.operand(0); } // override SqlOperator - public boolean requiresDecimalExpansion() { + @Override public boolean requiresDecimalExpansion() { return false; } } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlNullifFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlNullifFunction.java index ec7380a2da9..b34e7d15866 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlNullifFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlNullifFunction.java @@ -53,7 +53,7 @@ public SqlNullifFunction() { //~ Methods ---------------------------------------------------------------- // override SqlOperator - public SqlNode rewriteCall(SqlValidator validator, SqlCall call) { + @Override public SqlNode rewriteCall(SqlValidator validator, SqlCall call) { List operands = call.getOperandList(); SqlParserPos pos = call.getParserPosition(); diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlOverlapsOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlOverlapsOperator.java index e45d2c2be7d..355f5c2ad5c 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlOverlapsOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlOverlapsOperator.java @@ -73,11 +73,11 @@ void arg(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec, int i) { } } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.of(2); } - public String getAllowedSignatures(String opName) { + @Override public String getAllowedSignatures(String opName) { final String d = "DATETIME"; final String i = "INTERVAL"; String[] typeNames = { @@ -99,7 +99,7 @@ public String getAllowedSignatures(String opName) { return ret.toString(); } - public boolean checkOperandTypes(SqlCallBinding callBinding, + @Override public boolean checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure) { if (!OperandTypes.PERIOD.checkSingleOperandType(callBinding, callBinding.operand(0), 0, throwOnFailure)) { diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlOverlayFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlOverlayFunction.java index 05d77c87c6e..9d991c196c1 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlOverlayFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlOverlayFunction.java @@ -50,7 +50,7 @@ public SqlOverlayFunction() { //~ Methods ---------------------------------------------------------------- - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -68,7 +68,7 @@ public void unparse( writer.endFunCall(frame); } - public String getSignatureTemplate(final int operandsCount) { + @Override public String getSignatureTemplate(final int operandsCount) { switch (operandsCount) { case 3: return "{0}({1} PLACING {2} FROM {3})"; diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlPositionFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlPositionFunction.java index a133bffd714..349715a1767 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlPositionFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlPositionFunction.java @@ -52,7 +52,7 @@ public SqlPositionFunction() { //~ Methods ---------------------------------------------------------------- - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -68,7 +68,7 @@ public void unparse( writer.endFunCall(frame); } - public String getSignatureTemplate(final int operandsCount) { + @Override public String getSignatureTemplate(final int operandsCount) { switch (operandsCount) { case 2: return "{0}({1} IN {2})"; @@ -79,7 +79,7 @@ public String getSignatureTemplate(final int operandsCount) { } } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { // check that the two operands are of same type. diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlPosixRegexOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlPosixRegexOperator.java index 232f94f0107..2e45a1c153a 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlPosixRegexOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlPosixRegexOperator.java @@ -74,11 +74,11 @@ public class SqlPosixRegexOperator extends SqlBinaryOperator { // ~ Methods ---------------------------------------------------------------- - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.between(2, 3); } - public SqlCall createCall( + @Override public SqlCall createCall( SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands) { @@ -88,7 +88,7 @@ public SqlCall createCall( return new SqlBasicCall(this, operands, pos, false, functionQualifier); } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { int operandCount = callBinding.getOperandCount(); @@ -111,7 +111,7 @@ public boolean checkOperandTypes( throwOnFailure); } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlRandFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlRandFunction.java index fe96d19845d..e8319e31a53 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlRandFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlRandFunction.java @@ -46,12 +46,12 @@ public SqlRandFunction() { //~ Methods ---------------------------------------------------------------- - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.FUNCTION; } // Plans referencing context variables should never be cached - public boolean isDynamicFunction() { + @Override public boolean isDynamicFunction() { return true; } } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlRandIntegerFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlRandIntegerFunction.java index 384fb463f6f..1b27a17999e 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlRandIntegerFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlRandIntegerFunction.java @@ -46,12 +46,12 @@ public SqlRandIntegerFunction() { //~ Methods ---------------------------------------------------------------- - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.FUNCTION; } // Plans referencing context variables should never be cached - public boolean isDynamicFunction() { + @Override public boolean isDynamicFunction() { return true; } } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlRowOperator.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlRowOperator.java index d48b03c1d4d..e83728c48f0 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlRowOperator.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlRowOperator.java @@ -51,26 +51,26 @@ public SqlRowOperator(String name) { //~ Methods ---------------------------------------------------------------- - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( final SqlOperatorBinding opBinding) { // The type of a ROW(e1,e2) expression is a record with the types // {e1type,e2type}. According to the standard, field names are // implementation-defined. return opBinding.getTypeFactory().createStructType( new AbstractList>() { - public Map.Entry get(int index) { + @Override public Map.Entry get(int index) { return Pair.of( SqlUtil.deriveAliasFromOrdinal(index), opBinding.getOperandType(index)); } - public int size() { + @Override public int size() { return opBinding.getOperandCount(); } }); } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -79,7 +79,7 @@ public void unparse( } // override SqlOperator - public boolean requiresDecimalExpansion() { + @Override public boolean requiresDecimalExpansion() { return false; } } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlSingleValueAggFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlSingleValueAggFunction.java index 85218260706..e234bd4841c 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlSingleValueAggFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlSingleValueAggFunction.java @@ -64,12 +64,12 @@ public SqlSingleValueAggFunction( } @SuppressWarnings("deprecation") - public List getParameterTypes(RelDataTypeFactory typeFactory) { + @Override public List getParameterTypes(RelDataTypeFactory typeFactory) { return ImmutableList.of(type); } @SuppressWarnings("deprecation") - public RelDataType getReturnType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getReturnType(RelDataTypeFactory typeFactory) { return type; } 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 c178607b78b..96fa7bfaa86 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 @@ -839,7 +839,7 @@ public class SqlStdOperatorTable extends ReflectiveSqlOperatorTable { ReturnTypes.BOOLEAN, null, OperandTypes.ANY) { - public boolean argumentMustBeScalar(int ordinal) { + @Override public boolean argumentMustBeScalar(int ordinal) { return false; } @@ -1454,7 +1454,7 @@ public boolean argumentMustBeScalar(int ordinal) { */ public static final SqlSpecialOperator REINTERPRET = new SqlSpecialOperator("Reinterpret", SqlKind.REINTERPRET) { - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.between(1, 2); } }; @@ -1764,7 +1764,7 @@ public SqlOperandCountRange getOperandCountRange() { null, OperandTypes.NILADIC, SqlFunctionCategory.NUMERIC) { - public SqlSyntax getSyntax() { + @Override public SqlSyntax getSyntax() { return SqlSyntax.FUNCTION_ID; } }; @@ -2133,7 +2133,7 @@ public SqlSyntax getSyntax() { ReturnTypes.MULTISET_RECORD, null, OperandTypes.MULTISET) { - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -2158,7 +2158,7 @@ public void unparse( ReturnTypes.RECORD_TO_SCALAR, null, OperandTypes.RECORD_TO_SCALAR) { - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -2168,7 +2168,7 @@ public void unparse( writer.endList(frame); } - public boolean argumentMustBeScalar(int ordinal) { + @Override public boolean argumentMustBeScalar(int ordinal) { // Obvious, really. return false; } @@ -2289,7 +2289,7 @@ public boolean argumentMustBeScalar(int ordinal) { ReturnTypes.ARG0, null, OperandTypes.VARIADIC) { - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlSubstringFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlSubstringFunction.java index 952c3e9af7f..9d3db136180 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlSubstringFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlSubstringFunction.java @@ -63,7 +63,7 @@ public class SqlSubstringFunction extends SqlFunction { //~ Methods ---------------------------------------------------------------- - public String getSignatureTemplate(final int operandsCount) { + @Override public String getSignatureTemplate(final int operandsCount) { switch (operandsCount) { case 2: return "{0}({1} FROM {2})"; @@ -74,7 +74,7 @@ public String getSignatureTemplate(final int operandsCount) { } } - public String getAllowedSignatures(String opName) { + @Override public String getAllowedSignatures(String opName) { StringBuilder ret = new StringBuilder(); for (Ord typeName : Ord.zip(SqlTypeName.STRING_TYPES)) { if (typeName.i > 0) { @@ -92,7 +92,7 @@ public String getAllowedSignatures(String opName) { return ret.toString(); } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { List operands = callBinding.operands(); @@ -134,11 +134,11 @@ public boolean checkOperandTypes( return true; } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.between(2, 3); } - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlSumAggFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlSumAggFunction.java index b6a9df67337..e02f4ac4aa3 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlSumAggFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlSumAggFunction.java @@ -63,7 +63,7 @@ public SqlSumAggFunction(RelDataType type) { //~ Methods ---------------------------------------------------------------- @SuppressWarnings("deprecation") - public List getParameterTypes(RelDataTypeFactory typeFactory) { + @Override public List getParameterTypes(RelDataTypeFactory typeFactory) { return ImmutableList.of(type); } @@ -73,7 +73,7 @@ public RelDataType getType() { } @SuppressWarnings("deprecation") - public RelDataType getReturnType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getReturnType(RelDataTypeFactory typeFactory) { return type; } diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlSumEmptyIsZeroAggFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlSumEmptyIsZeroAggFunction.java index 206303bc820..277e22a5048 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlSumEmptyIsZeroAggFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlSumEmptyIsZeroAggFunction.java @@ -56,14 +56,14 @@ public SqlSumEmptyIsZeroAggFunction() { //~ Methods ---------------------------------------------------------------- @SuppressWarnings("deprecation") - public List getParameterTypes(RelDataTypeFactory typeFactory) { + @Override public List getParameterTypes(RelDataTypeFactory typeFactory) { return ImmutableList.of( typeFactory.createTypeWithNullability( typeFactory.createSqlType(SqlTypeName.ANY), true)); } @SuppressWarnings("deprecation") - public RelDataType getReturnType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getReturnType(RelDataTypeFactory typeFactory) { return typeFactory.createTypeWithNullability( typeFactory.createSqlType(SqlTypeName.ANY), true); } 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 fac830bd2aa..61c90b0b838 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 @@ -53,7 +53,7 @@ public SqlThrowOperator() { //~ Methods ---------------------------------------------------------------- - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/sql/fun/SqlTrimFunction.java b/core/src/main/java/org/apache/calcite/sql/fun/SqlTrimFunction.java index aff3235e09e..0594dfe92df 100644 --- a/core/src/main/java/org/apache/calcite/sql/fun/SqlTrimFunction.java +++ b/core/src/main/java/org/apache/calcite/sql/fun/SqlTrimFunction.java @@ -95,7 +95,7 @@ public SqlTrimFunction(String name, SqlKind kind, //~ Methods ---------------------------------------------------------------- - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, @@ -109,7 +109,7 @@ public void unparse( writer.endFunCall(frame); } - public String getSignatureTemplate(final int operandsCount) { + @Override public String getSignatureTemplate(final int operandsCount) { switch (operandsCount) { case 3: return "{0}([BOTH|LEADING|TRAILING] {1} FROM {2})"; @@ -118,7 +118,7 @@ public String getSignatureTemplate(final int operandsCount) { } } - public SqlCall createCall( + @Override public SqlCall createCall( SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands) { @@ -147,7 +147,7 @@ public SqlCall createCall( return super.createCall(functionQualifier, pos, operands); } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { if (!super.checkOperandTypes(callBinding, throwOnFailure)) { diff --git a/core/src/main/java/org/apache/calcite/sql/parser/SqlAbstractParserImpl.java b/core/src/main/java/org/apache/calcite/sql/parser/SqlAbstractParserImpl.java index 4350bdd6e9b..aa8c65d5a01 100644 --- a/core/src/main/java/org/apache/calcite/sql/parser/SqlAbstractParserImpl.java +++ b/core/src/main/java/org/apache/calcite/sql/parser/SqlAbstractParserImpl.java @@ -745,18 +745,22 @@ private String constructSql92ReservedWordList() { return sb.toString(); } + @Override public List getTokens() { return tokenList; } + @Override public boolean isSql92ReservedWord(String token) { return SQL_92_RESERVED_WORD_SET.contains(token); } + @Override public String getJdbcKeywords() { return sql92ReservedWords; } + @Override public boolean isKeyword(String token) { return isNonReservedKeyword(token) || isReservedFunctionName(token) @@ -764,18 +768,22 @@ public boolean isKeyword(String token) { || isReservedWord(token); } + @Override public boolean isNonReservedKeyword(String token) { return nonReservedKeyWordSet.contains(token); } + @Override public boolean isReservedFunctionName(String token) { return reservedFunctionNames.contains(token); } + @Override public boolean isContextVariableName(String token) { return contextVariableNames.contains(token); } + @Override public boolean isReservedWord(String token) { return reservedWords.contains(token); } diff --git a/core/src/main/java/org/apache/calcite/sql/parser/SqlParseException.java b/core/src/main/java/org/apache/calcite/sql/parser/SqlParseException.java index cb5d562a6ad..bba8b93d5d5 100644 --- a/core/src/main/java/org/apache/calcite/sql/parser/SqlParseException.java +++ b/core/src/main/java/org/apache/calcite/sql/parser/SqlParseException.java @@ -154,7 +154,7 @@ public int[][] getExpectedTokenSequences() { } // override Exception - public Throwable getCause() { + @Override public Throwable getCause() { return parserException; } 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 e5e94eb8164..d2eacec767f 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 @@ -85,11 +85,11 @@ public SqlParserPos( //~ Methods ---------------------------------------------------------------- - public int hashCode() { + @Override public int hashCode() { return Objects.hash(lineNumber, columnNumber, endLineNumber, endColumnNumber); } - public boolean equals(Object o) { + @Override public boolean equals(Object o) { return o == this || o instanceof SqlParserPos && this.lineNumber == ((SqlParserPos) o).lineNumber @@ -185,10 +185,10 @@ public static SqlParserPos sum(final SqlNode[] nodes) { private static List toPos(final SqlNode[] nodes) { return new AbstractList() { - public SqlParserPos get(int index) { + @Override public SqlParserPos get(int index) { return nodes[index].getParserPosition(); } - public int size() { + @Override public int size() { return nodes.length; } }; @@ -230,10 +230,10 @@ private static SqlParserPos sum_(final List positions) { return positions.get(0); default: final List poses = new AbstractList() { - public SqlParserPos get(int index) { + @Override public SqlParserPos get(int index) { return positions.get(index + 1); } - public int size() { + @Override public int size() { return positions.size() - 1; } }; diff --git a/core/src/main/java/org/apache/calcite/sql/parser/SqlParserUtil.java b/core/src/main/java/org/apache/calcite/sql/parser/SqlParserUtil.java index 8208bc035b9..6d6393338ff 100644 --- a/core/src/main/java/org/apache/calcite/sql/parser/SqlParserUtil.java +++ b/core/src/main/java/org/apache/calcite/sql/parser/SqlParserUtil.java @@ -771,7 +771,7 @@ public ToTreeListItem( this.pos = pos; } - public String toString() { + @Override public String toString() { return op.toString(); } @@ -797,16 +797,16 @@ private TokenSequenceImpl(PrecedenceClimbingParser parser) { this.list = parser.all(); } - public PrecedenceClimbingParser parser(int start, + @Override public PrecedenceClimbingParser parser(int start, Predicate predicate) { return parser.copy(start, predicate); } - public int size() { + @Override public int size() { return list.size(); } - public SqlOperator op(int i) { + @Override public SqlOperator op(int i) { return ((ToTreeListItem) list.get(i).o).getOperator(); } @@ -827,19 +827,19 @@ private static SqlParserPos pos(PrecedenceClimbingParser.Token token) { } } - public SqlParserPos pos(int i) { + @Override public SqlParserPos pos(int i) { return pos(list.get(i)); } - public boolean isOp(int i) { + @Override public boolean isOp(int i) { return list.get(i).o instanceof ToTreeListItem; } - public SqlNode node(int i) { + @Override public SqlNode node(int i) { return convert(list.get(i)); } - public void replaceSublist(int start, int end, SqlNode e) { + @Override public void replaceSublist(int start, int end, SqlNode e) { SqlParserUtil.replaceSublist(list, start, end, parser.atom(e)); } } @@ -894,30 +894,30 @@ private OldTokenSequenceImpl(List list) { return builder.build(); } - public int size() { + @Override public int size() { return list.size(); } - public SqlOperator op(int i) { + @Override public SqlOperator op(int i) { return ((ToTreeListItem) list.get(i)).op; } - public SqlParserPos pos(int i) { + @Override public SqlParserPos pos(int i) { final Object o = list.get(i); return o instanceof ToTreeListItem ? ((ToTreeListItem) o).pos : ((SqlNode) o).getParserPosition(); } - public boolean isOp(int i) { + @Override public boolean isOp(int i) { return list.get(i) instanceof ToTreeListItem; } - public SqlNode node(int i) { + @Override public SqlNode node(int i) { return (SqlNode) list.get(i); } - public void replaceSublist(int start, int end, SqlNode e) { + @Override public void replaceSublist(int start, int end, SqlNode e) { SqlParserUtil.replaceSublist(list, start, end, e); } } 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 8d04713bb9b..5297d57ff8f 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 @@ -377,16 +377,16 @@ public void setWindowDeclListNewline(boolean windowDeclListNewline) { } @Deprecated - public int getIndentation() { + @Override public int getIndentation() { return config.indentation(); } @Deprecated - public boolean isAlwaysUseParentheses() { + @Override public boolean isAlwaysUseParentheses() { return config.alwaysUseParentheses(); } - public boolean inQuery() { + @Override public boolean inQuery() { return (frame == null) || (frame.frameType == FrameTypeEnum.ORDER_BY) || (frame.frameType == FrameTypeEnum.WITH) @@ -394,17 +394,17 @@ public boolean inQuery() { } @Deprecated - public boolean isQuoteAllIdentifiers() { + @Override public boolean isQuoteAllIdentifiers() { return config.quoteAllIdentifiers(); } @Deprecated - public boolean isClauseStartsLine() { + @Override public boolean isClauseStartsLine() { return config.clauseStartsLine(); } @Deprecated - public boolean isSelectListItemsOnSeparateLines() { + @Override public boolean isSelectListItemsOnSeparateLines() { return config.selectListItemsOnSeparateLines(); } @@ -419,7 +419,7 @@ public boolean isSelectListExtraIndentFlag() { } @Deprecated - public boolean isKeywordsLowerCase() { + @Override public boolean isKeywordsLowerCase() { return config.keywordsLowerCase(); } @@ -428,12 +428,12 @@ public int getLineLength() { return config.lineLength(); } - public void resetSettings() { + @Override public void resetSettings() { reset(); config = config(); } - public void reset() { + @Override public void reset() { buf.setLength(0); lineStart = 0; dynamicParameters = null; @@ -528,7 +528,7 @@ public void setAlwaysUseParentheses(boolean alwaysUseParentheses) { this.config = config.withAlwaysUseParentheses(alwaysUseParentheses); } - public void newlineAndIndent() { + @Override public void newlineAndIndent() { newlineAndIndent(currentIndent); } @@ -749,7 +749,7 @@ protected void _before() { return new FrameImpl(frameType, keyword, open, close, left, indentation, chopColumn, lineFolding, newlineAfterOpen, newlineBeforeSep, sepIndent, newlineAfterSep, false, false) { - protected void sep(boolean printFirst, String sep) { + @Override protected void sep(boolean printFirst, String sep) { final boolean newlineBeforeSep; final boolean newlineAfterSep; if (sep.equals(",")) { @@ -866,7 +866,7 @@ protected Frame startList( return frame; } - public void endList(Frame frame) { + @Override public void endList(Frame frame) { FrameImpl endedFrame = (FrameImpl) frame; Preconditions.checkArgument(frame == this.frame, "Frame does not match current frame"); @@ -903,26 +903,26 @@ public String format(SqlNode node) { return toString(); } - public String toString() { + @Override public String toString() { return buf.toString(); } - public SqlString toSqlString() { + @Override public SqlString toSqlString() { ImmutableList dynamicParameters = this.dynamicParameters == null ? null : this.dynamicParameters.build(); return new SqlString(dialect, toString(), dynamicParameters); } - public SqlDialect getDialect() { + @Override public SqlDialect getDialect() { return dialect; } - public void literal(String s) { + @Override public void literal(String s) { print(s); setNeedWhitespace(true); } - public void keyword(String s) { + @Override public void keyword(String s) { maybeWhitespace(s); buf.append( isKeywordsLowerCase() @@ -984,17 +984,17 @@ protected boolean tooLong(String s) { return result; } - public void print(String s) { + @Override public void print(String s) { maybeWhitespace(s); buf.append(s); } - public void print(int x) { + @Override public void print(int x) { maybeWhitespace("0"); buf.append(x); } - public void identifier(String name, boolean quoted) { + @Override public void identifier(String name, boolean quoted) { // If configured globally or the original identifier is quoted, // then quotes the identifier. maybeWhitespace(name); @@ -1015,45 +1015,45 @@ public void identifier(String name, boolean quoted) { setNeedWhitespace(true); } - public void fetchOffset(SqlNode fetch, SqlNode offset) { + @Override public void fetchOffset(SqlNode fetch, SqlNode offset) { if (fetch == null && offset == null) { return; } dialect.unparseOffsetFetch(this, offset, fetch); } - public void topN(SqlNode fetch, SqlNode offset) { + @Override public void topN(SqlNode fetch, SqlNode offset) { if (fetch == null && offset == null) { return; } dialect.unparseTopN(this, offset, fetch); } - public Frame startFunCall(String funName) { + @Override public Frame startFunCall(String funName) { keyword(funName); setNeedWhitespace(false); return startList(FrameTypeEnum.FUN_CALL, "(", ")"); } - public void endFunCall(Frame frame) { + @Override public void endFunCall(Frame frame) { endList(this.frame); } - public Frame startList(String open, String close) { + @Override public Frame startList(String open, String close) { return startList(FrameTypeEnum.SIMPLE, null, open, close); } - public Frame startList(FrameTypeEnum frameType) { + @Override public Frame startList(FrameTypeEnum frameType) { assert frameType != null; return startList(frameType, null, "", ""); } - public Frame startList(FrameType frameType, String open, String close) { + @Override public Frame startList(FrameType frameType, String open, String close) { assert frameType != null; return startList(frameType, null, open, close); } - public SqlWriter list(FrameTypeEnum frameType, Consumer action) { + @Override public SqlWriter list(FrameTypeEnum frameType, Consumer action) { final SqlWriter.Frame selectListFrame = startList(SqlWriter.FrameTypeEnum.SELECT_LIST); final SqlWriter w = this; @@ -1062,7 +1062,7 @@ public SqlWriter list(FrameTypeEnum frameType, Consumer action) { return this; } - public SqlWriter list(FrameTypeEnum frameType, SqlBinaryOperator sepOp, + @Override public SqlWriter list(FrameTypeEnum frameType, SqlBinaryOperator sepOp, SqlNodeList list) { final SqlWriter.Frame frame = startList(frameType); ((FrameImpl) frame).list(list, sepOp); @@ -1070,11 +1070,11 @@ public SqlWriter list(FrameTypeEnum frameType, SqlBinaryOperator sepOp, return this; } - public void sep(String sep) { + @Override public void sep(String sep) { sep(sep, !(sep.equals(",") || sep.equals("."))); } - public void sep(String sep, boolean printFirst) { + @Override public void sep(String sep, boolean printFirst) { if (frame == null) { throw new RuntimeException("No list started"); } @@ -1084,7 +1084,7 @@ public void sep(String sep, boolean printFirst) { frame.sep(printFirst, sep); } - public void setNeedWhitespace(boolean needWhitespace) { + @Override public void setNeedWhitespace(boolean needWhitespace) { this.needWhitespace = needWhitespace; } diff --git a/core/src/main/java/org/apache/calcite/sql/type/ArraySqlType.java b/core/src/main/java/org/apache/calcite/sql/type/ArraySqlType.java index a749c8c4775..c1bb983ec06 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/ArraySqlType.java +++ b/core/src/main/java/org/apache/calcite/sql/type/ArraySqlType.java @@ -45,7 +45,7 @@ public ArraySqlType(RelDataType elementType, boolean isNullable) { //~ Methods ---------------------------------------------------------------- // implement RelDataTypeImpl - protected void generateTypeString(StringBuilder sb, boolean withDetail) { + @Override protected void generateTypeString(StringBuilder sb, boolean withDetail) { if (withDetail) { sb.append(elementType.getFullTypeString()); } else { @@ -55,25 +55,25 @@ protected void generateTypeString(StringBuilder sb, boolean withDetail) { } // implement RelDataType - public RelDataType getComponentType() { + @Override public RelDataType getComponentType() { return elementType; } // implement RelDataType - public RelDataTypeFamily getFamily() { + @Override public RelDataTypeFamily getFamily() { return this; } @Override public RelDataTypePrecedenceList getPrecedenceList() { return new RelDataTypePrecedenceList() { - public boolean containsType(RelDataType type) { + @Override public boolean containsType(RelDataType type) { return type.getSqlTypeName() == getSqlTypeName() && type.getComponentType() != null && getComponentType().getPrecedenceList().containsType( type.getComponentType()); } - public int compareTypePrecedence(RelDataType type1, RelDataType type2) { + @Override public int compareTypePrecedence(RelDataType type1, RelDataType type2) { if (!containsType(type1)) { throw new IllegalArgumentException("must contain type: " + type1); } diff --git a/core/src/main/java/org/apache/calcite/sql/type/AssignableOperandTypeChecker.java b/core/src/main/java/org/apache/calcite/sql/type/AssignableOperandTypeChecker.java index 5db711fb8f9..b00ad7ffa76 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/AssignableOperandTypeChecker.java +++ b/core/src/main/java/org/apache/calcite/sql/type/AssignableOperandTypeChecker.java @@ -57,15 +57,15 @@ public AssignableOperandTypeChecker(List paramTypes, //~ Methods ---------------------------------------------------------------- - public boolean isOptional(int i) { + @Override public boolean isOptional(int i) { return false; } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.of(paramTypes.size()); } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { // Do not use callBinding.operands(). We have not resolved to a function @@ -85,7 +85,7 @@ public boolean checkOperandTypes( return true; } - public String getAllowedSignatures(SqlOperator op, String opName) { + @Override public String getAllowedSignatures(SqlOperator op, String opName) { StringBuilder sb = new StringBuilder(); sb.append(opName); sb.append("("); @@ -105,7 +105,7 @@ public String getAllowedSignatures(SqlOperator op, String opName) { return sb.toString(); } - public Consistency getConsistency() { + @Override public Consistency getConsistency() { return Consistency.NONE; } } diff --git a/core/src/main/java/org/apache/calcite/sql/type/BasicSqlType.java b/core/src/main/java/org/apache/calcite/sql/type/BasicSqlType.java index bea494ecb86..90b41cf7ea7 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/BasicSqlType.java +++ b/core/src/main/java/org/apache/calcite/sql/type/BasicSqlType.java @@ -171,7 +171,7 @@ BasicSqlType createWithCharsetAndCollation(Charset charset, } // implement RelDataTypeImpl - protected void generateTypeString(StringBuilder sb, boolean withDetail) { + @Override protected void generateTypeString(StringBuilder sb, boolean withDetail) { // Called to make the digest, which equals() compares; // so equivalent data types must produce identical type strings. diff --git a/core/src/main/java/org/apache/calcite/sql/type/ComparableOperandTypeChecker.java b/core/src/main/java/org/apache/calcite/sql/type/ComparableOperandTypeChecker.java index a3a2b22a629..4983feb48d7 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/ComparableOperandTypeChecker.java +++ b/core/src/main/java/org/apache/calcite/sql/type/ComparableOperandTypeChecker.java @@ -51,7 +51,7 @@ public ComparableOperandTypeChecker(int nOperands, //~ Methods ---------------------------------------------------------------- - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { boolean b = true; @@ -98,7 +98,7 @@ private boolean checkType( * {@link #checkOperandTypes(SqlCallBinding, boolean)}, but not part of the * interface, and cannot throw an error. */ - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlOperatorBinding operatorBinding, SqlCallBinding callBinding) { boolean b = true; for (int i = 0; i < nOperands; ++i) { diff --git a/core/src/main/java/org/apache/calcite/sql/type/CompositeOperandTypeChecker.java b/core/src/main/java/org/apache/calcite/sql/type/CompositeOperandTypeChecker.java index 4981ce98a2b..96dd97af50f 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/CompositeOperandTypeChecker.java +++ b/core/src/main/java/org/apache/calcite/sql/type/CompositeOperandTypeChecker.java @@ -108,7 +108,7 @@ public enum Composition { //~ Methods ---------------------------------------------------------------- - public boolean isOptional(int i) { + @Override public boolean isOptional(int i) { for (SqlOperandTypeChecker allowedRule : allowedRules) { if (allowedRule.isOptional(i)) { return true; @@ -121,11 +121,11 @@ public ImmutableList getRules() { return allowedRules; } - public Consistency getConsistency() { + @Override public Consistency getConsistency() { return Consistency.NONE; } - public String getAllowedSignatures(SqlOperator op, String opName) { + @Override public String getAllowedSignatures(SqlOperator op, String opName) { if (allowedSignatures != null) { return allowedSignatures; } @@ -147,7 +147,7 @@ public String getAllowedSignatures(SqlOperator op, String opName) { return ret.toString(); } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { switch (composition) { case REPEAT: return range; @@ -158,11 +158,11 @@ public SqlOperandCountRange getOperandCountRange() { default: final List ranges = new AbstractList() { - public SqlOperandCountRange get(int index) { + @Override public SqlOperandCountRange get(int index) { return allowedRules.get(index).getOperandCountRange(); } - public int size() { + @Override public int size() { return allowedRules.size(); } }; @@ -170,7 +170,7 @@ public int size() { final int max = maxMax(ranges); SqlOperandCountRange composite = new SqlOperandCountRange() { - public boolean isValidCount(int count) { + @Override public boolean isValidCount(int count) { switch (composition) { case AND: for (SqlOperandCountRange range : ranges) { @@ -190,11 +190,11 @@ public boolean isValidCount(int count) { } } - public int getMin() { + @Override public int getMin() { return min; } - public int getMax() { + @Override public int getMax() { return max; } }; @@ -235,7 +235,7 @@ private int maxMax(List ranges) { return max; } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { // 1. Check eagerly for binary arithmetic expressions. diff --git a/core/src/main/java/org/apache/calcite/sql/type/CompositeSingleOperandTypeChecker.java b/core/src/main/java/org/apache/calcite/sql/type/CompositeSingleOperandTypeChecker.java index 8d03d00a085..d6748c6cbb9 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/CompositeSingleOperandTypeChecker.java +++ b/core/src/main/java/org/apache/calcite/sql/type/CompositeSingleOperandTypeChecker.java @@ -52,7 +52,7 @@ public class CompositeSingleOperandTypeChecker return (ImmutableList) allowedRules; } - public boolean checkSingleOperandType( + @Override public boolean checkSingleOperandType( SqlCallBinding callBinding, SqlNode node, int iFormalOperand, diff --git a/core/src/main/java/org/apache/calcite/sql/type/CursorReturnTypeInference.java b/core/src/main/java/org/apache/calcite/sql/type/CursorReturnTypeInference.java index f965ad376ed..69f92148089 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/CursorReturnTypeInference.java +++ b/core/src/main/java/org/apache/calcite/sql/type/CursorReturnTypeInference.java @@ -38,7 +38,7 @@ public CursorReturnTypeInference(int ordinal) { //~ Methods ---------------------------------------------------------------- - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( SqlOperatorBinding opBinding) { return opBinding.getCursorOperand(ordinal); } diff --git a/core/src/main/java/org/apache/calcite/sql/type/ExplicitOperandTypeChecker.java b/core/src/main/java/org/apache/calcite/sql/type/ExplicitOperandTypeChecker.java index f817724e9c3..14b247de71b 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/ExplicitOperandTypeChecker.java +++ b/core/src/main/java/org/apache/calcite/sql/type/ExplicitOperandTypeChecker.java @@ -38,11 +38,11 @@ public ExplicitOperandTypeChecker(RelDataType type) { this.type = Objects.requireNonNull(type); } - public boolean isOptional(int i) { + @Override public boolean isOptional(int i) { return false; } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { List families = new ArrayList<>(); @@ -62,15 +62,15 @@ public boolean checkOperandTypes( return OperandTypes.family(families).checkOperandTypes(callBinding, throwOnFailure); } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.of(type.getFieldCount()); } - public String getAllowedSignatures(SqlOperator op, String opName) { + @Override public String getAllowedSignatures(SqlOperator op, String opName) { return " " + opName + " "; } - public Consistency getConsistency() { + @Override public Consistency getConsistency() { return Consistency.NONE; } } diff --git a/core/src/main/java/org/apache/calcite/sql/type/ExplicitOperandTypeInference.java b/core/src/main/java/org/apache/calcite/sql/type/ExplicitOperandTypeInference.java index 08d0ab6b275..c0bad4bdd52 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/ExplicitOperandTypeInference.java +++ b/core/src/main/java/org/apache/calcite/sql/type/ExplicitOperandTypeInference.java @@ -40,7 +40,7 @@ public class ExplicitOperandTypeInference implements SqlOperandTypeInference { //~ Methods ---------------------------------------------------------------- - public void inferOperandTypes( + @Override public void inferOperandTypes( SqlCallBinding callBinding, RelDataType returnType, RelDataType[] operandTypes) { diff --git a/core/src/main/java/org/apache/calcite/sql/type/ExplicitReturnTypeInference.java b/core/src/main/java/org/apache/calcite/sql/type/ExplicitReturnTypeInference.java index e64b1a324f4..f3b6392e50b 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/ExplicitReturnTypeInference.java +++ b/core/src/main/java/org/apache/calcite/sql/type/ExplicitReturnTypeInference.java @@ -51,7 +51,7 @@ protected ExplicitReturnTypeInference(RelProtoDataType protoType) { //~ Methods ---------------------------------------------------------------- - public RelDataType inferReturnType(SqlOperatorBinding opBinding) { + @Override public RelDataType inferReturnType(SqlOperatorBinding opBinding) { return protoType.apply(opBinding.getTypeFactory()); } } diff --git a/core/src/main/java/org/apache/calcite/sql/type/FamilyOperandTypeChecker.java b/core/src/main/java/org/apache/calcite/sql/type/FamilyOperandTypeChecker.java index 3910e307497..c8fe147e29d 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/FamilyOperandTypeChecker.java +++ b/core/src/main/java/org/apache/calcite/sql/type/FamilyOperandTypeChecker.java @@ -56,11 +56,11 @@ public class FamilyOperandTypeChecker implements SqlSingleOperandTypeChecker, //~ Methods ---------------------------------------------------------------- - public boolean isOptional(int i) { + @Override public boolean isOptional(int i) { return optional.test(i); } - public boolean checkSingleOperandType( + @Override public boolean checkSingleOperandType( SqlCallBinding callBinding, SqlNode node, int iFormalOperand, @@ -110,7 +110,7 @@ public boolean checkSingleOperandType( return true; } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { if (families.size() != callBinding.getOperandCount()) { @@ -175,7 +175,7 @@ public boolean checkOperandTypes( return families.get(iFormalOperand); } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { final int max = families.size(); int min = max; while (min > 0 && optional.test(min - 1)) { @@ -184,11 +184,11 @@ public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.between(min, max); } - public String getAllowedSignatures(SqlOperator op, String opName) { + @Override public String getAllowedSignatures(SqlOperator op, String opName) { return SqlUtil.getAliasedSignature(op, opName, families); } - public Consistency getConsistency() { + @Override public Consistency getConsistency() { return Consistency.NONE; } } diff --git a/core/src/main/java/org/apache/calcite/sql/type/IntervalSqlType.java b/core/src/main/java/org/apache/calcite/sql/type/IntervalSqlType.java index c58240c3b27..203db2f6413 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/IntervalSqlType.java +++ b/core/src/main/java/org/apache/calcite/sql/type/IntervalSqlType.java @@ -56,7 +56,7 @@ public IntervalSqlType(RelDataTypeSystem typeSystem, //~ Methods ---------------------------------------------------------------- - protected void generateTypeString(StringBuilder sb, boolean withDetail) { + @Override protected void generateTypeString(StringBuilder sb, boolean withDetail) { sb.append("INTERVAL "); final SqlDialect dialect = AnsiSqlDialect.DEFAULT; final SqlWriterConfig config = SqlPrettyWriter.config() diff --git a/core/src/main/java/org/apache/calcite/sql/type/LiteralOperandTypeChecker.java b/core/src/main/java/org/apache/calcite/sql/type/LiteralOperandTypeChecker.java index 47265441845..771714965ae 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/LiteralOperandTypeChecker.java +++ b/core/src/main/java/org/apache/calcite/sql/type/LiteralOperandTypeChecker.java @@ -44,11 +44,11 @@ public LiteralOperandTypeChecker(boolean allowNull) { //~ Methods ---------------------------------------------------------------- - public boolean isOptional(int i) { + @Override public boolean isOptional(int i) { return false; } - public boolean checkSingleOperandType( + @Override public boolean checkSingleOperandType( SqlCallBinding callBinding, SqlNode node, int iFormalOperand, @@ -78,7 +78,7 @@ public boolean checkSingleOperandType( return true; } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { return checkSingleOperandType( @@ -88,15 +88,15 @@ public boolean checkOperandTypes( throwOnFailure); } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.of(1); } - public String getAllowedSignatures(SqlOperator op, String opName) { + @Override public String getAllowedSignatures(SqlOperator op, String opName) { return ""; } - public Consistency getConsistency() { + @Override public Consistency getConsistency() { return Consistency.NONE; } } diff --git a/core/src/main/java/org/apache/calcite/sql/type/MapSqlType.java b/core/src/main/java/org/apache/calcite/sql/type/MapSqlType.java index 551940577ba..7ca3b1343a6 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/MapSqlType.java +++ b/core/src/main/java/org/apache/calcite/sql/type/MapSqlType.java @@ -55,7 +55,7 @@ public MapSqlType( } // implement RelDataTypeImpl - protected void generateTypeString(StringBuilder sb, boolean withDetail) { + @Override protected void generateTypeString(StringBuilder sb, boolean withDetail) { sb.append("(") .append( withDetail @@ -70,7 +70,7 @@ protected void generateTypeString(StringBuilder sb, boolean withDetail) { } // implement RelDataType - public RelDataTypeFamily getFamily() { + @Override public RelDataTypeFamily getFamily() { return this; } } diff --git a/core/src/main/java/org/apache/calcite/sql/type/MatchReturnTypeInference.java b/core/src/main/java/org/apache/calcite/sql/type/MatchReturnTypeInference.java index 832ba2bf944..a8465506fbe 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/MatchReturnTypeInference.java +++ b/core/src/main/java/org/apache/calcite/sql/type/MatchReturnTypeInference.java @@ -59,7 +59,7 @@ public MatchReturnTypeInference(int start, Iterable typeNames) { //~ Methods ---------------------------------------------------------------- - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( SqlOperatorBinding opBinding) { for (int i = start; i < opBinding.getOperandCount(); i++) { RelDataType argType = opBinding.getOperandType(i); diff --git a/core/src/main/java/org/apache/calcite/sql/type/MultisetOperandTypeChecker.java b/core/src/main/java/org/apache/calcite/sql/type/MultisetOperandTypeChecker.java index 0e728c888dd..57c3ffe6d4e 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/MultisetOperandTypeChecker.java +++ b/core/src/main/java/org/apache/calcite/sql/type/MultisetOperandTypeChecker.java @@ -35,11 +35,11 @@ public class MultisetOperandTypeChecker implements SqlOperandTypeChecker { //~ Methods ---------------------------------------------------------------- - public boolean isOptional(int i) { + @Override public boolean isOptional(int i) { return false; } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { final SqlNode op0 = callBinding.operand(0); @@ -82,15 +82,15 @@ public boolean checkOperandTypes( return true; } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.of(2); } - public String getAllowedSignatures(SqlOperator op, String opName) { + @Override public String getAllowedSignatures(SqlOperator op, String opName) { return " " + opName + " "; } - public Consistency getConsistency() { + @Override public Consistency getConsistency() { return Consistency.NONE; } } diff --git a/core/src/main/java/org/apache/calcite/sql/type/MultisetSqlType.java b/core/src/main/java/org/apache/calcite/sql/type/MultisetSqlType.java index b43971cfc10..1bb70eef390 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/MultisetSqlType.java +++ b/core/src/main/java/org/apache/calcite/sql/type/MultisetSqlType.java @@ -44,7 +44,7 @@ public MultisetSqlType(RelDataType elementType, boolean isNullable) { //~ Methods ---------------------------------------------------------------- // implement RelDataTypeImpl - protected void generateTypeString(StringBuilder sb, boolean withDetail) { + @Override protected void generateTypeString(StringBuilder sb, boolean withDetail) { if (withDetail) { sb.append(elementType.getFullTypeString()); } else { @@ -54,12 +54,12 @@ protected void generateTypeString(StringBuilder sb, boolean withDetail) { } // implement RelDataType - public RelDataType getComponentType() { + @Override public RelDataType getComponentType() { return elementType; } // implement RelDataType - public RelDataTypeFamily getFamily() { + @Override public RelDataTypeFamily getFamily() { // TODO jvs 2-Dec-2004: This gives each multiset type its // own family. But that's not quite correct; the family should // be based on the element type for proper comparability @@ -72,14 +72,14 @@ public RelDataTypeFamily getFamily() { @Override public RelDataTypePrecedenceList getPrecedenceList() { return new RelDataTypePrecedenceList() { - public boolean containsType(RelDataType type) { + @Override public boolean containsType(RelDataType type) { return type.getSqlTypeName() == getSqlTypeName() && type.getComponentType() != null && getComponentType().getPrecedenceList().containsType( type.getComponentType()); } - public int compareTypePrecedence(RelDataType type1, RelDataType type2) { + @Override public int compareTypePrecedence(RelDataType type1, RelDataType type2) { if (!containsType(type1)) { throw new IllegalArgumentException("must contain type: " + type1); } diff --git a/core/src/main/java/org/apache/calcite/sql/type/OperandTypes.java b/core/src/main/java/org/apache/calcite/sql/type/OperandTypes.java index abb6fb87868..e0e1353147b 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/OperandTypes.java +++ b/core/src/main/java/org/apache/calcite/sql/type/OperandTypes.java @@ -186,25 +186,25 @@ public static SqlOperandTypeChecker repeat(SqlOperandCountRange range, public static SqlOperandTypeChecker variadic( final SqlOperandCountRange range) { return new SqlOperandTypeChecker() { - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { return range.isValidCount(callBinding.getOperandCount()); } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return range; } - public String getAllowedSignatures(SqlOperator op, String opName) { + @Override public String getAllowedSignatures(SqlOperator op, String opName) { return opName + "(...)"; } - public boolean isOptional(int i) { + @Override public boolean isOptional(int i) { return false; } - public Consistency getConsistency() { + @Override public Consistency getConsistency() { return Consistency.NONE; } }; @@ -319,7 +319,7 @@ public Consistency getConsistency() { public static final SqlSingleOperandTypeChecker POSITIVE_INTEGER_LITERAL = new FamilyOperandTypeChecker(ImmutableList.of(SqlTypeFamily.INTEGER), i -> false) { - public boolean checkSingleOperandType( + @Override public boolean checkSingleOperandType( SqlCallBinding callBinding, SqlNode node, int iFormalOperand, @@ -532,7 +532,7 @@ private boolean hasFractionalPart(BigDecimal bd) { ImmutableList.of(SqlTypeFamily.DATETIME, SqlTypeFamily.DATETIME, SqlTypeFamily.DATETIME_INTERVAL), i -> false) { - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { if (!super.checkOperandTypes(callBinding, throwOnFailure)) { @@ -575,7 +575,7 @@ private RecordTypeWithOneFieldChecker(Predicate predicate) { this.typeNamePredicate = predicate; } - public boolean checkSingleOperandType( + @Override public boolean checkSingleOperandType( SqlCallBinding callBinding, SqlNode node, int iFormalOperand, @@ -601,7 +601,7 @@ public boolean checkSingleOperandType( return !validationError; } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { return checkSingleOperandType( @@ -611,15 +611,15 @@ public boolean checkOperandTypes( throwOnFailure); } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.of(1); } - public boolean isOptional(int i) { + @Override public boolean isOptional(int i) { return false; } - public Consistency getConsistency() { + @Override public Consistency getConsistency() { return Consistency.NONE; } } @@ -654,7 +654,7 @@ public Consistency getConsistency() { public static final SqlOperandTypeChecker RECORD_TO_SCALAR = new SqlSingleOperandTypeChecker() { - public boolean checkSingleOperandType( + @Override public boolean checkSingleOperandType( SqlCallBinding callBinding, SqlNode node, int iFormalOperand, @@ -674,7 +674,7 @@ public boolean checkSingleOperandType( return !validationError; } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { return checkSingleOperandType( @@ -684,20 +684,20 @@ public boolean checkOperandTypes( throwOnFailure); } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.of(1); } - public String getAllowedSignatures(SqlOperator op, String opName) { + @Override public String getAllowedSignatures(SqlOperator op, String opName) { return SqlUtil.getAliasedSignature(op, opName, ImmutableList.of("RECORDTYPE(SINGLE FIELD)")); } - public boolean isOptional(int i) { + @Override public boolean isOptional(int i) { return false; } - public Consistency getConsistency() { + @Override public Consistency getConsistency() { return Consistency.NONE; } }; @@ -712,7 +712,7 @@ public Consistency getConsistency() { * */ private static class PeriodOperandTypeChecker implements SqlSingleOperandTypeChecker { - public boolean checkSingleOperandType(SqlCallBinding callBinding, + @Override public boolean checkSingleOperandType(SqlCallBinding callBinding, SqlNode node, int iFormalOperand, boolean throwOnFailure) { assert 0 == iFormalOperand; RelDataType type = SqlTypeUtil.deriveType(callBinding, node); @@ -738,27 +738,27 @@ public boolean checkSingleOperandType(SqlCallBinding callBinding, return valid; } - public boolean checkOperandTypes(SqlCallBinding callBinding, + @Override public boolean checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure) { return checkSingleOperandType(callBinding, callBinding.operand(0), 0, throwOnFailure); } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.of(1); } - public String getAllowedSignatures(SqlOperator op, String opName) { + @Override public String getAllowedSignatures(SqlOperator op, String opName) { return SqlUtil.getAliasedSignature(op, opName, ImmutableList.of("PERIOD (DATETIME, INTERVAL)", "PERIOD (DATETIME, DATETIME)")); } - public boolean isOptional(int i) { + @Override public boolean isOptional(int i) { return false; } - public Consistency getConsistency() { + @Override public Consistency getConsistency() { return Consistency.NONE; } } diff --git a/core/src/main/java/org/apache/calcite/sql/type/OrdinalReturnTypeInference.java b/core/src/main/java/org/apache/calcite/sql/type/OrdinalReturnTypeInference.java index 7c6c53fe550..8ef2670de02 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/OrdinalReturnTypeInference.java +++ b/core/src/main/java/org/apache/calcite/sql/type/OrdinalReturnTypeInference.java @@ -35,7 +35,7 @@ public OrdinalReturnTypeInference(int ordinal) { //~ Methods ---------------------------------------------------------------- - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( SqlOperatorBinding opBinding) { return opBinding.getOperandType(ordinal); } 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 98bfcb33fee..44ede214a6c 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 @@ -384,7 +384,7 @@ public static ExplicitReturnTypeInference explicit(SqlTypeName typeName, opBinding, new AbstractList() { // CHECKSTYLE: IGNORE 12 - public RelDataType get(int index) { + @Override public RelDataType get(int index) { RelDataType type = opBinding.getOperandType(index) .getComponentType(); @@ -392,7 +392,7 @@ public RelDataType get(int index) { return type; } - public int size() { + @Override public int size() { return opBinding.getOperandCount(); } }); diff --git a/core/src/main/java/org/apache/calcite/sql/type/SameOperandTypeChecker.java b/core/src/main/java/org/apache/calcite/sql/type/SameOperandTypeChecker.java index fadd960e7cd..4087102d9fe 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/SameOperandTypeChecker.java +++ b/core/src/main/java/org/apache/calcite/sql/type/SameOperandTypeChecker.java @@ -49,15 +49,15 @@ public SameOperandTypeChecker( //~ Methods ---------------------------------------------------------------- - public Consistency getConsistency() { + @Override public Consistency getConsistency() { return Consistency.NONE; } - public boolean isOptional(int i) { + @Override public boolean isOptional(int i) { return false; } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { return checkOperandTypesImpl( @@ -118,7 +118,7 @@ public boolean checkOperandTypes( } // implement SqlOperandTypeChecker - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { if (nOperands == -1) { return SqlOperandCountRanges.any(); } else { @@ -126,7 +126,7 @@ public SqlOperandCountRange getOperandCountRange() { } } - public String getAllowedSignatures(SqlOperator op, String opName) { + @Override public String getAllowedSignatures(SqlOperator op, String opName) { final String typeName = getTypeName(); return SqlUtil.getAliasedSignature(op, opName, nOperands == -1 @@ -140,7 +140,7 @@ protected String getTypeName() { return "EQUIVALENT_TYPE"; } - public boolean checkSingleOperandType( + @Override public boolean checkSingleOperandType( SqlCallBinding callBinding, SqlNode operand, int iFormalOperand, diff --git a/core/src/main/java/org/apache/calcite/sql/type/SameOperandTypeExceptLastOperandChecker.java b/core/src/main/java/org/apache/calcite/sql/type/SameOperandTypeExceptLastOperandChecker.java index 8896a0a4015..7c34c1e4a36 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/SameOperandTypeExceptLastOperandChecker.java +++ b/core/src/main/java/org/apache/calcite/sql/type/SameOperandTypeExceptLastOperandChecker.java @@ -47,7 +47,7 @@ public SameOperandTypeExceptLastOperandChecker( //~ Methods ---------------------------------------------------------------- - protected boolean checkOperandTypesImpl( + @Override protected boolean checkOperandTypesImpl( SqlOperatorBinding operatorBinding, boolean throwOnFailure, SqlCallBinding callBinding) { @@ -94,7 +94,7 @@ protected boolean checkOperandTypesImpl( return true; } - public String getAllowedSignatures(SqlOperator op, String opName) { + @Override public String getAllowedSignatures(SqlOperator op, String opName) { final String typeName = getTypeName(); if (nOperands == -1) { return SqlUtil.getAliasedSignature(op, opName, diff --git a/core/src/main/java/org/apache/calcite/sql/type/SetopOperandTypeChecker.java b/core/src/main/java/org/apache/calcite/sql/type/SetopOperandTypeChecker.java index cc27d9bd878..05a11170466 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/SetopOperandTypeChecker.java +++ b/core/src/main/java/org/apache/calcite/sql/type/SetopOperandTypeChecker.java @@ -42,11 +42,11 @@ public class SetopOperandTypeChecker implements SqlOperandTypeChecker { //~ Methods ---------------------------------------------------------------- - public boolean isOptional(int i) { + @Override public boolean isOptional(int i) { return false; } - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { assert callBinding.getOperandCount() == 2 @@ -100,12 +100,12 @@ public boolean checkOperandTypes( // and record type (f3: VARCHAR, f4: DECIMAL, f5: INT), // the list would be [[INT, VARCHAR], [BIGINT, DECIMAL], [VARCHAR, INT]]. final List columnIthTypes = new AbstractList() { - public RelDataType get(int index) { + @Override public RelDataType get(int index) { return argTypes[index].getFieldList().get(i2) .getType(); } - public int size() { + @Override public int size() { return argTypes.length; } }; @@ -143,15 +143,15 @@ public int size() { return true; } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.of(2); } - public String getAllowedSignatures(SqlOperator op, String opName) { + @Override public String getAllowedSignatures(SqlOperator op, String opName) { return "{0} " + opName + " {1}"; } - public Consistency getConsistency() { + @Override public Consistency getConsistency() { return Consistency.NONE; } } diff --git a/core/src/main/java/org/apache/calcite/sql/type/SqlOperandCountRanges.java b/core/src/main/java/org/apache/calcite/sql/type/SqlOperandCountRanges.java index 63a7b615e4c..f8494e95f3f 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/SqlOperandCountRanges.java +++ b/core/src/main/java/org/apache/calcite/sql/type/SqlOperandCountRanges.java @@ -52,15 +52,15 @@ private static class RangeImpl implements SqlOperandCountRange { Preconditions.checkArgument(min >= 0); } - public boolean isValidCount(int count) { + @Override public boolean isValidCount(int count) { return count >= min && (max == -1 || count <= max); } - public int getMin() { + @Override public int getMin() { return min; } - public int getMax() { + @Override public int getMax() { return max; } } 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 67163d95187..213eba9f9ff 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 @@ -48,7 +48,7 @@ public class SqlReturnTypeInferenceChain implements SqlReturnTypeInference { //~ Methods ---------------------------------------------------------------- - public RelDataType inferReturnType(SqlOperatorBinding opBinding) { + @Override public RelDataType inferReturnType(SqlOperatorBinding opBinding) { for (SqlReturnTypeInference rule : rules) { RelDataType ret = rule.inferReturnType(opBinding); if (ret != null) { diff --git a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeExplicitPrecedenceList.java b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeExplicitPrecedenceList.java index bd4fee33984..45309971a3a 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeExplicitPrecedenceList.java +++ b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeExplicitPrecedenceList.java @@ -129,13 +129,13 @@ private static SqlTypeExplicitPrecedenceList numeric(SqlTypeName typeName) { } // implement RelDataTypePrecedenceList - public boolean containsType(RelDataType type) { + @Override public boolean containsType(RelDataType type) { SqlTypeName typeName = type.getSqlTypeName(); return typeName != null && typeNames.contains(typeName); } // implement RelDataTypePrecedenceList - public int compareTypePrecedence(RelDataType type1, RelDataType type2) { + @Override public int compareTypePrecedence(RelDataType type1, RelDataType type2) { assert containsType(type1) : type1; assert containsType(type2) : type2; diff --git a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeFactoryImpl.java b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeFactoryImpl.java index 7709985dbad..fecf939c9c0 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeFactoryImpl.java +++ b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeFactoryImpl.java @@ -41,7 +41,7 @@ public SqlTypeFactoryImpl(RelDataTypeSystem typeSystem) { //~ Methods ---------------------------------------------------------------- - public RelDataType createSqlType(SqlTypeName typeName) { + @Override public RelDataType createSqlType(SqlTypeName typeName) { if (typeName.allowsPrec()) { return createSqlType(typeName, typeSystem.getDefaultPrecision(typeName)); } @@ -50,7 +50,7 @@ public RelDataType createSqlType(SqlTypeName typeName) { return canonize(newType); } - public RelDataType createSqlType( + @Override public RelDataType createSqlType( SqlTypeName typeName, int precision) { final int maxPrecision = typeSystem.getMaxPrecision(typeName); @@ -71,7 +71,7 @@ public RelDataType createSqlType( return canonize(newType); } - public RelDataType createSqlType( + @Override public RelDataType createSqlType( SqlTypeName typeName, int precision, int scale) { @@ -88,11 +88,11 @@ public RelDataType createSqlType( return canonize(newType); } - public RelDataType createUnknownType() { + @Override public RelDataType createUnknownType() { return canonize(new UnknownSqlType(this)); } - public RelDataType createMultisetType( + @Override public RelDataType createMultisetType( RelDataType type, long maxCardinality) { assert maxCardinality == -1; @@ -100,7 +100,7 @@ public RelDataType createMultisetType( return canonize(newType); } - public RelDataType createArrayType( + @Override public RelDataType createArrayType( RelDataType elementType, long maxCardinality) { assert maxCardinality == -1; @@ -108,21 +108,21 @@ public RelDataType createArrayType( return canonize(newType); } - public RelDataType createMapType( + @Override public RelDataType createMapType( RelDataType keyType, RelDataType valueType) { MapSqlType newType = new MapSqlType(keyType, valueType, false); return canonize(newType); } - public RelDataType createSqlIntervalType( + @Override public RelDataType createSqlIntervalType( SqlIntervalQualifier intervalQualifier) { RelDataType newType = new IntervalSqlType(typeSystem, intervalQualifier, false); return canonize(newType); } - public RelDataType createTypeWithCharsetAndCollation( + @Override public RelDataType createTypeWithCharsetAndCollation( RelDataType type, Charset charset, SqlCollation collation) { @@ -538,7 +538,7 @@ private RelDataType copyMapType(RelDataType type, boolean nullable) { } // override RelDataTypeFactoryImpl - protected RelDataType canonize(RelDataType type) { + @Override protected RelDataType canonize(RelDataType type) { type = super.canonize(type); if (!(type instanceof ObjectSqlType)) { return type; diff --git a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeTransformCascade.java b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeTransformCascade.java index 474a0f0980f..2916cacb4a2 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeTransformCascade.java +++ b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeTransformCascade.java @@ -51,7 +51,7 @@ public SqlTypeTransformCascade( //~ Methods ---------------------------------------------------------------- - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( SqlOperatorBinding opBinding) { RelDataType ret = rule.inferReturnType(opBinding); if (ret == null) { diff --git a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeTransforms.java b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeTransforms.java index 59125142eb3..4f3247fb237 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeTransforms.java +++ b/core/src/main/java/org/apache/calcite/sql/type/SqlTypeTransforms.java @@ -100,7 +100,7 @@ public abstract class SqlTypeTransforms { */ public static final SqlTypeTransform TO_VARYING = new SqlTypeTransform() { - public RelDataType transformType( + @Override public RelDataType transformType( SqlOperatorBinding opBinding, RelDataType typeToTransform) { switch (typeToTransform.getSqlTypeName()) { diff --git a/core/src/main/java/org/apache/calcite/sql/type/TableFunctionReturnTypeInference.java b/core/src/main/java/org/apache/calcite/sql/type/TableFunctionReturnTypeInference.java index 248a0e3afa2..ffe396e2fe4 100644 --- a/core/src/main/java/org/apache/calcite/sql/type/TableFunctionReturnTypeInference.java +++ b/core/src/main/java/org/apache/calcite/sql/type/TableFunctionReturnTypeInference.java @@ -61,7 +61,7 @@ public Set getColumnMappings() { return columnMappings; } - public RelDataType inferReturnType( + @Override public RelDataType inferReturnType( SqlOperatorBinding opBinding) { columnMappings = new HashSet<>(); RelDataType unexpandedOutputType = diff --git a/core/src/main/java/org/apache/calcite/sql/util/ChainedSqlOperatorTable.java b/core/src/main/java/org/apache/calcite/sql/util/ChainedSqlOperatorTable.java index a85d025d543..4f8b4509bb1 100644 --- a/core/src/main/java/org/apache/calcite/sql/util/ChainedSqlOperatorTable.java +++ b/core/src/main/java/org/apache/calcite/sql/util/ChainedSqlOperatorTable.java @@ -60,7 +60,7 @@ public void add(SqlOperatorTable table) { } } - public void lookupOperatorOverloads(SqlIdentifier opName, + @Override public void lookupOperatorOverloads(SqlIdentifier opName, SqlFunctionCategory category, SqlSyntax syntax, List operatorList, SqlNameMatcher nameMatcher) { for (SqlOperatorTable table : tableList) { @@ -69,7 +69,7 @@ public void lookupOperatorOverloads(SqlIdentifier opName, } } - public List getOperatorList() { + @Override public List getOperatorList() { List list = new ArrayList<>(); for (SqlOperatorTable table : tableList) { list.addAll(table.getOperatorList()); diff --git a/core/src/main/java/org/apache/calcite/sql/util/ListSqlOperatorTable.java b/core/src/main/java/org/apache/calcite/sql/util/ListSqlOperatorTable.java index f9a9c31a6fc..f752565b3b4 100644 --- a/core/src/main/java/org/apache/calcite/sql/util/ListSqlOperatorTable.java +++ b/core/src/main/java/org/apache/calcite/sql/util/ListSqlOperatorTable.java @@ -52,7 +52,7 @@ public void add(SqlOperator op) { operatorList.add(op); } - public void lookupOperatorOverloads(SqlIdentifier opName, + @Override public void lookupOperatorOverloads(SqlIdentifier opName, SqlFunctionCategory category, SqlSyntax syntax, List operatorList, @@ -82,7 +82,7 @@ protected static SqlFunctionCategory category(SqlOperator operator) { } } - public List getOperatorList() { + @Override public List getOperatorList() { return operatorList; } } diff --git a/core/src/main/java/org/apache/calcite/sql/util/ReflectiveSqlOperatorTable.java b/core/src/main/java/org/apache/calcite/sql/util/ReflectiveSqlOperatorTable.java index 158075a8aaf..246bc587e94 100644 --- a/core/src/main/java/org/apache/calcite/sql/util/ReflectiveSqlOperatorTable.java +++ b/core/src/main/java/org/apache/calcite/sql/util/ReflectiveSqlOperatorTable.java @@ -84,7 +84,7 @@ public final void init() { } // implement SqlOperatorTable - public void lookupOperatorOverloads(SqlIdentifier opName, + @Override public void lookupOperatorOverloads(SqlIdentifier opName, SqlFunctionCategory category, SqlSyntax syntax, List operatorList, SqlNameMatcher nameMatcher) { // NOTE jvs 3-Mar-2005: ignore category until someone cares @@ -159,7 +159,7 @@ public void register(SqlOperator op) { caseInsensitiveOperators.put(new CaseInsensitiveKey(op.getName(), op.getSyntax()), op); } - public List getOperatorList() { + @Override public List getOperatorList() { return ImmutableList.copyOf(caseSensitiveOperators.values()); } diff --git a/core/src/main/java/org/apache/calcite/sql/util/SqlBasicVisitor.java b/core/src/main/java/org/apache/calcite/sql/util/SqlBasicVisitor.java index eac3b7e07ba..a0f04f8b5d5 100644 --- a/core/src/main/java/org/apache/calcite/sql/util/SqlBasicVisitor.java +++ b/core/src/main/java/org/apache/calcite/sql/util/SqlBasicVisitor.java @@ -37,15 +37,15 @@ public class SqlBasicVisitor implements SqlVisitor { //~ Methods ---------------------------------------------------------------- - public R visit(SqlLiteral literal) { + @Override public R visit(SqlLiteral literal) { return null; } - public R visit(SqlCall call) { + @Override public R visit(SqlCall call) { return call.getOperator().acceptCall(this, call); } - public R visit(SqlNodeList nodeList) { + @Override public R visit(SqlNodeList nodeList) { R result = null; for (int i = 0; i < nodeList.size(); i++) { SqlNode node = nodeList.get(i); @@ -54,19 +54,19 @@ public R visit(SqlNodeList nodeList) { return result; } - public R visit(SqlIdentifier id) { + @Override public R visit(SqlIdentifier id) { return null; } - public R visit(SqlDataTypeSpec type) { + @Override public R visit(SqlDataTypeSpec type) { return null; } - public R visit(SqlDynamicParam param) { + @Override public R visit(SqlDynamicParam param) { return null; } - public R visit(SqlIntervalQualifier intervalQualifier) { + @Override public R visit(SqlIntervalQualifier intervalQualifier) { return null; } @@ -108,11 +108,11 @@ public static ArgHandler instance() { return INSTANCE; } - public R result() { + @Override public R result() { return null; } - public R visitChild( + @Override public R visitChild( SqlVisitor visitor, SqlNode expr, int i, diff --git a/core/src/main/java/org/apache/calcite/sql/util/SqlShuttle.java b/core/src/main/java/org/apache/calcite/sql/util/SqlShuttle.java index f9352e54ce3..a38d1b635e7 100644 --- a/core/src/main/java/org/apache/calcite/sql/util/SqlShuttle.java +++ b/core/src/main/java/org/apache/calcite/sql/util/SqlShuttle.java @@ -39,27 +39,27 @@ public class SqlShuttle extends SqlBasicVisitor { //~ Methods ---------------------------------------------------------------- - public SqlNode visit(SqlLiteral literal) { + @Override public SqlNode visit(SqlLiteral literal) { return literal; } - public SqlNode visit(SqlIdentifier id) { + @Override public SqlNode visit(SqlIdentifier id) { return id; } - public SqlNode visit(SqlDataTypeSpec type) { + @Override public SqlNode visit(SqlDataTypeSpec type) { return type; } - public SqlNode visit(SqlDynamicParam param) { + @Override public SqlNode visit(SqlDynamicParam param) { return param; } - public SqlNode visit(SqlIntervalQualifier intervalQualifier) { + @Override public SqlNode visit(SqlIntervalQualifier intervalQualifier) { return intervalQualifier; } - public SqlNode visit(final SqlCall call) { + @Override public SqlNode visit(final SqlCall call) { // Handler creates a new copy of 'call' only if one or more operands // change. ArgHandler argHandler = new CallCopyingArgHandler(call, false); @@ -67,7 +67,7 @@ public SqlNode visit(final SqlCall call) { return argHandler.result(); } - public SqlNode visit(SqlNodeList nodeList) { + @Override public SqlNode visit(SqlNodeList nodeList) { boolean update = false; List exprs = nodeList.getList(); int exprCount = exprs.size(); @@ -112,7 +112,7 @@ public CallCopyingArgHandler(SqlCall call, boolean alwaysCopy) { this.alwaysCopy = alwaysCopy; } - public SqlNode result() { + @Override public SqlNode result() { if (update || alwaysCopy) { return call.getOperator().createCall( call.getFunctionQuantifier(), @@ -123,7 +123,7 @@ public SqlNode result() { } } - public SqlNode visitChild( + @Override public SqlNode visitChild( SqlVisitor visitor, SqlNode expr, int i, diff --git a/core/src/main/java/org/apache/calcite/sql/validate/AbstractNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/AbstractNamespace.java index 7a2a85b5af4..5b8d5c989c5 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/AbstractNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/AbstractNamespace.java @@ -70,11 +70,11 @@ abstract class AbstractNamespace implements SqlValidatorNamespace { //~ Methods ---------------------------------------------------------------- - public SqlValidator getValidator() { + @Override public SqlValidator getValidator() { return validator; } - public final void validate(RelDataType targetRowType) { + @Override public final void validate(RelDataType targetRowType) { switch (status) { case UNVALIDATED: try { @@ -110,7 +110,7 @@ public final void validate(RelDataType targetRowType) { */ protected abstract RelDataType validateImpl(RelDataType targetRowType); - public RelDataType getRowType() { + @Override public RelDataType getRowType() { if (rowType == null) { validator.validateNamespace(this, validator.unknownType); Preconditions.checkArgument(rowType != null, "validate must set rowType"); @@ -118,68 +118,68 @@ public RelDataType getRowType() { return rowType; } - public RelDataType getRowTypeSansSystemColumns() { + @Override public RelDataType getRowTypeSansSystemColumns() { return getRowType(); } - public RelDataType getType() { + @Override public RelDataType getType() { Util.discard(getRowType()); return type; } - public void setType(RelDataType type) { + @Override public void setType(RelDataType type) { this.type = type; this.rowType = convertToStruct(type); } - public SqlNode getEnclosingNode() { + @Override public SqlNode getEnclosingNode() { return enclosingNode; } - public SqlValidatorTable getTable() { + @Override public SqlValidatorTable getTable() { return null; } - public SqlValidatorNamespace lookupChild(String name) { + @Override public SqlValidatorNamespace lookupChild(String name) { return validator.lookupFieldNamespace( getRowType(), name); } - public boolean fieldExists(String name) { + @Override public boolean fieldExists(String name) { final RelDataType rowType = getRowType(); return validator.catalogReader.nameMatcher().field(rowType, name) != null; } - public List> getMonotonicExprs() { + @Override public List> getMonotonicExprs() { return ImmutableList.of(); } - public SqlMonotonicity getMonotonicity(String columnName) { + @Override public SqlMonotonicity getMonotonicity(String columnName) { return SqlMonotonicity.NOT_MONOTONIC; } @SuppressWarnings("deprecation") - public void makeNullable() { + @Override public void makeNullable() { } public String translate(String name) { return name; } - public SqlValidatorNamespace resolve() { + @Override public SqlValidatorNamespace resolve() { return this; } - public boolean supportsModality(SqlModality modality) { + @Override public boolean supportsModality(SqlModality modality) { return true; } - public T unwrap(Class clazz) { + @Override public T unwrap(Class clazz) { return clazz.cast(this); } - public boolean isWrapperFor(Class clazz) { + @Override public boolean isWrapperFor(Class clazz) { return clazz.isInstance(this); } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/AggChecker.java b/core/src/main/java/org/apache/calcite/sql/validate/AggChecker.java index b0e901a70f6..7f7c9aa51a6 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/AggChecker.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/AggChecker.java @@ -88,7 +88,7 @@ boolean isGroupExpr(SqlNode expr) { return false; } - public Void visit(SqlIdentifier id) { + @Override public Void visit(SqlIdentifier id) { if (isGroupExpr(id) || id.isStar()) { // Star may validly occur in "SELECT COUNT(*) OVER w" return null; @@ -116,7 +116,7 @@ public Void visit(SqlIdentifier id) { : RESOURCE.notGroupExpr(exprString)); } - public Void visit(SqlCall call) { + @Override public Void visit(SqlCall call) { final SqlValidatorScope scope = scopes.peek(); if (call.getOperator().isAggregator()) { if (distinct) { diff --git a/core/src/main/java/org/apache/calcite/sql/validate/AggFinder.java b/core/src/main/java/org/apache/calcite/sql/validate/AggFinder.java index 4dc9fabe7a6..3a4ca99e014 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/AggFinder.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/AggFinder.java @@ -76,7 +76,7 @@ public SqlCall findAgg(List nodes) { } } - protected Void found(SqlCall call) { + @Override protected Void found(SqlCall call) { throw new Util.FoundOne(call); } @@ -105,7 +105,7 @@ static class AggIterable extends AggVisitor implements Iterable { return null; } - @Nonnull public Iterator iterator() { + @Override @Nonnull public Iterator iterator() { return calls.iterator(); } } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/AggVisitor.java b/core/src/main/java/org/apache/calcite/sql/validate/AggVisitor.java index 3f63e346759..ab8c5d91597 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/AggVisitor.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/AggVisitor.java @@ -67,7 +67,7 @@ abstract class AggVisitor extends SqlBasicVisitor { this.nameMatcher = Objects.requireNonNull(nameMatcher); } - public Void visit(SqlCall call) { + @Override public Void visit(SqlCall call) { final SqlOperator operator = call.getOperator(); // If nested aggregates disallowed or found an aggregate at invalid level if (operator.isAggregator() diff --git a/core/src/main/java/org/apache/calcite/sql/validate/AggregatingSelectScope.java b/core/src/main/java/org/apache/calcite/sql/validate/AggregatingSelectScope.java index 279772d523a..2e4e3597ad4 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/AggregatingSelectScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/AggregatingSelectScope.java @@ -151,7 +151,7 @@ private Pair, ImmutableList> getGroupExprs() { } } - public SqlNode getNode() { + @Override public SqlNode getNode() { return select; } @@ -168,7 +168,7 @@ public SqlNode getNode() { return type; } - public SqlValidatorScope getOperandScope(SqlCall call) { + @Override public SqlValidatorScope getOperandScope(SqlCall call) { if (call.getOperator().isAggregator()) { // If we're the 'SUM' node in 'select a + sum(b + c) from t // group by a', then we should validate our arguments in @@ -195,7 +195,7 @@ public SqlValidatorScope getOperandScope(SqlCall call) { return super.getOperandScope(call); } - public boolean checkAggregateExpr(SqlNode expr, boolean deep) { + @Override public boolean checkAggregateExpr(SqlNode expr, boolean deep) { // Fully-qualify any identifiers in expr. if (deep) { expr = validator.expand(expr, this); @@ -214,7 +214,7 @@ public boolean checkAggregateExpr(SqlNode expr, boolean deep) { return aggChecker.isGroupExpr(expr); } - public void validateExpr(SqlNode expr) { + @Override public void validateExpr(SqlNode expr) { checkAggregateExpr(expr, true); } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/AliasNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/AliasNamespace.java index 4abd72edbf8..38222d7d1ba 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/AliasNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/AliasNamespace.java @@ -64,7 +64,7 @@ protected AliasNamespace( //~ Methods ---------------------------------------------------------------- - protected RelDataType validateImpl(RelDataType targetRowType) { + @Override protected RelDataType validateImpl(RelDataType targetRowType) { final List nameList = new ArrayList<>(); final List operands = call.getOperandList(); final SqlValidatorNamespace childNs = @@ -121,11 +121,11 @@ private String getString(RelDataType rowType) { return buf.toString(); } - public SqlNode getNode() { + @Override public SqlNode getNode() { return call; } - public String translate(String name) { + @Override public String translate(String name) { final RelDataType underlyingRowType = validator.getValidatedNodeType(call.operand(0)); int i = 0; diff --git a/core/src/main/java/org/apache/calcite/sql/validate/CatalogScope.java b/core/src/main/java/org/apache/calcite/sql/validate/CatalogScope.java index 3bf59341fa4..3a8bfe27725 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/CatalogScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/CatalogScope.java @@ -46,7 +46,7 @@ class CatalogScope extends DelegatingScope { //~ Methods ---------------------------------------------------------------- - public SqlNode getNode() { + @Override public SqlNode getNode() { throw new UnsupportedOperationException(); } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/CollectNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/CollectNamespace.java index 1d48e87862b..ce6b6edbb76 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/CollectNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/CollectNamespace.java @@ -64,11 +64,11 @@ public class CollectNamespace extends AbstractNamespace { //~ Methods ---------------------------------------------------------------- - protected RelDataType validateImpl(RelDataType targetRowType) { + @Override protected RelDataType validateImpl(RelDataType targetRowType) { return child.getOperator().deriveType(validator, scope, child); } - public SqlNode getNode() { + @Override public SqlNode getNode() { return child; } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/CollectScope.java b/core/src/main/java/org/apache/calcite/sql/validate/CollectScope.java index 6dc60edaf95..2e3a2975af1 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/CollectScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/CollectScope.java @@ -45,7 +45,7 @@ class CollectScope extends ListScope { //~ Methods ---------------------------------------------------------------- - public SqlNode getNode() { + @Override public SqlNode getNode() { return child; } } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/DelegatingNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/DelegatingNamespace.java index 4b00eef4834..b7b5f608147 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/DelegatingNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/DelegatingNamespace.java @@ -44,64 +44,64 @@ protected DelegatingNamespace(SqlValidatorNamespace namespace) { //~ Methods ---------------------------------------------------------------- - public SqlValidator getValidator() { + @Override public SqlValidator getValidator() { return namespace.getValidator(); } - public SqlValidatorTable getTable() { + @Override public SqlValidatorTable getTable() { return namespace.getTable(); } - public RelDataType getRowType() { + @Override public RelDataType getRowType() { return namespace.getRowType(); } - public void setType(RelDataType type) { + @Override public void setType(RelDataType type) { namespace.setType(type); } - public RelDataType getRowTypeSansSystemColumns() { + @Override public RelDataType getRowTypeSansSystemColumns() { return namespace.getRowTypeSansSystemColumns(); } - public RelDataType getType() { + @Override public RelDataType getType() { return namespace.getType(); } - public void validate(RelDataType targetRowType) { + @Override public void validate(RelDataType targetRowType) { namespace.validate(targetRowType); } - public SqlNode getNode() { + @Override public SqlNode getNode() { return namespace.getNode(); } - public SqlNode getEnclosingNode() { + @Override public SqlNode getEnclosingNode() { return namespace.getEnclosingNode(); } - public SqlValidatorNamespace lookupChild( + @Override public SqlValidatorNamespace lookupChild( String name) { return namespace.lookupChild(name); } - public boolean fieldExists(String name) { + @Override public boolean fieldExists(String name) { return namespace.fieldExists(name); } - public List> getMonotonicExprs() { + @Override public List> getMonotonicExprs() { return namespace.getMonotonicExprs(); } - public SqlMonotonicity getMonotonicity(String columnName) { + @Override public SqlMonotonicity getMonotonicity(String columnName) { return namespace.getMonotonicity(columnName); } @SuppressWarnings("deprecation") - public void makeNullable() { + @Override public void makeNullable() { } - public T unwrap(Class clazz) { + @Override public T unwrap(Class clazz) { if (clazz.isInstance(this)) { return clazz.cast(this); } else { @@ -109,7 +109,7 @@ public T unwrap(Class clazz) { } } - public boolean isWrapperFor(Class clazz) { + @Override public boolean isWrapperFor(Class clazz) { return clazz.isInstance(this) || namespace.isWrapperFor(clazz); } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/DelegatingScope.java b/core/src/main/java/org/apache/calcite/sql/validate/DelegatingScope.java index a630a926507..ae746b83dce 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/DelegatingScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/DelegatingScope.java @@ -84,7 +84,7 @@ public abstract class DelegatingScope implements SqlValidatorScope { throw new UnsupportedOperationException(); } - public void resolve(List names, SqlNameMatcher nameMatcher, + @Override public void resolve(List names, SqlNameMatcher nameMatcher, boolean deep, Resolved resolved) { parent.resolve(names, nameMatcher, deep, resolved); } @@ -165,52 +165,52 @@ protected void addColumnNames( } } - public void findAllColumnNames(List result) { + @Override public void findAllColumnNames(List result) { parent.findAllColumnNames(result); } - public void findAliases(Collection result) { + @Override public void findAliases(Collection result) { parent.findAliases(result); } @SuppressWarnings("deprecation") - public Pair findQualifyingTableName( + @Override public Pair findQualifyingTableName( String columnName, SqlNode ctx) { //noinspection deprecation return parent.findQualifyingTableName(columnName, ctx); } - public Map findQualifyingTableNames(String columnName, + @Override public Map findQualifyingTableNames(String columnName, SqlNode ctx, SqlNameMatcher nameMatcher) { return parent.findQualifyingTableNames(columnName, ctx, nameMatcher); } - public RelDataType resolveColumn(String name, SqlNode ctx) { + @Override public RelDataType resolveColumn(String name, SqlNode ctx) { return parent.resolveColumn(name, ctx); } - public RelDataType nullifyType(SqlNode node, RelDataType type) { + @Override public RelDataType nullifyType(SqlNode node, RelDataType type) { return parent.nullifyType(node, type); } - @SuppressWarnings("deprecation") + @Override @SuppressWarnings("deprecation") public SqlValidatorNamespace getTableNamespace(List names) { return parent.getTableNamespace(names); } - public void resolveTable(List names, SqlNameMatcher nameMatcher, + @Override public void resolveTable(List names, SqlNameMatcher nameMatcher, Path path, Resolved resolved) { parent.resolveTable(names, nameMatcher, path, resolved); } - public SqlValidatorScope getOperandScope(SqlCall call) { + @Override public SqlValidatorScope getOperandScope(SqlCall call) { if (call instanceof SqlSelect) { return validator.getSelectScope((SqlSelect) call); } return this; } - public SqlValidator getValidator() { + @Override public SqlValidator getValidator() { return validator; } @@ -221,7 +221,7 @@ public SqlValidator getValidator() { * *

If the identifier cannot be resolved, throws. Never returns null. */ - public SqlQualified fullyQualify(SqlIdentifier identifier) { + @Override public SqlQualified fullyQualify(SqlIdentifier identifier) { if (identifier.isStar()) { return SqlQualified.create(this, 1, null, identifier); } @@ -444,7 +444,7 @@ public SqlQualified fullyQualify(SqlIdentifier identifier) { default: final Comparator c = new Comparator() { - public int compare(Resolve o1, Resolve o2) { + @Override public int compare(Resolve o1, Resolve o2) { // Name resolution that uses fewer implicit steps wins. int c = Integer.compare(worstKind(o1.path), worstKind(o2.path)); if (c != 0) { @@ -525,20 +525,20 @@ private int worstKind(Path path) { } } - public void validateExpr(SqlNode expr) { + @Override public void validateExpr(SqlNode expr) { // Do not delegate to parent. An expression valid in this scope may not // be valid in the parent scope. } - public SqlWindow lookupWindow(String name) { + @Override public SqlWindow lookupWindow(String name) { return parent.lookupWindow(name); } - public SqlMonotonicity getMonotonicity(SqlNode expr) { + @Override public SqlMonotonicity getMonotonicity(SqlNode expr) { return parent.getMonotonicity(expr); } - public SqlNodeList getOrderList() { + @Override public SqlNodeList getOrderList() { return parent.getOrderList(); } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/DelegatingSqlValidatorCatalogReader.java b/core/src/main/java/org/apache/calcite/sql/validate/DelegatingSqlValidatorCatalogReader.java index 0aff0f064b3..4c398cbb964 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/DelegatingSqlValidatorCatalogReader.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/DelegatingSqlValidatorCatalogReader.java @@ -40,19 +40,19 @@ public DelegatingSqlValidatorCatalogReader( this.catalogReader = catalogReader; } - public SqlValidatorTable getTable(List names) { + @Override public SqlValidatorTable getTable(List names) { return catalogReader.getTable(names); } - public RelDataType getNamedType(SqlIdentifier typeName) { + @Override public RelDataType getNamedType(SqlIdentifier typeName) { return catalogReader.getNamedType(typeName); } - public List getAllSchemaObjectNames(List names) { + @Override public List getAllSchemaObjectNames(List names) { return catalogReader.getAllSchemaObjectNames(names); } - public List> getSchemaPaths() { + @Override public List> getSchemaPaths() { return catalogReader.getSchemaPaths(); } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/DelegatingSqlValidatorTable.java b/core/src/main/java/org/apache/calcite/sql/validate/DelegatingSqlValidatorTable.java index 6527c7bb567..c9c62174a54 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/DelegatingSqlValidatorTable.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/DelegatingSqlValidatorTable.java @@ -37,19 +37,19 @@ public DelegatingSqlValidatorTable(SqlValidatorTable table) { this.table = table; } - public RelDataType getRowType() { + @Override public RelDataType getRowType() { return table.getRowType(); } - public List getQualifiedName() { + @Override public List getQualifiedName() { return table.getQualifiedName(); } - public SqlMonotonicity getMonotonicity(String columnName) { + @Override public SqlMonotonicity getMonotonicity(String columnName) { return table.getMonotonicity(columnName); } - public SqlAccessType getAllowedAccess() { + @Override public SqlAccessType getAllowedAccess() { return table.getAllowedAccess(); } } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/EmptyScope.java b/core/src/main/java/org/apache/calcite/sql/validate/EmptyScope.java index 42636d54aa6..dde9205e678 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/EmptyScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/EmptyScope.java @@ -65,23 +65,23 @@ class EmptyScope implements SqlValidatorScope { //~ Methods ---------------------------------------------------------------- - public SqlValidator getValidator() { + @Override public SqlValidator getValidator() { return validator; } - public SqlQualified fullyQualify(SqlIdentifier identifier) { + @Override public SqlQualified fullyQualify(SqlIdentifier identifier) { return SqlQualified.create(this, 1, null, identifier); } - public SqlNode getNode() { + @Override public SqlNode getNode() { throw new UnsupportedOperationException(); } - public void resolve(List names, SqlNameMatcher nameMatcher, + @Override public void resolve(List names, SqlNameMatcher nameMatcher, boolean deep, Resolved resolved) { } - @SuppressWarnings("deprecation") + @Override @SuppressWarnings("deprecation") public SqlValidatorNamespace getTableNamespace(List names) { SqlValidatorTable table = validator.catalogReader.getTable(names); return table != null @@ -89,7 +89,7 @@ public SqlValidatorNamespace getTableNamespace(List names) { : null; } - public void resolveTable(List names, SqlNameMatcher nameMatcher, + @Override public void resolveTable(List names, SqlNameMatcher nameMatcher, Path path, Resolved resolved) { final List imperfectResolves = new ArrayList<>(); final List resolves = ((ResolvedImpl) resolved).resolves; @@ -172,55 +172,55 @@ private void resolve_(final CalciteSchema rootSchema, List names, } } - public RelDataType nullifyType(SqlNode node, RelDataType type) { + @Override public RelDataType nullifyType(SqlNode node, RelDataType type) { return type; } - public void findAllColumnNames(List result) { + @Override public void findAllColumnNames(List result) { } public void findAllTableNames(List result) { } - public void findAliases(Collection result) { + @Override public void findAliases(Collection result) { } - public RelDataType resolveColumn(String name, SqlNode ctx) { + @Override public RelDataType resolveColumn(String name, SqlNode ctx) { return null; } - public SqlValidatorScope getOperandScope(SqlCall call) { + @Override public SqlValidatorScope getOperandScope(SqlCall call) { return this; } - public void validateExpr(SqlNode expr) { + @Override public void validateExpr(SqlNode expr) { // valid } @SuppressWarnings("deprecation") - public Pair findQualifyingTableName( + @Override public Pair findQualifyingTableName( String columnName, SqlNode ctx) { throw validator.newValidationError(ctx, RESOURCE.columnNotFound(columnName)); } - public Map findQualifyingTableNames(String columnName, + @Override public Map findQualifyingTableNames(String columnName, SqlNode ctx, SqlNameMatcher nameMatcher) { return ImmutableMap.of(); } - public void addChild(SqlValidatorNamespace ns, String alias, + @Override public void addChild(SqlValidatorNamespace ns, String alias, boolean nullable) { // cannot add to the empty scope throw new UnsupportedOperationException(); } - public SqlWindow lookupWindow(String name) { + @Override public SqlWindow lookupWindow(String name) { // No windows defined in this scope. return null; } - public SqlMonotonicity getMonotonicity(SqlNode expr) { + @Override public SqlMonotonicity getMonotonicity(SqlNode expr) { return ((expr instanceof SqlLiteral) || (expr instanceof SqlDynamicParam) @@ -228,7 +228,7 @@ public SqlMonotonicity getMonotonicity(SqlNode expr) { : SqlMonotonicity.NOT_MONOTONIC; } - public SqlNodeList getOrderList() { + @Override public SqlNodeList getOrderList() { // scope is not ordered return null; } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/FieldNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/FieldNamespace.java index 74c87de59c6..a60f629ac75 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/FieldNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/FieldNamespace.java @@ -45,19 +45,19 @@ class FieldNamespace extends AbstractNamespace { //~ Methods ---------------------------------------------------------------- - public void setType(RelDataType type) { + @Override public void setType(RelDataType type) { throw new UnsupportedOperationException(); } - protected RelDataType validateImpl(RelDataType targetRowType) { + @Override protected RelDataType validateImpl(RelDataType targetRowType) { return rowType; } - public SqlNode getNode() { + @Override public SqlNode getNode() { return null; } - public SqlValidatorNamespace lookupChild(String name) { + @Override public SqlValidatorNamespace lookupChild(String name) { if (rowType.isStruct()) { return validator.lookupFieldNamespace( rowType, @@ -66,7 +66,7 @@ public SqlValidatorNamespace lookupChild(String name) { return null; } - public boolean fieldExists(String name) { + @Override public boolean fieldExists(String name) { return false; } } 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 1f43086cda9..d7c5d208094 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 @@ -51,11 +51,11 @@ public class GroupByScope extends DelegatingScope { //~ Methods ---------------------------------------------------------------- - public SqlNode getNode() { + @Override public SqlNode getNode() { return groupByList; } - public void validateExpr(SqlNode expr) { + @Override public void validateExpr(SqlNode expr) { SqlNode expanded = validator.expandGroupByOrHavingExpr(expr, this, select, false); // expression needs to be valid in parent scope too diff --git a/core/src/main/java/org/apache/calcite/sql/validate/IdentifierNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/IdentifierNamespace.java index 8da8756c6f1..f37cc5adf55 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/IdentifierNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/IdentifierNamespace.java @@ -180,7 +180,7 @@ private SqlValidatorNamespace resolveImpl(SqlIdentifier id) { RESOURCE.objectNotFound(id.getComponent(0).toString())); } - public RelDataType validateImpl(RelDataType targetRowType) { + @Override public RelDataType validateImpl(RelDataType targetRowType) { resolvedNamespace = Objects.requireNonNull(resolveImpl(id)); if (resolvedNamespace instanceof TableNamespace) { SqlValidatorTable table = resolvedNamespace.getTable(); @@ -244,7 +244,7 @@ public SqlIdentifier getId() { return id; } - public SqlNode getNode() { + @Override public SqlNode getNode() { return id; } @@ -257,7 +257,7 @@ public SqlNode getNode() { return resolvedNamespace == null ? null : resolve().getTable(); } - public List> getMonotonicExprs() { + @Override public List> getMonotonicExprs() { return monotonicExprs; } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/JoinNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/JoinNamespace.java index 2197a40e770..2bb9989bcf7 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/JoinNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/JoinNamespace.java @@ -38,7 +38,7 @@ class JoinNamespace extends AbstractNamespace { //~ Methods ---------------------------------------------------------------- - protected RelDataType validateImpl(RelDataType targetRowType) { + @Override protected RelDataType validateImpl(RelDataType targetRowType) { RelDataType leftType = validator.getNamespace(join.getLeft()).getRowType(); RelDataType rightType = @@ -59,7 +59,7 @@ protected RelDataType validateImpl(RelDataType targetRowType) { return typeFactory.createJoinType(leftType, rightType); } - public SqlNode getNode() { + @Override public SqlNode getNode() { return join; } } 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 406ffb2c97a..6cdd48afb0a 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 @@ -55,11 +55,11 @@ public class JoinScope extends ListScope { //~ Methods ---------------------------------------------------------------- - public SqlNode getNode() { + @Override public SqlNode getNode() { return join; } - public void addChild(SqlValidatorNamespace ns, String alias, + @Override public void addChild(SqlValidatorNamespace ns, String alias, boolean nullable) { super.addChild(ns, alias, nullable); if ((usingScope != null) && (usingScope != parent)) { @@ -77,7 +77,7 @@ public void addChild(SqlValidatorNamespace ns, String alias, } } - public SqlWindow lookupWindow(String name) { + @Override public SqlWindow lookupWindow(String name) { // Lookup window in enclosing select. if (usingScope != null) { return usingScope.lookupWindow(name); diff --git a/core/src/main/java/org/apache/calcite/sql/validate/ListScope.java b/core/src/main/java/org/apache/calcite/sql/validate/ListScope.java index 3ac85111a53..6354b4875ac 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/ListScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/ListScope.java @@ -112,14 +112,14 @@ private ScopeChild findChild(List names, return null; } - public void findAllColumnNames(List result) { + @Override public void findAllColumnNames(List result) { for (ScopeChild child : children) { addColumnNames(child.namespace, result); } parent.findAllColumnNames(result); } - public void findAliases(Collection result) { + @Override public void findAliases(Collection result) { for (ScopeChild child : children) { result.add(new SqlMonikerImpl(child.name, SqlMonikerType.TABLE)); } @@ -200,7 +200,7 @@ public void findAliases(Collection result) { super.resolve(names, nameMatcher, deep, resolved); } - public RelDataType resolveColumn(String columnName, SqlNode ctx) { + @Override public RelDataType resolveColumn(String columnName, SqlNode ctx) { final SqlNameMatcher nameMatcher = validator.catalogReader.nameMatcher(); int found = 0; RelDataType type = null; 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 222fd0effc2..c1288019a53 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 @@ -58,16 +58,16 @@ public class OrderByScope extends DelegatingScope { //~ Methods ---------------------------------------------------------------- - public SqlNode getNode() { + @Override public SqlNode getNode() { return orderList; } - public void findAllColumnNames(List result) { + @Override public void findAllColumnNames(List result) { final SqlValidatorNamespace ns = validator.getNamespace(select); addColumnNames(ns, result); } - public SqlQualified fullyQualify(SqlIdentifier identifier) { + @Override public SqlQualified fullyQualify(SqlIdentifier identifier) { // If it's a simple identifier, look for an alias. if (identifier.isSimple() && validator.config().sqlConformance().isSortByAlias()) { @@ -106,7 +106,7 @@ private int aliasCount(SqlNameMatcher nameMatcher, String name) { return n; } - public RelDataType resolveColumn(String name, SqlNode ctx) { + @Override public RelDataType resolveColumn(String name, SqlNode ctx) { final SqlValidatorNamespace selectNs = validator.getNamespace(select); final RelDataType rowType = selectNs.getRowType(); final SqlNameMatcher nameMatcher = validator.catalogReader.nameMatcher(); @@ -118,7 +118,7 @@ public RelDataType resolveColumn(String name, SqlNode ctx) { return selectScope.resolveColumn(name, ctx); } - public void validateExpr(SqlNode expr) { + @Override public void validateExpr(SqlNode expr) { SqlNode expanded = validator.expandOrderExpr(select, expr); // expression needs to be valid in parent scope too 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 b1350e76786..25bad3b3155 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 @@ -64,11 +64,11 @@ public class OverScope extends ListScope { //~ Methods ---------------------------------------------------------------- - public SqlNode getNode() { + @Override public SqlNode getNode() { return overCall; } - public SqlMonotonicity getMonotonicity(SqlNode expr) { + @Override public SqlMonotonicity getMonotonicity(SqlNode expr) { SqlMonotonicity monotonicity = expr.getMonotonicity(this); if (monotonicity != SqlMonotonicity.NOT_MONOTONIC) { return monotonicity; diff --git a/core/src/main/java/org/apache/calcite/sql/validate/ParameterNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/ParameterNamespace.java index de21ac843f6..b57fdf85cb1 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/ParameterNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/ParameterNamespace.java @@ -38,15 +38,15 @@ class ParameterNamespace extends AbstractNamespace { //~ Methods ---------------------------------------------------------------- - public SqlNode getNode() { + @Override public SqlNode getNode() { return null; } - public RelDataType validateImpl(RelDataType targetRowType) { + @Override public RelDataType validateImpl(RelDataType targetRowType) { return type; } - public RelDataType getRowType() { + @Override public RelDataType getRowType() { return type; } } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/ParameterScope.java b/core/src/main/java/org/apache/calcite/sql/validate/ParameterScope.java index 66bbba7ea22..e5ff5cae062 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/ParameterScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/ParameterScope.java @@ -49,11 +49,11 @@ public ParameterScope( //~ Methods ---------------------------------------------------------------- - public SqlQualified fullyQualify(SqlIdentifier identifier) { + @Override public SqlQualified fullyQualify(SqlIdentifier identifier) { return SqlQualified.create(this, 1, null, identifier); } - public SqlValidatorScope getOperandScope(SqlCall call) { + @Override public SqlValidatorScope getOperandScope(SqlCall call) { return this; } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/ProcedureNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/ProcedureNamespace.java index c4ffb6de14f..25ed7058660 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/ProcedureNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/ProcedureNamespace.java @@ -50,7 +50,7 @@ public class ProcedureNamespace extends AbstractNamespace { //~ Methods ---------------------------------------------------------------- - public RelDataType validateImpl(RelDataType targetRowType) { + @Override public RelDataType validateImpl(RelDataType targetRowType) { validator.inferUnknownTypes(validator.unknownType, scope, call); final RelDataType type = validator.deriveTypeImpl(scope, call); final SqlOperator operator = call.getOperator(); @@ -70,7 +70,7 @@ public RelDataType validateImpl(RelDataType targetRowType) { return rowTypeInference.inferReturnType(callBinding); } - public SqlNode getNode() { + @Override public SqlNode getNode() { return call; } } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SchemaNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/SchemaNamespace.java index a73ee494771..1f9c98fae99 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SchemaNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SchemaNamespace.java @@ -40,7 +40,7 @@ class SchemaNamespace extends AbstractNamespace { this.names = Objects.requireNonNull(names); } - protected RelDataType validateImpl(RelDataType targetRowType) { + @Override protected RelDataType validateImpl(RelDataType targetRowType) { final RelDataTypeFactory.Builder builder = validator.getTypeFactory().builder(); for (SqlMoniker moniker @@ -52,7 +52,7 @@ protected RelDataType validateImpl(RelDataType targetRowType) { return builder.build(); } - public SqlNode getNode() { + @Override public SqlNode getNode() { return null; } } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SelectNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/SelectNamespace.java index 5f05946f9d4..6dd4f69d725 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SelectNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SelectNamespace.java @@ -56,7 +56,7 @@ public SelectNamespace( return select; } - public RelDataType validateImpl(RelDataType targetRowType) { + @Override public RelDataType validateImpl(RelDataType targetRowType) { validator.validateSelect(select, targetRowType); return rowType; } @@ -65,7 +65,7 @@ public RelDataType validateImpl(RelDataType targetRowType) { return validator.validateModality(select, modality, false); } - public SqlMonotonicity getMonotonicity(String columnName) { + @Override public SqlMonotonicity getMonotonicity(String columnName) { final RelDataType rowType = this.getRowTypeSansSystemColumns(); final int field = SqlTypeUtil.findField(rowType, columnName); final SqlNode selectItem = 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 2649d59e918..d118db12d41 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 @@ -126,11 +126,11 @@ public SqlValidatorTable getTable() { return null; } - public SqlSelect getNode() { + @Override public SqlSelect getNode() { return select; } - public SqlWindow lookupWindow(String name) { + @Override public SqlWindow lookupWindow(String name) { final SqlNodeList windowList = select.getWindowList(); for (int i = 0; i < windowList.size(); i++) { SqlWindow window = (SqlWindow) windowList.get(i); @@ -149,7 +149,7 @@ public SqlWindow lookupWindow(String name) { } } - public SqlMonotonicity getMonotonicity(SqlNode expr) { + @Override public SqlMonotonicity getMonotonicity(SqlNode expr) { SqlMonotonicity monotonicity = expr.getMonotonicity(this); if (monotonicity != SqlMonotonicity.NOT_MONOTONIC) { return monotonicity; @@ -174,7 +174,7 @@ public SqlMonotonicity getMonotonicity(SqlNode expr) { return SqlMonotonicity.NOT_MONOTONIC; } - public SqlNodeList getOrderList() { + @Override public SqlNodeList getOrderList() { if (orderList == null) { // Compute on demand first call. orderList = new SqlNodeList(SqlParserPos.ZERO); diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SetopNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/SetopNamespace.java index cb444b789d4..5dac9b082bd 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SetopNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SetopNamespace.java @@ -50,7 +50,7 @@ protected SetopNamespace( //~ Methods ---------------------------------------------------------------- - public SqlNode getNode() { + @Override public SqlNode getNode() { return call; } @@ -88,7 +88,7 @@ private SqlMonotonicity combine(SqlMonotonicity m0, SqlMonotonicity m1) { return SqlMonotonicity.NOT_MONOTONIC; } - public RelDataType validateImpl(RelDataType targetRowType) { + @Override public RelDataType validateImpl(RelDataType targetRowType) { switch (call.getKind()) { case UNION: case INTERSECT: diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlAbstractConformance.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlAbstractConformance.java index f49fe67c542..11c7691ef1c 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlAbstractConformance.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlAbstractConformance.java @@ -23,107 +23,107 @@ * and behaves the same as in {@link SqlConformanceEnum#DEFAULT}. */ public abstract class SqlAbstractConformance implements SqlConformance { - public boolean isLiberal() { + @Override public boolean isLiberal() { return SqlConformanceEnum.DEFAULT.isLiberal(); } - public boolean allowCharLiteralAlias() { + @Override public boolean allowCharLiteralAlias() { return SqlConformanceEnum.DEFAULT.allowCharLiteralAlias(); } - public boolean isGroupByAlias() { + @Override public boolean isGroupByAlias() { return SqlConformanceEnum.DEFAULT.isGroupByAlias(); } - public boolean isGroupByOrdinal() { + @Override public boolean isGroupByOrdinal() { return SqlConformanceEnum.DEFAULT.isGroupByOrdinal(); } - public boolean isHavingAlias() { + @Override public boolean isHavingAlias() { return SqlConformanceEnum.DEFAULT.isHavingAlias(); } - public boolean isSortByOrdinal() { + @Override public boolean isSortByOrdinal() { return SqlConformanceEnum.DEFAULT.isSortByOrdinal(); } - public boolean isSortByAlias() { + @Override public boolean isSortByAlias() { return SqlConformanceEnum.DEFAULT.isSortByAlias(); } - public boolean isSortByAliasObscures() { + @Override public boolean isSortByAliasObscures() { return SqlConformanceEnum.DEFAULT.isSortByAliasObscures(); } - public boolean isFromRequired() { + @Override public boolean isFromRequired() { return SqlConformanceEnum.DEFAULT.isFromRequired(); } - public boolean splitQuotedTableName() { + @Override public boolean splitQuotedTableName() { return SqlConformanceEnum.DEFAULT.splitQuotedTableName(); } - public boolean allowHyphenInUnquotedTableName() { + @Override public boolean allowHyphenInUnquotedTableName() { return SqlConformanceEnum.DEFAULT.allowHyphenInUnquotedTableName(); } - public boolean isBangEqualAllowed() { + @Override public boolean isBangEqualAllowed() { return SqlConformanceEnum.DEFAULT.isBangEqualAllowed(); } - public boolean isMinusAllowed() { + @Override public boolean isMinusAllowed() { return SqlConformanceEnum.DEFAULT.isMinusAllowed(); } - public boolean isApplyAllowed() { + @Override public boolean isApplyAllowed() { return SqlConformanceEnum.DEFAULT.isApplyAllowed(); } - public boolean isInsertSubsetColumnsAllowed() { + @Override public boolean isInsertSubsetColumnsAllowed() { return SqlConformanceEnum.DEFAULT.isInsertSubsetColumnsAllowed(); } - public boolean allowNiladicParentheses() { + @Override public boolean allowNiladicParentheses() { return SqlConformanceEnum.DEFAULT.allowNiladicParentheses(); } - public boolean allowExplicitRowValueConstructor() { + @Override public boolean allowExplicitRowValueConstructor() { return SqlConformanceEnum.DEFAULT.allowExplicitRowValueConstructor(); } - public boolean allowExtend() { + @Override public boolean allowExtend() { return SqlConformanceEnum.DEFAULT.allowExtend(); } - public boolean isLimitStartCountAllowed() { + @Override public boolean isLimitStartCountAllowed() { return SqlConformanceEnum.DEFAULT.isLimitStartCountAllowed(); } - public boolean isPercentRemainderAllowed() { + @Override public boolean isPercentRemainderAllowed() { return SqlConformanceEnum.DEFAULT.isPercentRemainderAllowed(); } - public boolean allowGeometry() { + @Override public boolean allowGeometry() { return SqlConformanceEnum.DEFAULT.allowGeometry(); } - public boolean shouldConvertRaggedUnionTypesToVarying() { + @Override public boolean shouldConvertRaggedUnionTypesToVarying() { return SqlConformanceEnum.DEFAULT.shouldConvertRaggedUnionTypesToVarying(); } - public boolean allowExtendedTrim() { + @Override public boolean allowExtendedTrim() { return SqlConformanceEnum.DEFAULT.allowExtendedTrim(); } - public boolean allowPluralTimeUnits() { + @Override public boolean allowPluralTimeUnits() { return SqlConformanceEnum.DEFAULT.allowPluralTimeUnits(); } - public boolean allowQualifyingCommonColumn() { + @Override public boolean allowQualifyingCommonColumn() { return SqlConformanceEnum.DEFAULT.allowQualifyingCommonColumn(); } - public boolean allowAliasUnnestItems() { + @Override public boolean allowAliasUnnestItems() { return SqlConformanceEnum.DEFAULT.allowAliasUnnestItems(); } } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlConformanceEnum.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlConformanceEnum.java index 97a1608aebf..0bd37b9e256 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlConformanceEnum.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlConformanceEnum.java @@ -79,7 +79,7 @@ public enum SqlConformanceEnum implements SqlConformance { * consistent with Microsoft SQL Server version 2008. */ SQL_SERVER_2008; - public boolean isLiberal() { + @Override public boolean isLiberal() { switch (this) { case BABEL: return true; @@ -88,7 +88,7 @@ public boolean isLiberal() { } } - public boolean allowCharLiteralAlias() { + @Override public boolean allowCharLiteralAlias() { switch (this) { case BABEL: case BIG_QUERY: @@ -102,7 +102,7 @@ public boolean allowCharLiteralAlias() { } - public boolean isGroupByAlias() { + @Override public boolean isGroupByAlias() { switch (this) { case BABEL: case LENIENT: @@ -114,7 +114,7 @@ public boolean isGroupByAlias() { } } - public boolean isGroupByOrdinal() { + @Override public boolean isGroupByOrdinal() { switch (this) { case BABEL: case LENIENT: @@ -126,7 +126,7 @@ public boolean isGroupByOrdinal() { } } - public boolean isHavingAlias() { + @Override public boolean isHavingAlias() { switch (this) { case BABEL: case LENIENT: @@ -138,7 +138,7 @@ public boolean isHavingAlias() { } } - public boolean isSortByOrdinal() { + @Override public boolean isSortByOrdinal() { switch (this) { case DEFAULT: case BABEL: @@ -158,7 +158,7 @@ public boolean isSortByOrdinal() { } } - public boolean isSortByAlias() { + @Override public boolean isSortByAlias() { switch (this) { case DEFAULT: case BABEL: @@ -174,11 +174,11 @@ public boolean isSortByAlias() { } } - public boolean isSortByAliasObscures() { + @Override public boolean isSortByAliasObscures() { return this == SqlConformanceEnum.STRICT_92; } - public boolean isFromRequired() { + @Override public boolean isFromRequired() { switch (this) { case ORACLE_10: case ORACLE_12: @@ -191,7 +191,7 @@ public boolean isFromRequired() { } } - public boolean splitQuotedTableName() { + @Override public boolean splitQuotedTableName() { switch (this) { case BIG_QUERY: return true; @@ -200,7 +200,7 @@ public boolean splitQuotedTableName() { } } - public boolean allowHyphenInUnquotedTableName() { + @Override public boolean allowHyphenInUnquotedTableName() { switch (this) { case BIG_QUERY: return true; @@ -209,7 +209,7 @@ public boolean allowHyphenInUnquotedTableName() { } } - public boolean isBangEqualAllowed() { + @Override public boolean isBangEqualAllowed() { switch (this) { case LENIENT: case BABEL: @@ -247,7 +247,7 @@ public boolean isBangEqualAllowed() { } } - public boolean isApplyAllowed() { + @Override public boolean isApplyAllowed() { switch (this) { case BABEL: case LENIENT: @@ -259,7 +259,7 @@ public boolean isApplyAllowed() { } } - public boolean isInsertSubsetColumnsAllowed() { + @Override public boolean isInsertSubsetColumnsAllowed() { switch (this) { case BABEL: case LENIENT: @@ -272,7 +272,7 @@ public boolean isInsertSubsetColumnsAllowed() { } } - public boolean allowNiladicParentheses() { + @Override public boolean allowNiladicParentheses() { switch (this) { case BABEL: case LENIENT: @@ -283,7 +283,7 @@ public boolean allowNiladicParentheses() { } } - public boolean allowExplicitRowValueConstructor() { + @Override public boolean allowExplicitRowValueConstructor() { switch (this) { case DEFAULT: case LENIENT: @@ -294,7 +294,7 @@ public boolean allowExplicitRowValueConstructor() { } } - public boolean allowExtend() { + @Override public boolean allowExtend() { switch (this) { case BABEL: case LENIENT: @@ -304,7 +304,7 @@ public boolean allowExtend() { } } - public boolean isLimitStartCountAllowed() { + @Override public boolean isLimitStartCountAllowed() { switch (this) { case BABEL: case LENIENT: @@ -315,7 +315,7 @@ public boolean isLimitStartCountAllowed() { } } - public boolean allowGeometry() { + @Override public boolean allowGeometry() { switch (this) { case BABEL: case LENIENT: @@ -328,7 +328,7 @@ public boolean allowGeometry() { } } - public boolean shouldConvertRaggedUnionTypesToVarying() { + @Override public boolean shouldConvertRaggedUnionTypesToVarying() { switch (this) { case PRAGMATIC_99: case PRAGMATIC_2003: @@ -344,7 +344,7 @@ public boolean shouldConvertRaggedUnionTypesToVarying() { } } - public boolean allowExtendedTrim() { + @Override public boolean allowExtendedTrim() { switch (this) { case BABEL: case LENIENT: diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlIdentifierMoniker.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlIdentifierMoniker.java index aa9a68ac53d..14e609dfae7 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlIdentifierMoniker.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlIdentifierMoniker.java @@ -41,23 +41,23 @@ public SqlIdentifierMoniker(SqlIdentifier id) { //~ Methods ---------------------------------------------------------------- - public SqlMonikerType getType() { + @Override public SqlMonikerType getType() { return SqlMonikerType.COLUMN; } - public List getFullyQualifiedNames() { + @Override public List getFullyQualifiedNames() { return id.names; } - public SqlIdentifier toIdentifier() { + @Override public SqlIdentifier toIdentifier() { return id; } - public String toString() { + @Override public String toString() { return id.toString(); } - public String id() { + @Override public String id() { return id.toString(); } } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlMoniker.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlMoniker.java index 8b8069ea57f..3f3b385a59c 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlMoniker.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlMoniker.java @@ -32,7 +32,7 @@ public interface SqlMoniker { final Ordering> listOrdering = Ordering.natural().lexicographical(); - public int compare(SqlMoniker o1, SqlMoniker o2) { + @Override public int compare(SqlMoniker o1, SqlMoniker o2) { int c = o1.getType().compareTo(o2.getType()); if (c == 0) { c = listOrdering.compare(o1.getFullyQualifiedNames(), diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerImpl.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerImpl.java index 8b504284634..27fe51fb56a 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerImpl.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlMonikerImpl.java @@ -64,23 +64,23 @@ public SqlMonikerImpl(String name, SqlMonikerType type) { return Objects.hash(type, names); } - public SqlMonikerType getType() { + @Override public SqlMonikerType getType() { return type; } - public List getFullyQualifiedNames() { + @Override public List getFullyQualifiedNames() { return names; } - public SqlIdentifier toIdentifier() { + @Override public SqlIdentifier toIdentifier() { return new SqlIdentifier(names, SqlParserPos.ZERO); } - public String toString() { + @Override public String toString() { return Util.sepList(names, "."); } - public String id() { + @Override public String id() { return type + "(" + this + ")"; } } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlNameMatchers.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlNameMatchers.java index 458e50b6872..966485707f3 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlNameMatchers.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlNameMatchers.java @@ -59,11 +59,11 @@ private static class BaseMatcher implements SqlNameMatcher { this.caseSensitive = caseSensitive; } - public boolean isCaseSensitive() { + @Override public boolean isCaseSensitive() { return caseSensitive; } - public boolean matches(String string, String name) { + @Override public boolean matches(String string, String name) { return caseSensitive ? string.equals(name) : string.equalsIgnoreCase(name); } @@ -82,7 +82,7 @@ protected boolean listMatches(List list0, List list1) { return true; } - public , V> V get(Map map, + @Override public , V> V get(Map map, List prefixNames, List names) { final List key = concat(prefixNames, names); if (caseSensitive) { @@ -114,15 +114,15 @@ protected List bestMatch() { throw new UnsupportedOperationException(); } - public String bestString() { + @Override public String bestString() { return SqlIdentifier.getString(bestMatch()); } - public RelDataTypeField field(RelDataType rowType, String fieldName) { + @Override public RelDataTypeField field(RelDataType rowType, String fieldName) { return rowType.getField(fieldName, caseSensitive, false); } - public int frequency(Iterable names, String name) { + @Override public int frequency(Iterable names, String name) { int n = 0; for (String s : names) { if (matches(s, name)) { @@ -132,7 +132,7 @@ public int frequency(Iterable names, String name) { return n; } - public Set createSet() { + @Override public Set createSet() { return isCaseSensitive() ? new LinkedHashSet<>() : new TreeSet<>(String.CASE_INSENSITIVE_ORDER); diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlScopedShuttle.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlScopedShuttle.java index 4388aefd41a..1006374e1e8 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlScopedShuttle.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlScopedShuttle.java @@ -43,7 +43,7 @@ protected SqlScopedShuttle(SqlValidatorScope initialScope) { //~ Methods ---------------------------------------------------------------- - public final SqlNode visit(SqlCall call) { + @Override public final SqlNode visit(SqlCall call) { SqlValidatorScope oldScope = scopes.peek(); SqlValidatorScope newScope = oldScope.getOperandScope(call); scopes.push(newScope); 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 440019dea1d..1afd7fc8a55 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,7 +69,7 @@ public SqlUserDefinedTableFunction(SqlIdentifier opName, SqlKind kind, * Returns function that implements given operator call. * @return function that implements given operator call */ - public TableFunction getFunction() { + @Override public TableFunction getFunction() { return (TableFunction) super.getFunction(); } 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 9302c480238..1de2f640194 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 @@ -301,23 +301,23 @@ public SqlConformance getConformance() { return config.sqlConformance(); } - public SqlValidatorCatalogReader getCatalogReader() { + @Override public SqlValidatorCatalogReader getCatalogReader() { return catalogReader; } - public SqlOperatorTable getOperatorTable() { + @Override public SqlOperatorTable getOperatorTable() { return opTab; } - public RelDataTypeFactory getTypeFactory() { + @Override public RelDataTypeFactory getTypeFactory() { return typeFactory; } - public RelDataType getUnknownType() { + @Override public RelDataType getUnknownType() { return unknownType; } - public SqlNodeList expandStar( + @Override public SqlNodeList expandStar( SqlNodeList selectList, SqlSelect select, boolean includeSystemVars) { @@ -340,7 +340,7 @@ public SqlNodeList expandStar( } // implement SqlValidator - public void declareCursor(SqlSelect select, SqlValidatorScope parentScope) { + @Override public void declareCursor(SqlSelect select, SqlValidatorScope parentScope) { cursorSet.add(select); // add the cursor to a map that maps the cursor to its select based on @@ -361,18 +361,18 @@ public void declareCursor(SqlSelect select, SqlValidatorScope parentScope) { } // implement SqlValidator - public void pushFunctionCall() { + @Override public void pushFunctionCall() { FunctionParamInfo funcInfo = new FunctionParamInfo(); functionCallStack.push(funcInfo); } // implement SqlValidator - public void popFunctionCall() { + @Override public void popFunctionCall() { functionCallStack.pop(); } // implement SqlValidator - public String getParentCursor(String columnListParamName) { + @Override public String getParentCursor(String columnListParamName) { FunctionParamInfo funcParamInfo = functionCallStack.peek(); Map parentCursorMap = funcParamInfo.columnListParamToParentCursorMap; @@ -718,7 +718,7 @@ private boolean addOrExpandField(List selectItems, Set aliases, return false; } - public SqlNode validate(SqlNode topNode) { + @Override public SqlNode validate(SqlNode topNode) { SqlValidatorScope scope = new EmptyScope(this); scope = new CatalogScope(scope, ImmutableList.of("CATALOG")); final SqlNode topNode2 = validateScopedExpression(topNode, scope); @@ -727,7 +727,7 @@ public SqlNode validate(SqlNode topNode) { return topNode2; } - public List lookupHints(SqlNode topNode, SqlParserPos pos) { + @Override public List lookupHints(SqlNode topNode, SqlParserPos pos) { SqlValidatorScope scope = new EmptyScope(this); SqlNode outermostNode = performUnconditionalRewrites(topNode, false); cursorSet.add(outermostNode); @@ -749,7 +749,7 @@ public List lookupHints(SqlNode topNode, SqlParserPos pos) { return ImmutableList.copyOf(hintList); } - public SqlMoniker lookupQualifiedName(SqlNode topNode, SqlParserPos pos) { + @Override public SqlMoniker lookupQualifiedName(SqlNode topNode, SqlParserPos pos) { final String posString = pos.toString(); IdInfo info = idPositions.get(posString); if (info != null) { @@ -996,7 +996,7 @@ private static void findAllValidFunctionNames( } } - public SqlNode validateParameterizedExpression( + @Override public SqlNode validateParameterizedExpression( SqlNode topNode, final Map nameToTypeMap) { SqlValidatorScope scope = new ParameterScope(this, nameToTypeMap); @@ -1023,7 +1023,7 @@ private SqlNode validateScopedExpression( return outermostNode; } - public void validateQuery(SqlNode node, SqlValidatorScope scope, + @Override public void validateQuery(SqlNode node, SqlValidatorScope scope, RelDataType targetRowType) { final SqlValidatorNamespace ns = getNamespace(node, scope); if (node.getKind() == SqlKind.TABLESAMPLE) { @@ -1079,15 +1079,15 @@ public SqlValidatorScope getCursorScope(SqlSelect select) { return clauseScopes.get(IdPair.of(select, Clause.CURSOR)); } - public SqlValidatorScope getWhereScope(SqlSelect select) { + @Override public SqlValidatorScope getWhereScope(SqlSelect select) { return clauseScopes.get(IdPair.of(select, Clause.WHERE)); } - public SqlValidatorScope getSelectScope(SqlSelect select) { + @Override public SqlValidatorScope getSelectScope(SqlSelect select) { return clauseScopes.get(IdPair.of(select, Clause.SELECT)); } - public SelectScope getRawSelectScope(SqlSelect select) { + @Override public SelectScope getRawSelectScope(SqlSelect select) { SqlValidatorScope scope = getSelectScope(select); if (scope instanceof AggregatingSelectScope) { scope = ((AggregatingSelectScope) scope).getParent(); @@ -1095,33 +1095,33 @@ public SelectScope getRawSelectScope(SqlSelect select) { return (SelectScope) scope; } - public SqlValidatorScope getHavingScope(SqlSelect select) { + @Override public SqlValidatorScope getHavingScope(SqlSelect select) { // Yes, it's the same as getSelectScope return clauseScopes.get(IdPair.of(select, Clause.SELECT)); } - public SqlValidatorScope getGroupScope(SqlSelect select) { + @Override public SqlValidatorScope getGroupScope(SqlSelect select) { // Yes, it's the same as getWhereScope return clauseScopes.get(IdPair.of(select, Clause.GROUP_BY)); } - public SqlValidatorScope getFromScope(SqlSelect select) { + @Override public SqlValidatorScope getFromScope(SqlSelect select) { return scopes.get(select); } - public SqlValidatorScope getOrderScope(SqlSelect select) { + @Override public SqlValidatorScope getOrderScope(SqlSelect select) { return clauseScopes.get(IdPair.of(select, Clause.ORDER)); } - public SqlValidatorScope getMatchRecognizeScope(SqlMatchRecognize node) { + @Override public SqlValidatorScope getMatchRecognizeScope(SqlMatchRecognize node) { return scopes.get(node); } - public SqlValidatorScope getJoinScope(SqlNode node) { + @Override public SqlValidatorScope getJoinScope(SqlNode node) { return scopes.get(stripAs(node)); } - public SqlValidatorScope getOverScope(SqlNode node) { + @Override public SqlValidatorScope getOverScope(SqlNode node) { return scopes.get(node); } @@ -1170,7 +1170,7 @@ private SqlValidatorNamespace getNamespace(SqlIdentifier id, DelegatingScope sco return getNamespace(id); } - public SqlValidatorNamespace getNamespace(SqlNode node) { + @Override public SqlValidatorNamespace getNamespace(SqlNode node) { switch (node.getKind()) { case AS: @@ -1652,7 +1652,7 @@ RelDataType getTableConstructorRowType( return typeFactory.leastRestrictive(rowTypes); } - public RelDataType getValidatedNodeType(SqlNode node) { + @Override public RelDataType getValidatedNodeType(SqlNode node) { RelDataType type = getValidatedNodeTypeIfKnown(node); if (type == null) { throw Util.needToImplement(node); @@ -1661,7 +1661,7 @@ public RelDataType getValidatedNodeType(SqlNode node) { } } - public RelDataType getValidatedNodeTypeIfKnown(SqlNode node) { + @Override public RelDataType getValidatedNodeTypeIfKnown(SqlNode node) { final RelDataType type = nodeToTypeMap.get(node); if (type != null) { return type; @@ -1689,7 +1689,7 @@ public RelDataType getValidatedNodeTypeIfKnown(SqlNode node) { * @param node A SQL parse tree node, never null * @param type Its type; must not be null */ - public final void setValidatedNodeType(SqlNode node, RelDataType type) { + @Override public final void setValidatedNodeType(SqlNode node, RelDataType type) { Objects.requireNonNull(type); Objects.requireNonNull(node); if (type.equals(unknownType)) { @@ -1700,11 +1700,11 @@ public final void setValidatedNodeType(SqlNode node, RelDataType type) { nodeToTypeMap.put(node, type); } - public void removeValidatedNodeType(SqlNode node) { + @Override public void removeValidatedNodeType(SqlNode node) { nodeToTypeMap.remove(node); } - @Nullable public SqlCall makeNullaryCall(SqlIdentifier id) { + @Override @Nullable public SqlCall makeNullaryCall(SqlIdentifier id) { if (id.names.size() == 1 && !id.isComponentQuoted(0)) { final List list = new ArrayList<>(); opTab.lookupOperatorOverloads(id, null, SqlSyntax.FUNCTION, list, @@ -1723,7 +1723,7 @@ public void removeValidatedNodeType(SqlNode node) { return null; } - public RelDataType deriveType( + @Override public RelDataType deriveType( SqlValidatorScope scope, SqlNode expr) { Objects.requireNonNull(scope); @@ -1757,7 +1757,7 @@ RelDataType deriveTypeImpl( return Objects.requireNonNull(scope.nullifyType(operand, type)); } - public RelDataType deriveConstructorType( + @Override public RelDataType deriveConstructorType( SqlValidatorScope scope, SqlCall call, SqlFunction unresolvedConstructor, @@ -1810,7 +1810,7 @@ public RelDataType deriveConstructorType( return type; } - public CalciteException handleUnresolvedFunction(SqlCall call, + @Override public CalciteException handleUnresolvedFunction(SqlCall call, SqlFunction unresolvedFunction, List argTypes, List argNames) { // For builtins, we can give a better error message @@ -1969,7 +1969,7 @@ protected void addToSelectList( list.add(exp); } - public String deriveAlias( + @Override public String deriveAlias( SqlNode node, int ordinal) { return SqlValidatorUtil.getAlias(node, ordinal); @@ -2898,7 +2898,7 @@ private void registerWith( checkUpdate); } - public boolean isAggregate(SqlSelect select) { + @Override public boolean isAggregate(SqlSelect select) { if (getAggregate(select) != null) { return true; } @@ -3032,7 +3032,7 @@ private void registerOperandSubQueries( registerSubQueries(parentScope, operand); } - public void validateIdentifier(SqlIdentifier id, SqlValidatorScope scope) { + @Override public void validateIdentifier(SqlIdentifier id, SqlValidatorScope scope) { final SqlQualified fqId = scope.fullyQualify(id); if (this.config.columnReferenceExpansion()) { // NOTE jvs 9-Apr-2007: this doesn't cover ORDER BY, which has its @@ -3043,7 +3043,7 @@ public void validateIdentifier(SqlIdentifier id, SqlValidatorScope scope) { } } - public void validateLiteral(SqlLiteral literal) { + @Override public void validateLiteral(SqlLiteral literal) { switch (literal.getTypeName()) { case DECIMAL: // Decimal and long have the same precision (as 64-bit integers), so @@ -3133,7 +3133,7 @@ private void validateLiteralAsDouble(SqlLiteral literal) { // REVIEW jvs 4-Aug-2004: what about underflow? } - public void validateIntervalQualifier(SqlIntervalQualifier qualifier) { + @Override public void validateIntervalQualifier(SqlIntervalQualifier qualifier) { assert qualifier != null; boolean startPrecisionOutOfRange = false; boolean fractionalSecondPrecisionOutOfRange = false; @@ -3696,7 +3696,7 @@ private SqlModality deduceModality(SqlNode query) { } } - public boolean validateModality(SqlSelect select, SqlModality modality, + @Override public boolean validateModality(SqlSelect select, SqlModality modality, boolean fail) { final SelectScope scope = getRawSelectScope(select); @@ -3860,12 +3860,12 @@ protected void validateWindowClause(SqlSelect select) { windowList.validate(this, windowScope); } - public void validateWith(SqlWith with, SqlValidatorScope scope) { + @Override public void validateWith(SqlWith with, SqlValidatorScope scope) { final SqlValidatorNamespace namespace = getNamespace(with); validateNamespace(namespace, unknownType); } - public void validateWithItem(SqlWithItem withItem) { + @Override public void validateWithItem(SqlWithItem withItem) { if (withItem.columnList != null) { final RelDataType rowType = getValidatedNodeType(withItem.query); final int fieldCount = rowType.getFieldCount(); @@ -3887,7 +3887,7 @@ public void validateWithItem(SqlWithItem withItem) { } } - public void validateSequenceValue(SqlValidatorScope scope, SqlIdentifier id) { + @Override public void validateSequenceValue(SqlValidatorScope scope, SqlIdentifier id) { // Resolve identifier as a table. final SqlValidatorScope.ResolvedImpl resolved = new SqlValidatorScope.ResolvedImpl(); @@ -3909,21 +3909,21 @@ public void validateSequenceValue(SqlValidatorScope scope, SqlIdentifier id) { throw newValidationError(id, RESOURCE.notASequence(id.toString())); } - public SqlValidatorScope getWithScope(SqlNode withItem) { + @Override public SqlValidatorScope getWithScope(SqlNode withItem) { assert withItem.getKind() == SqlKind.WITH_ITEM; return scopes.get(withItem); } - public TypeCoercion getTypeCoercion() { + @Override public TypeCoercion getTypeCoercion() { assert config.typeCoercionEnabled(); return this.typeCoercion; } - public Config config() { + @Override public Config config() { return this.config; } - public SqlValidator transform(UnaryOperator transform) { + @Override public SqlValidator transform(UnaryOperator transform) { this.config = transform.apply(this.config); return this; } @@ -4013,7 +4013,7 @@ private void validateOrderItem(SqlSelect select, SqlNode orderItem) { validateExpr(orderItem, orderScope); } - public SqlNode expandOrderExpr(SqlSelect select, SqlNode orderExpr) { + @Override public SqlNode expandOrderExpr(SqlSelect select, SqlNode orderExpr) { final SqlNode newSqlNode = new OrderExpressionExpander(select, orderExpr).go(); if (newSqlNode != orderExpr) { @@ -4358,7 +4358,7 @@ protected RelDataType createTargetRowType( return typeFactory.createStructType(fields); } - public void validateInsert(SqlInsert insert) { + @Override public void validateInsert(SqlInsert insert) { final SqlValidatorNamespace targetNamespace = getNamespace(insert); validateNamespace(targetNamespace, unknownType); final RelOptTable relOptTable = SqlValidatorUtil.getRelOptTable( @@ -4760,7 +4760,7 @@ private SqlNode getNthExpr(SqlNode query, int ordinal, int sourceCount) { } } - public void validateDelete(SqlDelete call) { + @Override public void validateDelete(SqlDelete call) { final SqlSelect sqlSelect = call.getSourceSelect(); validateSelect(sqlSelect, unknownType); @@ -4771,7 +4771,7 @@ public void validateDelete(SqlDelete call) { validateAccess(call.getTargetTable(), table, SqlAccessEnum.DELETE); } - public void validateUpdate(SqlUpdate call) { + @Override public void validateUpdate(SqlUpdate call) { final SqlValidatorNamespace targetNamespace = getNamespace(call); validateNamespace(targetNamespace, unknownType); final RelOptTable relOptTable = SqlValidatorUtil.getRelOptTable( @@ -4801,7 +4801,7 @@ public void validateUpdate(SqlUpdate call) { validateAccess(call.getTargetTable(), table, SqlAccessEnum.UPDATE); } - public void validateMerge(SqlMerge call) { + @Override public void validateMerge(SqlMerge call) { SqlSelect sqlSelect = call.getSourceSelect(); // REVIEW zfong 5/25/06 - Does an actual type have to be passed into // validateSelect()? @@ -4975,12 +4975,12 @@ protected void validateValues( final RelDataType type = typeFactory.leastRestrictive( new AbstractList() { - public RelDataType get(int row) { + @Override public RelDataType get(int row) { SqlCall thisRow = (SqlCall) operands.get(row); return deriveType(scope, thisRow.operand(c)); } - public int size() { + @Override public int size() { return rowCount; } }); @@ -4994,10 +4994,10 @@ public int size() { } } - public void validateDataType(SqlDataTypeSpec dataType) { + @Override public void validateDataType(SqlDataTypeSpec dataType) { } - public void validateDynamicParam(SqlDynamicParam dynamicParam) { + @Override public void validateDynamicParam(SqlDynamicParam dynamicParam) { } /** @@ -5014,7 +5014,7 @@ private class ValidationError implements Supplier { this.validatorException = validatorException; } - public CalciteContextException get() { + @Override public CalciteContextException get() { return newValidationError(sqlNode, validatorException); } } @@ -5036,7 +5036,7 @@ public ValidationErrorFunction getValidationErrorFunction() { return validationErrorFunction; } - public CalciteContextException newValidationError(SqlNode node, + @Override public CalciteContextException newValidationError(SqlNode node, Resources.ExInst e) { assert node != null; final SqlParserPos pos = node.getParserPosition(); @@ -5057,7 +5057,7 @@ protected SqlWindow getWindowByName( return window; } - public SqlWindow resolveWindow( + @Override public SqlWindow resolveWindow( SqlNode windowOrRef, SqlValidatorScope scope) { SqlWindow window; @@ -5104,7 +5104,7 @@ SqlValidatorNamespace lookupFieldNamespace(RelDataType rowType, String name) { return new FieldNamespace(this, field.getType()); } - public void validateWindow( + @Override public void validateWindow( SqlNode windowOrId, SqlValidatorScope scope, SqlCall call) { @@ -5479,7 +5479,7 @@ private SqlNode navigationInDefine(SqlNode node, String alpha) { return node; } - public void validateAggregateParams(SqlCall aggCall, SqlNode filter, + @Override public void validateAggregateParams(SqlCall aggCall, SqlNode filter, SqlNodeList orderList, SqlValidatorScope scope) { // For "agg(expr)", expr cannot itself contain aggregate function // invocations. For example, "SUM(2 * MAX(x))" is illegal; when @@ -5550,7 +5550,7 @@ public void validateAggregateParams(SqlCall aggCall, SqlNode filter, } } - public void validateCall( + @Override public void validateCall( SqlCall call, SqlValidatorScope scope) { final SqlOperator operator = call.getOperator(); @@ -5604,7 +5604,7 @@ public SqlNode expandSelectExpr(SqlNode expr, return newExpr; } - public SqlNode expand(SqlNode expr, SqlValidatorScope scope) { + @Override public SqlNode expand(SqlNode expr, SqlValidatorScope scope) { final Expander expander = new Expander(this, scope); SqlNode newExpr = expr.accept(expander); if (expr != newExpr) { @@ -5624,11 +5624,11 @@ public SqlNode expandGroupByOrHavingExpr(SqlNode expr, return newExpr; } - public boolean isSystemField(RelDataTypeField field) { + @Override public boolean isSystemField(RelDataTypeField field) { return false; } - public List> getFieldOrigins(SqlNode sqlQuery) { + @Override public List> getFieldOrigins(SqlNode sqlQuery) { if (sqlQuery instanceof SqlExplain) { return Collections.emptyList(); } @@ -5677,7 +5677,7 @@ private List getFieldOrigin(SqlNode sqlQuery, int i) { } } - public RelDataType getParameterRowType(SqlNode sqlQuery) { + @Override public RelDataType getParameterRowType(SqlNode sqlQuery) { // NOTE: We assume that bind variables occur in depth-first tree // traversal in the same order that they occurred in the SQL text. final List types = new ArrayList<>(); @@ -5708,7 +5708,7 @@ public RelDataType getParameterRowType(SqlNode sqlQuery) { }); } - public void validateColumnListParams( + @Override public void validateColumnListParams( SqlFunction function, List argTypes, List operands) { @@ -5763,7 +5763,7 @@ private static class InsertNamespace extends DmlNamespace { this.node = Objects.requireNonNull(node); } - public SqlInsert getNode() { + @Override public SqlInsert getNode() { return node; } } @@ -5780,7 +5780,7 @@ private static class UpdateNamespace extends DmlNamespace { this.node = Objects.requireNonNull(node); } - public SqlUpdate getNode() { + @Override public SqlUpdate getNode() { return node; } } @@ -5797,7 +5797,7 @@ private static class DeleteNamespace extends DmlNamespace { this.node = Objects.requireNonNull(node); } - public SqlDelete getNode() { + @Override public SqlDelete getNode() { return node; } } @@ -5814,7 +5814,7 @@ private static class MergeNamespace extends DmlNamespace { this.node = Objects.requireNonNull(node); } - public SqlMerge getNode() { + @Override public SqlMerge getNode() { return node; } } @@ -5873,16 +5873,16 @@ private class DeriveTypeVisitor implements SqlVisitor { this.scope = scope; } - public RelDataType visit(SqlLiteral literal) { + @Override public RelDataType visit(SqlLiteral literal) { return literal.createSqlType(typeFactory); } - public RelDataType visit(SqlCall call) { + @Override public RelDataType visit(SqlCall call) { final SqlOperator operator = call.getOperator(); return operator.deriveType(SqlValidatorImpl.this, scope, call); } - public RelDataType visit(SqlNodeList nodeList) { + @Override public RelDataType visit(SqlNodeList nodeList) { // Operand is of a type that we can't derive a type for. If the // operand is of a peculiar type, such as a SqlNodeList, then you // should override the operator's validateCall() method so that it @@ -5890,7 +5890,7 @@ public RelDataType visit(SqlNodeList nodeList) { throw Util.needToImplement(nodeList); } - public RelDataType visit(SqlIdentifier id) { + @Override public RelDataType visit(SqlIdentifier id) { // First check for builtin functions which don't have parentheses, // like "LOCALTIME". final SqlCall call = makeNullaryCall(id); @@ -5976,7 +5976,7 @@ public RelDataType visit(SqlIdentifier id) { return type; } - public RelDataType visit(SqlDataTypeSpec dataType) { + @Override public RelDataType visit(SqlDataTypeSpec dataType) { // Q. How can a data type have a type? // A. When it appears in an expression. (Say as the 2nd arg to the // CAST operator.) @@ -5984,11 +5984,11 @@ public RelDataType visit(SqlDataTypeSpec dataType) { return dataType.deriveType(SqlValidatorImpl.this); } - public RelDataType visit(SqlDynamicParam param) { + @Override public RelDataType visit(SqlDynamicParam param) { return unknownType; } - public RelDataType visit(SqlIntervalQualifier intervalQualifier) { + @Override public RelDataType visit(SqlIntervalQualifier intervalQualifier) { return typeFactory.createSqlIntervalType(intervalQualifier); } } @@ -6075,7 +6075,7 @@ public SqlNode go() { return root.accept(this); } - public SqlNode visit(SqlLiteral literal) { + @Override public SqlNode visit(SqlLiteral literal) { // Ordinal markers, e.g. 'select a, b from t order by 2'. // Only recognize them if they are the whole expression, // and if the dialect permits. @@ -6125,7 +6125,7 @@ private SqlNode nthSelectItem(int ordinal, final SqlParserPos pos) { return expr.clone(pos); } - public SqlNode visit(SqlIdentifier id) { + @Override public SqlNode visit(SqlIdentifier id) { // Aliases, e.g. 'select a as x, b from t order by x'. if (id.isSimple() && config.sqlConformance().isSortByAlias()) { @@ -6146,7 +6146,7 @@ public SqlNode visit(SqlIdentifier id) { return getScope().fullyQualify(id).identifier; } - protected SqlNode visitScoped(SqlCall call) { + @Override protected SqlNode visitScoped(SqlCall call) { // Don't attempt to expand sub-queries. We haven't implemented // these yet. if (call instanceof SqlSelect) { @@ -6242,7 +6242,7 @@ static class ExtendedExpander extends Expander { return super.visit(id); } - public SqlNode visit(SqlLiteral literal) { + @Override public SqlNode visit(SqlLiteral literal) { if (havingExpr || !validator.config().sqlConformance().isGroupByOrdinal()) { return super.visit(literal); } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorScope.java b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorScope.java index cc58c163bc4..fcdd9acf3cb 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorScope.java @@ -278,7 +278,7 @@ class Step extends Path { return 1 + parent.stepCount(); } - protected void build(ImmutableList.Builder paths) { + @Override protected void build(ImmutableList.Builder paths) { parent.build(paths); paths.add(this); } @@ -289,7 +289,7 @@ protected void build(ImmutableList.Builder paths) { class ResolvedImpl implements Resolved { final List resolves = new ArrayList<>(); - public void found(SqlValidatorNamespace namespace, boolean nullable, + @Override public void found(SqlValidatorNamespace namespace, boolean nullable, SqlValidatorScope scope, Path path, List remainingNames) { if (scope instanceof TableScope) { scope = scope.getValidator().getSelectScope((SqlSelect) scope.getNode()); @@ -302,7 +302,7 @@ public void found(SqlValidatorNamespace namespace, boolean nullable, new Resolve(namespace, nullable, scope, path, remainingNames)); } - public int count() { + @Override public int count() { return resolves.size(); } 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 83644722c09..dcd20bd5f36 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 @@ -1227,7 +1227,7 @@ public static SqlNodeList copy(SqlValidatorScope scope, SqlNodeList list) { return (SqlNodeList) list.accept(new DeepCopier(scope)); } - public SqlNode visit(SqlNodeList list) { + @Override public SqlNode visit(SqlNodeList list) { SqlNodeList copy = new SqlNodeList(list.getParserPosition()); for (SqlNode node : list) { copy.add(node.accept(this)); @@ -1237,18 +1237,18 @@ public SqlNode visit(SqlNodeList list) { // Override to copy all arguments regardless of whether visitor changes // them. - protected SqlNode visitScoped(SqlCall call) { + @Override protected SqlNode visitScoped(SqlCall call) { ArgHandler argHandler = new CallCopyingArgHandler(call, true); call.getOperator().acceptCall(this, call, false, argHandler); return argHandler.result(); } - public SqlNode visit(SqlLiteral literal) { + @Override public SqlNode visit(SqlLiteral literal) { return SqlNode.clone(literal); } - public SqlNode visit(SqlIdentifier id) { + @Override public SqlNode visit(SqlIdentifier id) { // First check for builtin functions which don't have parentheses, // like "LOCALTIME". SqlValidator validator = getScope().getValidator(); @@ -1260,15 +1260,15 @@ public SqlNode visit(SqlIdentifier id) { return getScope().fullyQualify(id).identifier; } - public SqlNode visit(SqlDataTypeSpec type) { + @Override public SqlNode visit(SqlDataTypeSpec type) { return SqlNode.clone(type); } - public SqlNode visit(SqlDynamicParam param) { + @Override public SqlNode visit(SqlDynamicParam param) { return SqlNode.clone(param); } - public SqlNode visit(SqlIntervalQualifier intervalQualifier) { + @Override public SqlNode visit(SqlIntervalQualifier intervalQualifier) { return SqlNode.clone(intervalQualifier); } } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/TableConstructorNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/TableConstructorNamespace.java index 4dcf36efcb0..0ca3ae77e06 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/TableConstructorNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/TableConstructorNamespace.java @@ -53,7 +53,7 @@ public class TableConstructorNamespace extends AbstractNamespace { //~ Methods ---------------------------------------------------------------- - protected RelDataType validateImpl(RelDataType targetRowType) { + @Override protected RelDataType validateImpl(RelDataType targetRowType) { // First, validate the VALUES. If VALUES is inside INSERT, infers // the type of NULL values based on the types of target columns. validator.validateValues(values, targetRowType, scope); @@ -65,7 +65,7 @@ protected RelDataType validateImpl(RelDataType targetRowType) { return tableConstructorRowType; } - public SqlNode getNode() { + @Override public SqlNode getNode() { return values; } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/TableNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/TableNamespace.java index 8a8c59a7345..3ff1ed667c5 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/TableNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/TableNamespace.java @@ -54,7 +54,7 @@ private TableNamespace(SqlValidatorImpl validator, SqlValidatorTable table, this(validator, table, ImmutableList.of()); } - protected RelDataType validateImpl(RelDataType targetRowType) { + @Override protected RelDataType validateImpl(RelDataType targetRowType) { if (extendedFields.isEmpty()) { return table.getRowType(); } @@ -65,7 +65,7 @@ protected RelDataType validateImpl(RelDataType targetRowType) { return builder.build(); } - public SqlNode getNode() { + @Override public SqlNode getNode() { // This is the only kind of namespace not based on a node in the parse tree. return null; } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/TableScope.java b/core/src/main/java/org/apache/calcite/sql/validate/TableScope.java index a412edf6587..c8eb339834e 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/TableScope.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/TableScope.java @@ -46,7 +46,7 @@ class TableScope extends ListScope { //~ Methods ---------------------------------------------------------------- - public SqlNode getNode() { + @Override public SqlNode getNode() { return node; } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/UnnestNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/UnnestNamespace.java index 06d5a517459..bb80bf6998c 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/UnnestNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/UnnestNamespace.java @@ -59,7 +59,7 @@ class UnnestNamespace extends AbstractNamespace { return null; } - protected RelDataType validateImpl(RelDataType targetRowType) { + @Override protected RelDataType validateImpl(RelDataType targetRowType) { // Validate the call and its arguments, and infer the return type. validator.validateCall(unnest, scope); RelDataType type = @@ -68,7 +68,7 @@ protected RelDataType validateImpl(RelDataType targetRowType) { return toStruct(type, unnest); } - public SqlNode getNode() { + @Override public SqlNode getNode() { return unnest; } } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/WithItemNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/WithItemNamespace.java index f7449abacd9..cd3fc4c8808 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/WithItemNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/WithItemNamespace.java @@ -51,7 +51,7 @@ class WithItemNamespace extends AbstractNamespace { return builder.build(); } - public SqlNode getNode() { + @Override public SqlNode getNode() { return withItem; } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/WithNamespace.java b/core/src/main/java/org/apache/calcite/sql/validate/WithNamespace.java index f1e8914a845..364116a4e5c 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/WithNamespace.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/WithNamespace.java @@ -48,7 +48,7 @@ public class WithNamespace extends AbstractNamespace { //~ Methods ---------------------------------------------------------------- - protected RelDataType validateImpl(RelDataType targetRowType) { + @Override protected RelDataType validateImpl(RelDataType targetRowType) { for (SqlNode withItem : with.withList) { validator.validateWithItem((SqlWithItem) withItem); } @@ -60,7 +60,7 @@ protected RelDataType validateImpl(RelDataType targetRowType) { return rowType; } - public SqlNode getNode() { + @Override public SqlNode getNode() { return with; } } 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 3bfa8474657..35cc98a3a91 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 @@ -43,7 +43,7 @@ class WithScope extends ListScope { this.withItem = withItem; } - public SqlNode getNode() { + @Override public SqlNode getNode() { return withItem; } diff --git a/core/src/main/java/org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.java b/core/src/main/java/org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.java index fcb424ee32b..858bb3c5091 100644 --- a/core/src/main/java/org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.java +++ b/core/src/main/java/org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.java @@ -324,7 +324,7 @@ protected void updateInferredColumnType( * * @return tightest common type, i.e. INTEGER + DECIMAL(10, 2) returns DECIMAL(10, 2) */ - public RelDataType getTightestCommonType(RelDataType type1, RelDataType type2) { + @Override public RelDataType getTightestCommonType(RelDataType type1, RelDataType type2) { if (type1 == null || type2 == null) { return null; } @@ -430,7 +430,7 @@ private RelDataType promoteToVarChar(RelDataType type1, RelDataType type2) { * other is not. For date + timestamp operands, use timestamp as common type, * i.e. Timestamp(2017-01-01 00:00 ...) > Date(2018) evaluates to be false. */ - public RelDataType commonTypeForBinaryComparison(RelDataType type1, RelDataType type2) { + @Override public RelDataType commonTypeForBinaryComparison(RelDataType type1, RelDataType type2) { SqlTypeName typeName1 = type1.getSqlTypeName(); SqlTypeName typeName2 = type2.getSqlTypeName(); @@ -508,7 +508,7 @@ public RelDataType commonTypeForBinaryComparison(RelDataType type1, RelDataType * is that we allow some precision loss when widening decimal to fractional, * or promote fractional to string type. */ - public RelDataType getWiderTypeForTwo( + @Override public RelDataType getWiderTypeForTwo( RelDataType type1, RelDataType type2, boolean stringPromotion) { @@ -542,7 +542,7 @@ public RelDataType getWiderTypeForTwo( * you can override it based on the specific system requirement in * {@link org.apache.calcite.rel.type.RelDataTypeSystem}. */ - public RelDataType getWiderTypeForDecimal(RelDataType type1, RelDataType type2) { + @Override public RelDataType getWiderTypeForDecimal(RelDataType type1, RelDataType type2) { if (!SqlTypeUtil.isDecimal(type1) && !SqlTypeUtil.isDecimal(type2)) { return null; } @@ -564,7 +564,8 @@ public RelDataType getWiderTypeForDecimal(RelDataType type1, RelDataType type2) * {@link #getWiderTypeForTwo} satisfies the associative law. For instance, * (DATE, INTEGER, VARCHAR) should have VARCHAR as the wider common type. */ - public RelDataType getWiderTypeFor(List typeList, boolean stringPromotion) { + @Override public RelDataType getWiderTypeFor(List typeList, + boolean stringPromotion) { assert typeList.size() > 1; RelDataType resultType = typeList.get(0); 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 66ed010d240..a602337fe99 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 @@ -79,7 +79,7 @@ public TypeCoercionImpl(RelDataTypeFactory typeFactory, SqlValidator validator) * @param columnIndex Target column index * @param targetType Target type to cast to */ - public boolean rowTypeCoercion( + @Override public boolean rowTypeCoercion( SqlValidatorScope scope, SqlNode query, int columnIndex, @@ -132,7 +132,7 @@ public boolean rowTypeCoercion( * If the other operand is DECIMAL, * coerce the STRING operand to max precision/scale DECIMAL. */ - public boolean binaryArithmeticCoercion(SqlCallBinding binding) { + @Override public boolean binaryArithmeticCoercion(SqlCallBinding binding) { // Assume the operator has NUMERIC family operand type checker. SqlOperator operator = binding.getOperator(); SqlKind kind = operator.getKind(); @@ -204,7 +204,7 @@ protected boolean binaryArithmeticWithStrings( * then common comparison type E between D and C as the final common type. * */ - public boolean binaryComparisonCoercion(SqlCallBinding binding) { + @Override public boolean binaryComparisonCoercion(SqlCallBinding binding) { SqlOperator operator = binding.getOperator(); SqlKind kind = operator.getKind(); int operandCnt = binding.getOperandCount(); @@ -376,7 +376,7 @@ protected boolean booleanEquality(SqlCallBinding binding, * operands and else operands to find a common type, then cast the operands to the common type * when needed. */ - public boolean caseWhenCoercion(SqlCallBinding callBinding) { + @Override public boolean caseWhenCoercion(SqlCallBinding callBinding) { // For sql statement like: // `case when ... then (a, b, c) when ... then (d, e, f) else (g, h, i)` // an exception throws when entering this method. @@ -449,7 +449,7 @@ public boolean caseWhenCoercion(SqlCallBinding callBinding) { * find the common type of LHS and RHS nodes. * */ - public boolean inOperationCoercion(SqlCallBinding binding) { + @Override public boolean inOperationCoercion(SqlCallBinding binding) { SqlOperator operator = binding.getOperator(); if (operator.getKind() == SqlKind.IN || operator.getKind() == SqlKind.NOT_IN) { assert binding.getOperandCount() == 2; @@ -472,13 +472,13 @@ public boolean inOperationCoercion(SqlCallBinding binding) { for (int i = 0; i < colCount; i++) { final int i2 = i; List columnIthTypes = new AbstractList() { - public RelDataType get(int index) { + @Override public RelDataType get(int index) { return argTypes[index].isStruct() ? argTypes[index].getFieldList().get(i2).getType() : argTypes[index]; } - public int size() { + @Override public int size() { return argTypes.length; } }; @@ -542,7 +542,7 @@ public int size() { return false; } - public boolean builtinFunctionCoercion( + @Override public boolean builtinFunctionCoercion( SqlCallBinding binding, List operandTypes, List expectedFamilies) { @@ -564,7 +564,7 @@ && coerceOperandType(binding.getScope(), binding.getCall(), i, implicitType) /** * Type coercion for user-defined functions (UDFs). */ - public boolean userDefinedFunctionCoercion(SqlValidatorScope scope, + @Override public boolean userDefinedFunctionCoercion(SqlValidatorScope scope, SqlCall call, SqlFunction function) { final SqlOperandMetadata operandMetadata = (SqlOperandMetadata) function.getOperandTypeChecker(); @@ -591,7 +591,7 @@ public boolean userDefinedFunctionCoercion(SqlValidatorScope scope, return coerced; } - public boolean querySourceCoercion(SqlValidatorScope scope, + @Override public boolean querySourceCoercion(SqlValidatorScope scope, RelDataType sourceRowType, RelDataType targetRowType, SqlNode query) { final List sourceFields = sourceRowType.getFieldList(); final List targetFields = targetRowType.getFieldList(); diff --git a/core/src/main/java/org/apache/calcite/sql2rel/AuxiliaryConverter.java b/core/src/main/java/org/apache/calcite/sql2rel/AuxiliaryConverter.java index c0bc1a1a418..c58ad997f75 100644 --- a/core/src/main/java/org/apache/calcite/sql2rel/AuxiliaryConverter.java +++ b/core/src/main/java/org/apache/calcite/sql2rel/AuxiliaryConverter.java @@ -47,7 +47,7 @@ public Impl(SqlFunction f) { this.f = f; } - public RexNode convert(RexBuilder rexBuilder, RexNode groupCall, + @Override public RexNode convert(RexBuilder rexBuilder, RexNode groupCall, RexNode e) { switch (f.getKind()) { case TUMBLE_START: diff --git a/core/src/main/java/org/apache/calcite/sql2rel/NullInitializerExpressionFactory.java b/core/src/main/java/org/apache/calcite/sql2rel/NullInitializerExpressionFactory.java index fe85b749850..8992f04890d 100644 --- a/core/src/main/java/org/apache/calcite/sql2rel/NullInitializerExpressionFactory.java +++ b/core/src/main/java/org/apache/calcite/sql2rel/NullInitializerExpressionFactory.java @@ -38,7 +38,7 @@ public NullInitializerExpressionFactory() { } @SuppressWarnings("deprecation") - public boolean isGeneratedAlways(RelOptTable table, int iColumn) { + @Override public boolean isGeneratedAlways(RelOptTable table, int iColumn) { switch (generationStrategy(table, iColumn)) { case VIRTUAL: case STORED: @@ -48,24 +48,24 @@ public boolean isGeneratedAlways(RelOptTable table, int iColumn) { } } - public ColumnStrategy generationStrategy(RelOptTable table, int iColumn) { + @Override public ColumnStrategy generationStrategy(RelOptTable table, int iColumn) { return table.getRowType().getFieldList().get(iColumn).getType().isNullable() ? ColumnStrategy.NULLABLE : ColumnStrategy.NOT_NULLABLE; } - public RexNode newColumnDefaultValue(RelOptTable table, int iColumn, + @Override public RexNode newColumnDefaultValue(RelOptTable table, int iColumn, InitializerContext context) { final RelDataType fieldType = table.getRowType().getFieldList().get(iColumn).getType(); return context.getRexBuilder().makeNullLiteral(fieldType); } - public BiFunction postExpressionConversionHook() { + @Override public BiFunction postExpressionConversionHook() { return null; } - public RexNode newAttributeInitializer(RelDataType type, + @Override public RexNode newAttributeInitializer(RelDataType type, SqlFunction constructor, int iAttribute, List constructorArgs, InitializerContext context) { final RelDataType fieldType = diff --git a/core/src/main/java/org/apache/calcite/sql2rel/ReflectiveConvertletTable.java b/core/src/main/java/org/apache/calcite/sql2rel/ReflectiveConvertletTable.java index ffa05f006cc..47d977882d2 100644 --- a/core/src/main/java/org/apache/calcite/sql2rel/ReflectiveConvertletTable.java +++ b/core/src/main/java/org/apache/calcite/sql2rel/ReflectiveConvertletTable.java @@ -129,7 +129,7 @@ private void registerOpTypeMethod(final Method method) { }); } - public SqlRexConvertlet get(SqlCall call) { + @Override public SqlRexConvertlet get(SqlCall call) { SqlRexConvertlet convertlet; final SqlOperator op = call.getOperator(); 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 5ea0f9d1f3c..b4689195171 100644 --- a/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java +++ b/core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java @@ -2687,7 +2687,7 @@ static class CorRef implements Comparable { && field == ((CorRef) o).field; } - public int compareTo(@Nonnull CorRef o) { + @Override public int compareTo(@Nonnull CorRef o) { int c = corr.compareTo(o.corr); if (c != 0) { return c; @@ -2729,7 +2729,7 @@ static class CorDef implements Comparable { && field == ((CorDef) o).field; } - public int compareTo(@Nonnull CorDef o) { + @Override public int compareTo(@Nonnull CorDef o) { int c = corr.compareTo(o.corr); if (c != 0) { return c; diff --git a/core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java b/core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java index 1f9e0136012..c32c0a6c968 100644 --- a/core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java +++ b/core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java @@ -208,7 +208,7 @@ protected TrimResult trimChild( for (final CorrelationId correlation : rel.getVariablesSet()) { rel.accept( new CorrelationReferenceFinder() { - protected RexNode handle(RexFieldAccess fieldAccess) { + @Override protected RexNode handle(RexFieldAccess fieldAccess) { final RexCorrelVariable v = (RexCorrelVariable) fieldAccess.getReferenceExpr(); if (v.id.equals(correlation)) { @@ -303,7 +303,7 @@ protected TrimResult result(RelNode r, final Mapping mapping) { for (final CorrelationId correlation : r.getVariablesSet()) { r = r.accept( new CorrelationReferenceFinder() { - protected RexNode handle(RexFieldAccess fieldAccess) { + @Override protected RexNode handle(RexFieldAccess fieldAccess) { final RexCorrelVariable v = (RexCorrelVariable) fieldAccess.getReferenceExpr(); if (v.id.equals(correlation) diff --git a/core/src/main/java/org/apache/calcite/sql2rel/SqlNodeToRexConverterImpl.java b/core/src/main/java/org/apache/calcite/sql2rel/SqlNodeToRexConverterImpl.java index c6104c46bf2..0c329741611 100644 --- a/core/src/main/java/org/apache/calcite/sql2rel/SqlNodeToRexConverterImpl.java +++ b/core/src/main/java/org/apache/calcite/sql2rel/SqlNodeToRexConverterImpl.java @@ -56,7 +56,7 @@ public class SqlNodeToRexConverterImpl implements SqlNodeToRexConverter { //~ Methods ---------------------------------------------------------------- - public RexNode convertCall(SqlRexContext cx, SqlCall call) { + @Override public RexNode convertCall(SqlRexContext cx, SqlCall call) { final SqlRexConvertlet convertlet = convertletTable.get(call); if (convertlet != null) { return convertlet.convertCall(cx, call); @@ -67,7 +67,7 @@ public RexNode convertCall(SqlRexContext cx, SqlCall call) { throw Util.needToImplement(call); } - public RexLiteral convertInterval( + @Override public RexLiteral convertInterval( SqlRexContext cx, SqlIntervalQualifier intervalQualifier) { RexBuilder rexBuilder = cx.getRexBuilder(); @@ -75,7 +75,7 @@ public RexLiteral convertInterval( return rexBuilder.makeIntervalLiteral(intervalQualifier); } - public RexNode convertLiteral( + @Override public RexNode convertLiteral( SqlRexContext cx, SqlLiteral literal) { RexBuilder rexBuilder = cx.getRexBuilder(); diff --git a/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java b/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java index 2a1c49e2114..2ccbf3d1097 100644 --- a/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java +++ b/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java @@ -892,7 +892,7 @@ private static boolean containsInOperator( try { SqlVisitor visitor = new SqlBasicVisitor() { - public Void visit(SqlCall call) { + @Override public Void visit(SqlCall call) { if (call.getOperator() instanceof SqlInOperator) { throw new Util.FoundOne(call); } @@ -4094,7 +4094,7 @@ private RelNode convertMultisets(final List operands, } else { usedBb = createBlackboard(new ListScope(bb.scope) { - public SqlNode getNode() { + @Override public SqlNode getNode() { return call; } }, null, false); @@ -4542,13 +4542,13 @@ public RexNode register( RelDataType returnType = typeFactory.createStructType( new AbstractList>() { - public Map.Entry get( + @Override public Map.Entry get( int index) { return join.getRowType().getFieldList() .get(origLeftInputCount + index); } - public int size() { + @Override public int size() { return rexRangeRefLength; } }); @@ -4804,7 +4804,7 @@ ImmutableList retrieveCursors() { } } - public RexNode convertExpression(SqlNode expr) { + @Override public RexNode convertExpression(SqlNode expr) { // If we're in aggregation mode and this is an expression in the // GROUP BY clause, return a reference to the field. if (agg != null) { @@ -5035,7 +5035,7 @@ private boolean isConvertedSubq(RexNode rex) { return false; } - public int getGroupCount() { + @Override public int getGroupCount() { if (agg != null) { return agg.groupExprs.size(); } @@ -5045,35 +5045,35 @@ public int getGroupCount() { return -1; } - public RexBuilder getRexBuilder() { + @Override public RexBuilder getRexBuilder() { return rexBuilder; } - public SqlNode validateExpression(RelDataType rowType, SqlNode expr) { + @Override public SqlNode validateExpression(RelDataType rowType, SqlNode expr) { return SqlValidatorUtil.validateExprWithRowType( catalogReader.nameMatcher().isCaseSensitive(), opTab, typeFactory, rowType, expr).left; } - public RexRangeRef getSubQueryExpr(SqlCall call) { + @Override public RexRangeRef getSubQueryExpr(SqlCall call) { final SubQuery subQuery = getSubQuery(call); assert subQuery != null; return (RexRangeRef) subQuery.expr; } - public RelDataTypeFactory getTypeFactory() { + @Override public RelDataTypeFactory getTypeFactory() { return typeFactory; } - public InitializerExpressionFactory getInitializerExpressionFactory() { + @Override public InitializerExpressionFactory getInitializerExpressionFactory() { return initializerExpressionFactory; } - public SqlValidator getValidator() { + @Override public SqlValidator getValidator() { return validator; } - public RexNode convertLiteral(SqlLiteral literal) { + @Override public RexNode convertLiteral(SqlLiteral literal) { return exprConverter.convertLiteral(this, literal); } @@ -5081,11 +5081,11 @@ public RexNode convertInterval(SqlIntervalQualifier intervalQualifier) { return exprConverter.convertInterval(this, intervalQualifier); } - public RexNode visit(SqlLiteral literal) { + @Override public RexNode visit(SqlLiteral literal) { return exprConverter.convertLiteral(this, literal); } - public RexNode visit(SqlCall call) { + @Override public RexNode visit(SqlCall call) { if (agg != null) { final SqlOperator op = call.getOperator(); if (window == null @@ -5099,23 +5099,23 @@ public RexNode visit(SqlCall call) { new SqlCallBinding(validator, scope, call).permutedCall()); } - public RexNode visit(SqlNodeList nodeList) { + @Override public RexNode visit(SqlNodeList nodeList) { throw new UnsupportedOperationException(); } - public RexNode visit(SqlIdentifier id) { + @Override public RexNode visit(SqlIdentifier id) { return convertIdentifier(this, id); } - public RexNode visit(SqlDataTypeSpec type) { + @Override public RexNode visit(SqlDataTypeSpec type) { throw new UnsupportedOperationException(); } - public RexNode visit(SqlDynamicParam param) { + @Override public RexNode visit(SqlDynamicParam param) { return convertDynamicParam(param); } - public RexNode visit(SqlIntervalQualifier intervalQualifier) { + @Override public RexNode visit(SqlIntervalQualifier intervalQualifier) { return convertInterval(intervalQualifier); } @@ -5155,11 +5155,11 @@ public String getOriginalRelName() { * A default implementation of SubQueryConverter that does no conversion. */ private class NoOpSubQueryConverter implements SubQueryConverter { - public boolean canConvertSubQuery() { + @Override public boolean canConvertSubQuery() { return false; } - public RexNode convertSubQuery( + @Override public RexNode convertSubQuery( SqlCall subQuery, SqlToRelConverter parentConverter, boolean isExists, @@ -5316,34 +5316,34 @@ private void addExpr(RexNode expr, String name) { convertedInputExprs.add(Pair.of(expr, name)); } - public Void visit(SqlIdentifier id) { + @Override public Void visit(SqlIdentifier id) { return null; } - public Void visit(SqlNodeList nodeList) { + @Override public Void visit(SqlNodeList nodeList) { for (int i = 0; i < nodeList.size(); i++) { nodeList.get(i).accept(this); } return null; } - public Void visit(SqlLiteral lit) { + @Override public Void visit(SqlLiteral lit) { return null; } - public Void visit(SqlDataTypeSpec type) { + @Override public Void visit(SqlDataTypeSpec type) { return null; } - public Void visit(SqlDynamicParam param) { + @Override public Void visit(SqlDynamicParam param) { return null; } - public Void visit(SqlIntervalQualifier intervalQualifier) { + @Override public Void visit(SqlIntervalQualifier intervalQualifier) { return null; } - public Void visit(SqlCall call) { + @Override public Void visit(SqlCall call) { switch (call.getKind()) { case FILTER: case WITHIN_GROUP: @@ -5675,7 +5675,7 @@ private class HistogramShuttle extends RexShuttle { this.ignoreNulls = ignoreNulls; } - public RexNode visitCall(RexCall call) { + @Override public RexNode visitCall(RexCall call) { final SqlOperator op = call.getOperator(); if (!(op instanceof SqlAggFunction)) { return super.visitCall(call); diff --git a/core/src/main/java/org/apache/calcite/sql2rel/StandardConvertletTable.java b/core/src/main/java/org/apache/calcite/sql2rel/StandardConvertletTable.java index d1c9bd9cd2d..cda75ec1013 100644 --- a/core/src/main/java/org/apache/calcite/sql2rel/StandardConvertletTable.java +++ b/core/src/main/java/org/apache/calcite/sql2rel/StandardConvertletTable.java @@ -759,15 +759,15 @@ private static RexNode makeConstructorCall( ImmutableList.Builder initializationExprs = ImmutableList.builder(); final InitializerContext initializerContext = new InitializerContext() { - public RexBuilder getRexBuilder() { + @Override public RexBuilder getRexBuilder() { return rexBuilder; } - public SqlNode validateExpression(RelDataType rowType, SqlNode expr) { + @Override public SqlNode validateExpression(RelDataType rowType, SqlNode expr) { throw new UnsupportedOperationException(); } - public RexNode convertExpression(SqlNode e) { + @Override public RexNode convertExpression(SqlNode e) { throw new UnsupportedOperationException(); } }; @@ -1143,7 +1143,7 @@ private static class RegrCovarianceConvertlet implements SqlRexConvertlet { this.kind = kind; } - public RexNode convertCall(SqlRexContext cx, SqlCall call) { + @Override public RexNode convertCall(SqlRexContext cx, SqlCall call) { assert call.operandCount() == 2; final SqlNode arg1 = call.operand(0); final SqlNode arg2 = call.operand(1); @@ -1269,7 +1269,7 @@ private static class AvgVarianceConvertlet implements SqlRexConvertlet { this.kind = kind; } - public RexNode convertCall(SqlRexContext cx, SqlCall call) { + @Override public RexNode convertCall(SqlRexContext cx, SqlCall call) { assert call.operandCount() == 1; final SqlNode arg = call.operand(0); final SqlNode expr; @@ -1410,7 +1410,7 @@ private static class TrimConvertlet implements SqlRexConvertlet { this.flag = flag; } - public RexNode convertCall(SqlRexContext cx, SqlCall call) { + @Override public RexNode convertCall(SqlRexContext cx, SqlCall call) { final RexBuilder rexBuilder = cx.getRexBuilder(); final RexNode operand = cx.convertExpression(call.getOperandList().get(0)); @@ -1421,7 +1421,7 @@ public RexNode convertCall(SqlRexContext cx, SqlCall call) { /** Convertlet that converts {@code GREATEST} and {@code LEAST}. */ private static class GreatestConvertlet implements SqlRexConvertlet { - public RexNode convertCall(SqlRexContext cx, SqlCall call) { + @Override public RexNode convertCall(SqlRexContext cx, SqlCall call) { // Translate // GREATEST(a, b, c, d) // to @@ -1476,14 +1476,14 @@ public RexNode convertCall(SqlRexContext cx, SqlCall call) { /** Convertlet that handles {@code FLOOR} and {@code CEIL} functions. */ private class FloorCeilConvertlet implements SqlRexConvertlet { - public RexNode convertCall(SqlRexContext cx, SqlCall call) { + @Override public RexNode convertCall(SqlRexContext cx, SqlCall call) { return convertFloorCeil(cx, call); } } /** Convertlet that handles the {@code TIMESTAMPADD} function. */ private static class TimestampAddConvertlet implements SqlRexConvertlet { - public RexNode convertCall(SqlRexContext cx, SqlCall call) { + @Override public RexNode convertCall(SqlRexContext cx, SqlCall call) { // TIMESTAMPADD(unit, count, timestamp) // => timestamp + count * INTERVAL '1' UNIT final RexBuilder rexBuilder = cx.getRexBuilder(); @@ -1515,7 +1515,7 @@ public RexNode convertCall(SqlRexContext cx, SqlCall call) { /** Convertlet that handles the {@code TIMESTAMPDIFF} function. */ private static class TimestampDiffConvertlet implements SqlRexConvertlet { - public RexNode convertCall(SqlRexContext cx, SqlCall call) { + @Override public RexNode convertCall(SqlRexContext cx, SqlCall call) { // TIMESTAMPDIFF(unit, t1, t2) // => (t2 - t1) UNIT final RexBuilder rexBuilder = cx.getRexBuilder(); diff --git a/core/src/main/java/org/apache/calcite/statistic/CachingSqlStatisticProvider.java b/core/src/main/java/org/apache/calcite/statistic/CachingSqlStatisticProvider.java index 37715c9153b..f68e48d2072 100644 --- a/core/src/main/java/org/apache/calcite/statistic/CachingSqlStatisticProvider.java +++ b/core/src/main/java/org/apache/calcite/statistic/CachingSqlStatisticProvider.java @@ -43,7 +43,7 @@ public CachingSqlStatisticProvider(SqlStatisticProvider provider, this.cache = cache; } - public double tableCardinality(RelOptTable table) { + @Override public double tableCardinality(RelOptTable table) { try { final ImmutableList key = ImmutableList.of("tableCardinality", @@ -55,7 +55,7 @@ public double tableCardinality(RelOptTable table) { } } - public boolean isForeignKey(RelOptTable fromTable, List fromColumns, + @Override public boolean isForeignKey(RelOptTable fromTable, List fromColumns, RelOptTable toTable, List toColumns) { try { final ImmutableList key = @@ -72,7 +72,7 @@ public boolean isForeignKey(RelOptTable fromTable, List fromColumns, } } - public boolean isKey(RelOptTable table, List columns) { + @Override public boolean isKey(RelOptTable table, List columns) { try { final ImmutableList key = ImmutableList.of("isKey", table.getQualifiedName(), diff --git a/core/src/main/java/org/apache/calcite/statistic/MapSqlStatisticProvider.java b/core/src/main/java/org/apache/calcite/statistic/MapSqlStatisticProvider.java index 70bbccf6b70..40d0f45d829 100644 --- a/core/src/main/java/org/apache/calcite/statistic/MapSqlStatisticProvider.java +++ b/core/src/main/java/org/apache/calcite/statistic/MapSqlStatisticProvider.java @@ -98,7 +98,7 @@ public enum MapSqlStatisticProvider implements SqlStatisticProvider { keyMap = initializer.keyMapBuilder.build(); } - public double tableCardinality(RelOptTable table) { + @Override public double tableCardinality(RelOptTable table) { final JdbcTable jdbcTable = table.unwrap(JdbcTable.class); final List qualifiedName; if (jdbcTable != null) { @@ -110,7 +110,7 @@ public double tableCardinality(RelOptTable table) { return cardinalityMap.get(qualifiedName.toString()); } - public boolean isForeignKey(RelOptTable fromTable, List fromColumns, + @Override public boolean isForeignKey(RelOptTable fromTable, List fromColumns, RelOptTable toTable, List toColumns) { // Assume that anything that references a primary key is a foreign key. // It's wrong but it's enough for our current test cases. @@ -122,7 +122,7 @@ public boolean isForeignKey(RelOptTable fromTable, List fromColumns, + columnNames(fromTable, fromColumns)); } - public boolean isKey(RelOptTable table, List columns) { + @Override public boolean isKey(RelOptTable table, List columns) { // In order to match, all column ordinals must be in range 0 .. columnCount return columns.stream().allMatch(columnOrdinal -> (columnOrdinal >= 0) diff --git a/core/src/main/java/org/apache/calcite/statistic/QuerySqlStatisticProvider.java b/core/src/main/java/org/apache/calcite/statistic/QuerySqlStatisticProvider.java index 6529ea011b9..6f510811d40 100644 --- a/core/src/main/java/org/apache/calcite/statistic/QuerySqlStatisticProvider.java +++ b/core/src/main/java/org/apache/calcite/statistic/QuerySqlStatisticProvider.java @@ -79,7 +79,7 @@ public QuerySqlStatisticProvider(Consumer sqlConsumer) { this.sqlConsumer = Objects.requireNonNull(sqlConsumer); } - public double tableCardinality(RelOptTable table) { + @Override public double tableCardinality(RelOptTable table) { final SqlDialect dialect = table.unwrap(SqlDialect.class); final DataSource dataSource = table.unwrap(DataSource.class); return withBuilder( @@ -107,7 +107,7 @@ public double tableCardinality(RelOptTable table) { }); } - public boolean isForeignKey(RelOptTable fromTable, List fromColumns, + @Override public boolean isForeignKey(RelOptTable fromTable, List fromColumns, RelOptTable toTable, List toColumns) { final SqlDialect dialect = fromTable.unwrap(SqlDialect.class); final DataSource dataSource = fromTable.unwrap(DataSource.class); @@ -152,7 +152,7 @@ public boolean isForeignKey(RelOptTable fromTable, List fromColumns, }); } - public boolean isKey(RelOptTable table, List columns) { + @Override public boolean isKey(RelOptTable table, List columns) { final SqlDialect dialect = table.unwrap(SqlDialect.class); final DataSource dataSource = table.unwrap(DataSource.class); return withBuilder( diff --git a/core/src/main/java/org/apache/calcite/tools/Frameworks.java b/core/src/main/java/org/apache/calcite/tools/Frameworks.java index 9a9f9aa633b..111e78c62a4 100644 --- a/core/src/main/java/org/apache/calcite/tools/Frameworks.java +++ b/core/src/main/java/org/apache/calcite/tools/Frameworks.java @@ -423,63 +423,63 @@ static class StdFrameworkConfig implements FrameworkConfig { this.viewExpander = viewExpander; } - public SqlParser.Config getParserConfig() { + @Override public SqlParser.Config getParserConfig() { return parserConfig; } - public SqlValidator.Config getSqlValidatorConfig() { + @Override public SqlValidator.Config getSqlValidatorConfig() { return sqlValidatorConfig; } - public SqlToRelConverter.Config getSqlToRelConverterConfig() { + @Override public SqlToRelConverter.Config getSqlToRelConverterConfig() { return sqlToRelConverterConfig; } - public SchemaPlus getDefaultSchema() { + @Override public SchemaPlus getDefaultSchema() { return defaultSchema; } - public RexExecutor getExecutor() { + @Override public RexExecutor getExecutor() { return executor; } - public ImmutableList getPrograms() { + @Override public ImmutableList getPrograms() { return programs; } - public RelOptCostFactory getCostFactory() { + @Override public RelOptCostFactory getCostFactory() { return costFactory; } - public ImmutableList getTraitDefs() { + @Override public ImmutableList getTraitDefs() { return traitDefs; } - public SqlRexConvertletTable getConvertletTable() { + @Override public SqlRexConvertletTable getConvertletTable() { return convertletTable; } - public Context getContext() { + @Override public Context getContext() { return context; } - public SqlOperatorTable getOperatorTable() { + @Override public SqlOperatorTable getOperatorTable() { return operatorTable; } - public RelDataTypeSystem getTypeSystem() { + @Override public RelDataTypeSystem getTypeSystem() { return typeSystem; } - public boolean isEvolveLattice() { + @Override public boolean isEvolveLattice() { return evolveLattice; } - public SqlStatisticProvider getStatisticProvider() { + @Override public SqlStatisticProvider getStatisticProvider() { return statisticProvider; } - public RelOptTable.ViewExpander getViewExpander() { + @Override public RelOptTable.ViewExpander getViewExpander() { return viewExpander; } } diff --git a/core/src/main/java/org/apache/calcite/tools/Planner.java b/core/src/main/java/org/apache/calcite/tools/Planner.java index dccd41473b1..11de3da0d85 100644 --- a/core/src/main/java/org/apache/calcite/tools/Planner.java +++ b/core/src/main/java/org/apache/calcite/tools/Planner.java @@ -127,7 +127,7 @@ RelNode transform(int ruleSetIndex, * Releases all internal resources utilized while this {@code Planner} * exists. Once called, this Planner object is no longer valid. */ - void close(); + @Override void close(); RelTraitSet getEmptyTraitSet(); } diff --git a/core/src/main/java/org/apache/calcite/tools/Programs.java b/core/src/main/java/org/apache/calcite/tools/Programs.java index edbfe0c7f32..48d06380b1b 100644 --- a/core/src/main/java/org/apache/calcite/tools/Programs.java +++ b/core/src/main/java/org/apache/calcite/tools/Programs.java @@ -291,7 +291,7 @@ private RuleSetProgram(RuleSet ruleSet) { this.ruleSet = ruleSet; } - public RelNode run(RelOptPlanner planner, RelNode rel, + @Override public RelNode run(RelOptPlanner planner, RelNode rel, RelTraitSet requiredOutputTraits, List materializations, List lattices) { @@ -323,7 +323,7 @@ private static class SequenceProgram implements Program { this.programs = programs; } - public RelNode run(RelOptPlanner planner, RelNode rel, + @Override public RelNode run(RelOptPlanner planner, RelNode rel, RelTraitSet requiredOutputTraits, List materializations, List lattices) { @@ -343,7 +343,7 @@ public RelNode run(RelOptPlanner planner, RelNode rel, * disable field-trimming in {@link SqlToRelConverter}, and run * {@link TrimFieldsProgram} after this program. */ private static class DecorrelateProgram implements Program { - public RelNode run(RelOptPlanner planner, RelNode rel, + @Override public RelNode run(RelOptPlanner planner, RelNode rel, RelTraitSet requiredOutputTraits, List materializations, List lattices) { @@ -361,7 +361,7 @@ public RelNode run(RelOptPlanner planner, RelNode rel, /** Program that trims fields. */ private static class TrimFieldsProgram implements Program { - public RelNode run(RelOptPlanner planner, RelNode rel, + @Override public RelNode run(RelOptPlanner planner, RelNode rel, RelTraitSet requiredOutputTraits, List materializations, List lattices) { diff --git a/core/src/main/java/org/apache/calcite/tools/RelBuilder.java b/core/src/main/java/org/apache/calcite/tools/RelBuilder.java index 4f9bb06085d..50477f74ccd 100644 --- a/core/src/main/java/org/apache/calcite/tools/RelBuilder.java +++ b/core/src/main/java/org/apache/calcite/tools/RelBuilder.java @@ -2430,11 +2430,11 @@ public RelBuilder values(String[] fieldNames, Object... values) { fieldName.e != null ? fieldName.e : "expr$" + fieldName.i; final RelDataType type = typeFactory.leastRestrictive( new AbstractList() { - public RelDataType get(int index) { + @Override public RelDataType get(int index) { return tupleList.get(index).get(fieldName.i).getType(); } - public int size() { + @Override public int size() { return rowCount; } }); @@ -3011,7 +3011,7 @@ static class GroupKeyImpl implements GroupKey { return nodes.size(); } - public GroupKey alias(String alias) { + @Override public GroupKey alias(String alias) { return Objects.equals(this.alias, alias) ? this : new GroupKeyImpl(nodes, nodeLists, alias); @@ -3124,7 +3124,7 @@ private class AggCallImpl implements AggCallPlus { } } - public AggCall sort(Iterable orderKeys) { + @Override public AggCall sort(Iterable orderKeys) { final ImmutableList orderKeyList = ImmutableList.copyOf(orderKeys); return orderKeyList.equals(this.orderKeys) @@ -3133,43 +3133,43 @@ public AggCall sort(Iterable orderKeys) { filter, alias, operands, orderKeyList); } - public AggCall sort(RexNode... orderKeys) { + @Override public AggCall sort(RexNode... orderKeys) { return sort(ImmutableList.copyOf(orderKeys)); } - public AggCall approximate(boolean approximate) { + @Override public AggCall approximate(boolean approximate) { return approximate == this.approximate ? this : new AggCallImpl(aggFunction, distinct, approximate, ignoreNulls, filter, alias, operands, orderKeys); } - public AggCall filter(RexNode condition) { + @Override public AggCall filter(RexNode condition) { return Objects.equals(condition, this.filter) ? this : new AggCallImpl(aggFunction, distinct, approximate, ignoreNulls, condition, alias, operands, orderKeys); } - public AggCall as(String alias) { + @Override public AggCall as(String alias) { return Objects.equals(alias, this.alias) ? this : new AggCallImpl(aggFunction, distinct, approximate, ignoreNulls, filter, alias, operands, orderKeys); } - public AggCall distinct(boolean distinct) { + @Override public AggCall distinct(boolean distinct) { return distinct == this.distinct ? this : new AggCallImpl(aggFunction, distinct, approximate, ignoreNulls, filter, alias, operands, orderKeys); } - public AggCall distinct() { + @Override public AggCall distinct() { return distinct(true); } - public AggCall ignoreNulls(boolean ignoreNulls) { + @Override public AggCall ignoreNulls(boolean ignoreNulls) { return ignoreNulls == this.ignoreNulls ? this : new AggCallImpl(aggFunction, distinct, approximate, ignoreNulls, @@ -3211,35 +3211,35 @@ private static class AggCallImpl2 implements AggCallPlus { // nothing to do } - public AggCall sort(Iterable orderKeys) { + @Override public AggCall sort(Iterable orderKeys) { throw new UnsupportedOperationException(); } - public AggCall sort(RexNode... orderKeys) { + @Override public AggCall sort(RexNode... orderKeys) { throw new UnsupportedOperationException(); } - public AggCall approximate(boolean approximate) { + @Override public AggCall approximate(boolean approximate) { throw new UnsupportedOperationException(); } - public AggCall filter(RexNode condition) { + @Override public AggCall filter(RexNode condition) { throw new UnsupportedOperationException(); } - public AggCall as(String alias) { + @Override public AggCall as(String alias) { throw new UnsupportedOperationException(); } - public AggCall distinct(boolean distinct) { + @Override public AggCall distinct(boolean distinct) { throw new UnsupportedOperationException(); } - public AggCall distinct() { + @Override public AggCall distinct() { throw new UnsupportedOperationException(); } - public AggCall ignoreNulls(boolean ignoreNulls) { + @Override public AggCall ignoreNulls(boolean ignoreNulls) { throw new UnsupportedOperationException(); } } @@ -3386,7 +3386,7 @@ private class Shifter extends RexShuttle { this.right = right; } - public RexNode visitInputRef(RexInputRef inputRef) { + @Override public RexNode visitInputRef(RexInputRef inputRef) { final RelDataType leftRowType = left.getRowType(); final RexBuilder rexBuilder = getRexBuilder(); final int leftCount = leftRowType.getFieldCount(); diff --git a/core/src/main/java/org/apache/calcite/tools/RuleSets.java b/core/src/main/java/org/apache/calcite/tools/RuleSets.java index e158ad8dd15..73aff87ad0b 100644 --- a/core/src/main/java/org/apache/calcite/tools/RuleSets.java +++ b/core/src/main/java/org/apache/calcite/tools/RuleSets.java @@ -59,7 +59,7 @@ private static class ListRuleSet implements RuleSet { && rules.equals(((ListRuleSet) obj).rules); } - public Iterator iterator() { + @Override public Iterator iterator() { return rules.iterator(); } } 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 2ac503086c9..636bc5f1c4c 100644 --- a/core/src/main/java/org/apache/calcite/util/BarfingInvocationHandler.java +++ b/core/src/main/java/org/apache/calcite/util/BarfingInvocationHandler.java @@ -39,7 +39,7 @@ protected BarfingInvocationHandler() { //~ Methods ---------------------------------------------------------------- - public Object invoke( + @Override public Object invoke( Object proxy, Method method, Object[] args) throws Throwable { 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 b592b387af2..559954d4a6e 100644 --- a/core/src/main/java/org/apache/calcite/util/BitSets.java +++ b/core/src/main/java/org/apache/calcite/util/BitSets.java @@ -88,17 +88,17 @@ public static Iterable toIter(final BitSet bitSet) { return () -> new Iterator() { int i = bitSet.nextSetBit(0); - public boolean hasNext() { + @Override public boolean hasNext() { return i >= 0; } - public Integer next() { + @Override public Integer next() { int prev = i; i = bitSet.nextSetBit(i + 1); return prev; } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } }; diff --git a/core/src/main/java/org/apache/calcite/util/BitString.java b/core/src/main/java/org/apache/calcite/util/BitString.java index eb0caf74267..6cbced8d39e 100644 --- a/core/src/main/java/org/apache/calcite/util/BitString.java +++ b/core/src/main/java/org/apache/calcite/util/BitString.java @@ -87,7 +87,7 @@ public static BitString createFromBitString(String s) { return new BitString(s, n); } - public String toString() { + @Override public String toString() { return toBitString(); } diff --git a/core/src/main/java/org/apache/calcite/util/CastingList.java b/core/src/main/java/org/apache/calcite/util/CastingList.java index 5329a6bded6..3e52ac9a95e 100644 --- a/core/src/main/java/org/apache/calcite/util/CastingList.java +++ b/core/src/main/java/org/apache/calcite/util/CastingList.java @@ -47,24 +47,24 @@ protected CastingList(List list, Class clazz) { //~ Methods ---------------------------------------------------------------- - public E get(int index) { + @Override public E get(int index) { return clazz.cast(list.get(index)); } - public int size() { + @Override public int size() { return list.size(); } - public E set(int index, E element) { + @Override public E set(int index, E element) { final Object o = list.set(index, element); return clazz.cast(o); } - public E remove(int index) { + @Override public E remove(int index) { return clazz.cast(list.remove(index)); } - public void add(int pos, E o) { + @Override public void add(int pos, E o) { list.add(pos, o); } } 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 406e899e521..66d9f6b4671 100644 --- a/core/src/main/java/org/apache/calcite/util/ChunkList.java +++ b/core/src/main/java/org/apache/calcite/util/ChunkList.java @@ -218,11 +218,11 @@ private class ChunkListIterator implements ListIterator { this.end = end; } - public boolean hasNext() { + @Override public boolean hasNext() { return cursor < size; } - public E next() { + @Override public E next() { if (cursor >= size) { throw new NoSuchElementException(); } @@ -245,11 +245,11 @@ public E next() { return element; } - public boolean hasPrevious() { + @Override public boolean hasPrevious() { return cursor > 0; } - public E previous() { + @Override public E previous() { lastRet = cursor--; if (cursor < start) { chunk = chunk == null ? last : ChunkList.prev(chunk); @@ -265,15 +265,15 @@ public E previous() { return (E) element(chunk, cursor - start); } - public int nextIndex() { + @Override public int nextIndex() { return cursor; } - public int previousIndex() { + @Override public int previousIndex() { return cursor - 1; } - public void remove() { + @Override public void remove() { if (lastRet < 0) { throw new IllegalStateException(); } @@ -348,7 +348,7 @@ public void remove() { } } - public void set(E e) { + @Override public void set(E e) { if (lastRet < 0) { throw new IllegalStateException(); } @@ -363,7 +363,7 @@ public void set(E e) { setElement(c, HEADER_SIZE + p - s, e); } - public void add(E e) { + @Override public void add(E e) { if (chunk == null) { Object[] newChunk = new Object[CHUNK_SIZE + HEADER_SIZE]; if (first != null) { diff --git a/core/src/main/java/org/apache/calcite/util/Closer.java b/core/src/main/java/org/apache/calcite/util/Closer.java index 2b3c7bbfea0..39213928721 100644 --- a/core/src/main/java/org/apache/calcite/util/Closer.java +++ b/core/src/main/java/org/apache/calcite/util/Closer.java @@ -34,7 +34,7 @@ public E add(E e) { return e; } - public void close() { + @Override public void close() { for (AutoCloseable closeable : list) { try { closeable.close(); diff --git a/core/src/main/java/org/apache/calcite/util/CompositeList.java b/core/src/main/java/org/apache/calcite/util/CompositeList.java index f58986c6bc9..a79a90ff2b0 100644 --- a/core/src/main/java/org/apache/calcite/util/CompositeList.java +++ b/core/src/main/java/org/apache/calcite/util/CompositeList.java @@ -123,7 +123,7 @@ public static CompositeList of(List list0, return new CompositeList((ImmutableList) ImmutableList.of(list0, list1, list2)); } - public T get(int index) { + @Override public T get(int index) { for (List list : lists) { int nextIndex = index - list.size(); if (nextIndex < 0) { @@ -134,7 +134,7 @@ public T get(int index) { throw new IndexOutOfBoundsException(); } - public int size() { + @Override public int size() { int n = 0; for (List list : lists) { n += list.size(); diff --git a/core/src/main/java/org/apache/calcite/util/CompositeMap.java b/core/src/main/java/org/apache/calcite/util/CompositeMap.java index 264e9628f2b..6f0d5c36d23 100644 --- a/core/src/main/java/org/apache/calcite/util/CompositeMap.java +++ b/core/src/main/java/org/apache/calcite/util/CompositeMap.java @@ -54,11 +54,11 @@ private static ImmutableList list(E e, E[] es) { return builder.build(); } - public int size() { + @Override public int size() { return keySet().size(); } - public boolean isEmpty() { + @Override public boolean isEmpty() { // Empty iff all maps are empty. for (Map map : maps) { if (!map.isEmpty()) { @@ -68,7 +68,7 @@ public boolean isEmpty() { return true; } - public boolean containsKey(Object key) { + @Override public boolean containsKey(Object key) { for (Map map : maps) { if (map.containsKey(key)) { return true; @@ -77,7 +77,7 @@ public boolean containsKey(Object key) { return false; } - public boolean containsValue(Object value) { + @Override public boolean containsValue(Object value) { for (Map map : maps) { if (map.containsValue(value)) { return true; @@ -86,7 +86,7 @@ public boolean containsValue(Object value) { return false; } - public V get(Object key) { + @Override public V get(Object key) { for (Map map : maps) { //noinspection SuspiciousMethodCalls if (map.containsKey(key)) { @@ -96,27 +96,27 @@ public V get(Object key) { return null; } - public V put(K key, V value) { + @Override public V put(K key, V value) { // we are an unmodifiable view on the maps throw new UnsupportedOperationException(); } - public V remove(Object key) { + @Override public V remove(Object key) { // we are an unmodifiable view on the maps throw new UnsupportedOperationException(); } - public void putAll(Map m) { + @Override public void putAll(Map m) { // we are an unmodifiable view on the maps throw new UnsupportedOperationException(); } - public void clear() { + @Override public void clear() { // we are an unmodifiable view on the maps throw new UnsupportedOperationException(); } - public Set keySet() { + @Override public Set keySet() { final Set keys = new LinkedHashSet<>(); for (Map map : maps) { keys.addAll(map.keySet()); @@ -137,11 +137,11 @@ private Map combinedMap() { return builder.build(); } - public Collection values() { + @Override public Collection values() { return combinedMap().values(); } - public Set> entrySet() { + @Override public Set> entrySet() { return combinedMap().entrySet(); } } diff --git a/core/src/main/java/org/apache/calcite/util/DelegatingInvocationHandler.java b/core/src/main/java/org/apache/calcite/util/DelegatingInvocationHandler.java index 26898bb11af..b957698ef2a 100644 --- a/core/src/main/java/org/apache/calcite/util/DelegatingInvocationHandler.java +++ b/core/src/main/java/org/apache/calcite/util/DelegatingInvocationHandler.java @@ -51,7 +51,7 @@ public abstract class DelegatingInvocationHandler implements InvocationHandler { //~ Methods ---------------------------------------------------------------- - public Object invoke( + @Override public Object invoke( Object proxy, Method method, Object[] args) throws Throwable { diff --git a/core/src/main/java/org/apache/calcite/util/Filterator.java b/core/src/main/java/org/apache/calcite/util/Filterator.java index c365733e90d..c2a4fdf4af8 100644 --- a/core/src/main/java/org/apache/calcite/util/Filterator.java +++ b/core/src/main/java/org/apache/calcite/util/Filterator.java @@ -47,7 +47,7 @@ public Filterator(Iterator iterator, Class includeFilter) { //~ Methods ---------------------------------------------------------------- - public boolean hasNext() { + @Override public boolean hasNext() { if (ready) { // Allow hasNext() to be called repeatedly. return true; @@ -64,7 +64,7 @@ public boolean hasNext() { } } - public E next() { + @Override public E next() { if (ready) { E o = lookAhead; ready = false; @@ -80,7 +80,7 @@ public E next() { throw new NoSuchElementException(); } - public void remove() { + @Override public void remove() { iterator.remove(); } } diff --git a/core/src/main/java/org/apache/calcite/util/ImmutableBeans.java b/core/src/main/java/org/apache/calcite/util/ImmutableBeans.java index bf38e14c332..a2309cd80fa 100644 --- a/core/src/main/java/org/apache/calcite/util/ImmutableBeans.java +++ b/core/src/main/java/org/apache/calcite/util/ImmutableBeans.java @@ -59,7 +59,7 @@ public class ImmutableBeans { .weakKeys() .softValues() .build(new CacheLoader() { - public Def load(@Nonnull Class key) { + @Override public Def load(@Nonnull Class key) { //noinspection unchecked return makeDef(key); } @@ -473,7 +473,7 @@ private static class BeanImpl implements InvocationHandler { this.map = Objects.requireNonNull(map); } - public Object invoke(Object proxy, Method method, Object[] args) { + @Override public Object invoke(Object proxy, Method method, Object[] args) { final Handler handler = def.handlers.get(method); if (handler == null) { throw new IllegalArgumentException("no handler for method " + method); 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 81cfacc7d9e..a0546275b63 100644 --- a/core/src/main/java/org/apache/calcite/util/ImmutableBitSet.java +++ b/core/src/main/java/org/apache/calcite/util/ImmutableBitSet.java @@ -356,7 +356,7 @@ private static void checkRange(int fromIndex, int toIndex) { * * @return a string representation of this bit set */ - public String toString() { + @Override public String toString() { int numBits = words.length * BITS_PER_WORD; StringBuilder b = new StringBuilder(6 * numBits + 2); b.append('{'); @@ -420,7 +420,7 @@ private static int countBits(long[] words) { * * @return the hash code value for this bit set */ - public int hashCode() { + @Override public int hashCode() { long h = 1234; for (int i = words.length; --i >= 0;) { h ^= words[i] * (i + 1); @@ -453,7 +453,7 @@ public int size() { * {@code false} otherwise * @see #size() */ - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { if (this == obj) { return true; } @@ -470,7 +470,7 @@ public boolean equals(Object obj) { *

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

*/ - public int compareTo(@Nonnull ImmutableBitSet o) { + @Override public int compareTo(@Nonnull ImmutableBitSet o) { int i = 0; for (;;) { int n0 = nextSetBit(i); @@ -582,21 +582,21 @@ public int previousClearBit(int fromIndex) { } } - public Iterator iterator() { + @Override public Iterator iterator() { return new Iterator() { int i = nextSetBit(0); - public boolean hasNext() { + @Override public boolean hasNext() { return i >= 0; } - public Integer next() { + @Override public Integer next() { int prev = i; i = nextSetBit(i + 1); return prev; } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } }; @@ -638,11 +638,11 @@ public List asList() { * iterator is efficient. */ public Set asSet() { return new AbstractSet() { - @Nonnull public Iterator iterator() { + @Override @Nonnull public Iterator iterator() { return ImmutableBitSet.this.iterator(); } - public int size() { + @Override public int size() { return cardinality(); } diff --git a/core/src/main/java/org/apache/calcite/util/ImmutableIntList.java b/core/src/main/java/org/apache/calcite/util/ImmutableIntList.java index e0f8e4cad88..81e4dac421c 100644 --- a/core/src/main/java/org/apache/calcite/util/ImmutableIntList.java +++ b/core/src/main/java/org/apache/calcite/util/ImmutableIntList.java @@ -128,11 +128,11 @@ private static ImmutableIntList copyFromCollection( return ints.length == 0; } - public int size() { + @Override public int size() { return ints.length; } - public Object[] toArray() { + @Override public Object[] toArray() { final Object[] objects = new Object[ints.length]; for (int i = 0; i < objects.length; i++) { objects[i] = ints[i]; @@ -140,7 +140,7 @@ public Object[] toArray() { return objects; } - public T[] toArray(T[] a) { + @Override public T[] toArray(T[] a) { final int size = ints.length; if (a.length < size) { // Make a new array of a's runtime type, but my contents: @@ -177,7 +177,7 @@ public List toIntegerList() { return arrayList; } - public Integer get(int index) { + @Override public Integer get(int index) { return ints[index]; } @@ -195,13 +195,13 @@ public int getInt(int index) { @Override public ListIterator listIterator(int index) { return new AbstractIndexedListIterator(size(), index) { - protected Integer get(int index) { + @Override protected Integer get(int index) { return ImmutableIntList.this.get(index); } }; } - public int indexOf(Object o) { + @Override public int indexOf(Object o) { if (o instanceof Integer) { return indexOf((int) (Integer) o); } @@ -217,7 +217,7 @@ public int indexOf(int seek) { return -1; } - public int lastIndexOf(Object o) { + @Override public int lastIndexOf(Object o) { if (o instanceof Integer) { return lastIndexOf((int) (Integer) o); } @@ -326,33 +326,33 @@ protected AbstractIndexedListIterator(int size, int position) { this.position = position; } - public final boolean hasNext() { + @Override public final boolean hasNext() { return position < size; } - public final E next() { + @Override public final E next() { if (!hasNext()) { throw new NoSuchElementException(); } return get(position++); } - public final int nextIndex() { + @Override public final int nextIndex() { return position; } - public final boolean hasPrevious() { + @Override public final boolean hasPrevious() { return position > 0; } - public final E previous() { + @Override public final E previous() { if (!hasPrevious()) { throw new NoSuchElementException(); } return get(--position); } - public final int previousIndex() { + @Override public final int previousIndex() { return position - 1; } } 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 8fbd7b2ef97..0bdf1324a86 100644 --- a/core/src/main/java/org/apache/calcite/util/IntegerIntervalSet.java +++ b/core/src/main/java/org/apache/calcite/util/IntegerIntervalSet.java @@ -100,11 +100,11 @@ private Enumerator enumerator() { return new Enumerator() { int i = bounds[0] - 1; - public Integer current() { + @Override public Integer current() { return i; } - public boolean moveNext() { + @Override public boolean moveNext() { for (;;) { if (++i > bounds[1]) { return false; @@ -115,11 +115,11 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { i = bounds[0] - 1; } - public void close() { + @Override public void close() { // no resources } }; diff --git a/core/src/main/java/org/apache/calcite/util/Litmus.java b/core/src/main/java/org/apache/calcite/util/Litmus.java index 04773815246..fc19049473d 100644 --- a/core/src/main/java/org/apache/calcite/util/Litmus.java +++ b/core/src/main/java/org/apache/calcite/util/Litmus.java @@ -25,17 +25,17 @@ public interface Litmus { /** Implementation of {@link org.apache.calcite.util.Litmus} that throws * an {@link java.lang.AssertionError} on failure. */ Litmus THROW = new Litmus() { - public boolean fail(String message, Object... args) { + @Override public boolean fail(String message, Object... args) { final String s = message == null ? null : MessageFormatter.arrayFormat(message, args).getMessage(); throw new AssertionError(s); } - public boolean succeed() { + @Override public boolean succeed() { return true; } - public boolean check(boolean condition, String message, Object... args) { + @Override public boolean check(boolean condition, String message, Object... args) { if (condition) { return succeed(); } else { @@ -47,15 +47,15 @@ public boolean check(boolean condition, String message, Object... args) { /** Implementation of {@link org.apache.calcite.util.Litmus} that returns * a status code but does not throw. */ Litmus IGNORE = new Litmus() { - public boolean fail(String message, Object... args) { + @Override public boolean fail(String message, Object... args) { return false; } - public boolean succeed() { + @Override public boolean succeed() { return true; } - public boolean check(boolean condition, String message, Object... args) { + @Override public boolean check(boolean condition, String message, Object... args) { return condition; } }; diff --git a/core/src/main/java/org/apache/calcite/util/NlsString.java b/core/src/main/java/org/apache/calcite/util/NlsString.java index 8c682563d05..ee7bbd346b2 100644 --- a/core/src/main/java/org/apache/calcite/util/NlsString.java +++ b/core/src/main/java/org/apache/calcite/util/NlsString.java @@ -53,7 +53,7 @@ public class NlsString implements Comparable, Cloneable { .softValues() .build( new CacheLoader, String>() { - public String load(@Nonnull Pair key) { + @Override public String load(@Nonnull Pair key) { final Charset charset = key.right; final CharsetDecoder decoder = charset.newDecoder(); final byte[] bytes = key.left.getBytes(); @@ -149,7 +149,7 @@ private NlsString(String stringValue, ByteString bytesValue, //~ Methods ---------------------------------------------------------------- - public Object clone() { + @Override public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { @@ -157,11 +157,11 @@ public Object clone() { } } - public int hashCode() { + @Override public int hashCode() { return Objects.hash(stringValue, bytesValue, charsetName, collation); } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { return this == obj || obj instanceof NlsString && Objects.equals(stringValue, ((NlsString) obj).stringValue) @@ -245,7 +245,7 @@ public String asSql( * Returns the string quoted for SQL, for example _ISO-8859-1'is it a * plane? no it''s superman!'. */ - public String toString() { + @Override public String toString() { return asSql(true, true); } 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 c0486475be6..c98f2033f36 100644 --- a/core/src/main/java/org/apache/calcite/util/Pair.java +++ b/core/src/main/java/org/apache/calcite/util/Pair.java @@ -87,7 +87,7 @@ public static Pair of(Map.Entry entry) { //~ Methods ---------------------------------------------------------------- - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { return this == obj || (obj instanceof Pair) && Objects.equals(this.left, ((Pair) obj).left) @@ -104,7 +104,7 @@ public boolean equals(Object obj) { return keyHash ^ valueHash; } - public int compareTo(@Nonnull Pair that) { + @Override public int compareTo(@Nonnull Pair that) { //noinspection unchecked int c = NULLS_FIRST_COMPARATOR.compare(this.left, that.left); if (c == 0) { @@ -114,19 +114,19 @@ public int compareTo(@Nonnull Pair that) { return c; } - public String toString() { + @Override public String toString() { return "<" + left + ", " + right + ">"; } - public T1 getKey() { + @Override public T1 getKey() { return left; } - public T2 getValue() { + @Override public T2 getValue() { return right; } - public T2 setValue(T2 value) { + @Override public T2 setValue(T2 value) { throw new UnsupportedOperationException(); } @@ -228,11 +228,11 @@ public static List> zip( final K[] ks, final V[] vs) { return new AbstractList>() { - public Pair get(int index) { + @Override public Pair get(int index) { return Pair.of(ks[index], vs[index]); } - public int size() { + @Override public int size() { return Math.min(ks.length, vs.length); } }; @@ -384,15 +384,15 @@ private static class FirstAndIterator implements Iterator> { this.first = first; } - public boolean hasNext() { + @Override public boolean hasNext() { return iterator.hasNext(); } - public Pair next() { + @Override public Pair next() { return of(first, iterator.next()); } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException("remove"); } } @@ -411,15 +411,15 @@ private static class ZipIterator implements Iterator> { this.rightIterator = Objects.requireNonNull(rightIterator); } - public boolean hasNext() { + @Override public boolean hasNext() { return leftIterator.hasNext() && rightIterator.hasNext(); } - public Pair next() { + @Override public Pair next() { return Pair.of(leftIterator.next(), rightIterator.next()); } - public void remove() { + @Override public void remove() { leftIterator.remove(); rightIterator.remove(); } @@ -440,18 +440,18 @@ private static class AdjacentIterator implements Iterator> { previous = first; } - public boolean hasNext() { + @Override public boolean hasNext() { return iterator.hasNext(); } - public Pair next() { + @Override public Pair next() { final E current = iterator.next(); final Pair pair = of(previous, current); previous = current; return pair; } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException("remove"); } } @@ -477,11 +477,11 @@ private static class ZipList extends AbstractList> { this.size = size; } - public Pair get(int index) { + @Override public Pair get(int index) { return Pair.of(ks.get(index), vs.get(index)); } - public int size() { + @Override public int size() { return size; } } 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 c63e900bc27..ba5d98f93bd 100644 --- a/core/src/main/java/org/apache/calcite/util/PartiallyOrderedSet.java +++ b/core/src/main/java/org/apache/calcite/util/PartiallyOrderedSet.java @@ -154,15 +154,15 @@ private PartiallyOrderedSet(Ordering ordering, Map> map, return new Iterator() { E previous; - public boolean hasNext() { + @Override public boolean hasNext() { return iterator.hasNext(); } - public E next() { + @Override public E next() { return previous = iterator.next(); } - public void remove() { + @Override public void remove() { if (!PartiallyOrderedSet.this.remove(previous)) { // Object was not present. // Maybe they have never called 'next'? 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 5c4148f8ff3..1a126f15dad 100644 --- a/core/src/main/java/org/apache/calcite/util/Permutation.java +++ b/core/src/main/java/org/apache/calcite/util/Permutation.java @@ -89,7 +89,7 @@ private Permutation(int[] targets, int[] sources) { //~ Methods ---------------------------------------------------------------- - public Object clone() { + @Override public Object clone() { return new Permutation( targets.clone(), sources.clone()); @@ -107,11 +107,11 @@ public void identity() { /** * Returns the number of elements in this permutation. */ - public final int size() { + @Override public final int size() { return targets.length; } - public void clear() { + @Override public void clear() { throw new UnsupportedOperationException( "Cannot clear: permutation must always contain one mapping per element"); } @@ -147,7 +147,7 @@ public void clear() { * *

is represented by the string "[2, 0, 1, 3]". */ - public String toString() { + @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append("["); for (int i = 0; i < targets.length; i++) { @@ -192,7 +192,7 @@ public String toString() { * greater than or equal to the size of * the permuation */ - public void set(int source, int target) { + @Override public void set(int source, int target) { set(source, target, false); } @@ -393,7 +393,7 @@ private void setInternal(int source, int target) { /** * Returns the inverse permutation. */ - public Permutation inverse() { + @Override public Permutation inverse() { return new Permutation( sources.clone(), targets.clone()); @@ -402,7 +402,7 @@ public Permutation inverse() { /** * Returns whether this is the identity permutation. */ - public boolean isIdentity() { + @Override public boolean isIdentity() { for (int i = 0; i < targets.length; i++) { if (targets[i] != i) { return false; @@ -414,14 +414,14 @@ public boolean isIdentity() { /** * Returns the position that source is mapped to. */ - public int getTarget(int source) { + @Override public int getTarget(int source) { return targets[source]; } /** * Returns the position which maps to target. */ - public int getSource(int target) { + @Override public int getSource(int target) { return sources[target]; } @@ -468,55 +468,55 @@ private boolean isValid(boolean fail) { return true; } - public int hashCode() { + @Override public int hashCode() { // not very efficient return toString().hashCode(); } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { // not very efficient return (obj instanceof Permutation) && toString().equals(obj.toString()); } // implement Mapping - public Iterator iterator() { + @Override public Iterator iterator() { return new Iterator() { private int i = 0; - public boolean hasNext() { + @Override public boolean hasNext() { return i < targets.length; } - public IntPair next() { + @Override public IntPair next() { final IntPair pair = new IntPair(i, targets[i]); ++i; return pair; } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } }; } - public int getSourceCount() { + @Override public int getSourceCount() { return targets.length; } - public int getTargetCount() { + @Override public int getTargetCount() { return targets.length; } - public MappingType getMappingType() { + @Override public MappingType getMappingType() { return MappingType.BIJECTION; } - public int getTargetOpt(int source) { + @Override public int getTargetOpt(int source) { return getTarget(source); } - public int getSourceOpt(int target) { + @Override public int getSourceOpt(int target) { return getSource(target); } 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 a2a2879655a..940ab155aaf 100644 --- a/core/src/main/java/org/apache/calcite/util/PrecedenceClimbingParser.java +++ b/core/src/main/java/org/apache/calcite/util/PrecedenceClimbingParser.java @@ -281,7 +281,7 @@ public static class Call extends Token { return print(new StringBuilder()).toString(); } - protected StringBuilder print(StringBuilder b) { + @Override protected StringBuilder print(StringBuilder b) { switch (op.type) { case PREFIX: b.append('('); diff --git a/core/src/main/java/org/apache/calcite/util/ReflectUtil.java b/core/src/main/java/org/apache/calcite/util/ReflectUtil.java index 3609b7545ac..09cf6cebccd 100644 --- a/core/src/main/java/org/apache/calcite/util/ReflectUtil.java +++ b/core/src/main/java/org/apache/calcite/util/ReflectUtil.java @@ -419,7 +419,7 @@ public static ReflectiveVisitDispatcher c return new ReflectiveVisitDispatcher() { final Map, Method> map = new HashMap<>(); - public Method lookupVisitMethod( + @Override public Method lookupVisitMethod( Class visitorClass, Class visiteeClass, String visitMethodName) { @@ -430,7 +430,7 @@ public Method lookupVisitMethod( Collections.emptyList()); } - public Method lookupVisitMethod( + @Override public Method lookupVisitMethod( Class visitorClass, Class visiteeClass, String visitMethodName, @@ -458,7 +458,7 @@ public Method lookupVisitMethod( return method; } - public boolean invokeVisitor( + @Override public boolean invokeVisitor( R visitor, E visitee, String visitMethodName) { @@ -519,7 +519,7 @@ public static MethodDispatcher createMethodDispatcher( createDispatcher( (Class) visitor.getClass(), arg0Clazz); return new MethodDispatcher() { - public T invoke(Object... args) { + @Override public T invoke(Object... args) { Method method = lookupMethod(args[0]); try { final Object o = method.invoke(visitor, args); diff --git a/core/src/main/java/org/apache/calcite/util/RelToSqlConverterUtil.java b/core/src/main/java/org/apache/calcite/util/RelToSqlConverterUtil.java index 98f4bf74083..4ba7edc3e5c 100644 --- a/core/src/main/java/org/apache/calcite/util/RelToSqlConverterUtil.java +++ b/core/src/main/java/org/apache/calcite/util/RelToSqlConverterUtil.java @@ -142,7 +142,7 @@ private static String escapeSpecialChar(String inputString) { * unparse override. */ public static SqlSpecialOperator specialOperatorByName(String opName) { return new SqlSpecialOperator(opName, SqlKind.OTHER_FUNCTION) { - public void unparse( + @Override public void unparse( SqlWriter writer, SqlCall call, int leftPrec, diff --git a/core/src/main/java/org/apache/calcite/util/Sources.java b/core/src/main/java/org/apache/calcite/util/Sources.java index 4a8c514de05..98713e55731 100644 --- a/core/src/main/java/org/apache/calcite/util/Sources.java +++ b/core/src/main/java/org/apache/calcite/util/Sources.java @@ -234,7 +234,7 @@ private static URL fileToUrl(File file) { return url; } - public File file() { + @Override public File file() { if (file == null) { throw new UnsupportedOperationException(); } diff --git a/core/src/main/java/org/apache/calcite/util/StackWriter.java b/core/src/main/java/org/apache/calcite/util/StackWriter.java index 9c6676214fd..40da99093a3 100644 --- a/core/src/main/java/org/apache/calcite/util/StackWriter.java +++ b/core/src/main/java/org/apache/calcite/util/StackWriter.java @@ -159,7 +159,7 @@ private void popQuote(Character quoteChar) throws IOException { } // implement Writer - public void write(int c) throws IOException { + @Override public void write(int c) throws IOException { switch (c) { case INDENT: indentationDepth++; @@ -203,7 +203,7 @@ public void write(int c) throws IOException { } // implement Writer - public void write(char[] cbuf, int off, int len) throws IOException { + @Override public void write(char[] cbuf, int off, int len) throws IOException { // TODO: something more efficient using searches for // special characters for (int i = off; i < (off + len); i++) { @@ -212,7 +212,7 @@ public void write(char[] cbuf, int off, int len) throws IOException { } // implement Writer - public void write(String str, int off, int len) throws IOException { + @Override public void write(String str, int off, int len) throws IOException { // TODO: something more efficient using searches for // special characters for (int i = off; i < (off + len); i++) { 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 7e045a6e3d9..1f4c49bddcf 100644 --- a/core/src/main/java/org/apache/calcite/util/Util.java +++ b/core/src/main/java/org/apache/calcite/util/Util.java @@ -1378,17 +1378,17 @@ public static String lines(Iterable strings) { public static Iterable tokenize(final String s, final String delim) { return new Iterable() { final StringTokenizer t = new StringTokenizer(s, delim); - public Iterator iterator() { + @Override public Iterator iterator() { return new Iterator() { - public boolean hasNext() { + @Override public boolean hasNext() { return t.hasMoreTokens(); } - public String next() { + @Override public String next() { return t.nextToken(); } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException("remove"); } }; @@ -1782,11 +1782,11 @@ public static Collection filter( return new AbstractCollection() { private int size = -1; - public Iterator iterator() { + @Override public Iterator iterator() { return new Filterator<>(collection.iterator(), includeFilter); } - public int size() { + @Override public int size() { if (size == -1) { // Compute size. This is expensive, but the value // collection.size() is not correct since we're @@ -1966,11 +1966,11 @@ public static List quotientList( } final int size = (list.size() + n - k - 1) / n; return new AbstractList() { - public E get(int index) { + @Override public E get(int index) { return list.get(index * n + k); } - public int size() { + @Override public int size() { return size; } }; @@ -2098,11 +2098,11 @@ public static List skip(List list, int fromIndex) { public static List range(final int end) { return new AbstractList() { - public int size() { + @Override public int size() { return end; } - public Integer get(int index) { + @Override public Integer get(int index) { return index; } }; @@ -2110,11 +2110,11 @@ public Integer get(int index) { public static List range(final int start, final int end) { return new AbstractList() { - public int size() { + @Override public int size() { return end - start; } - public Integer get(int index) { + @Override public Integer get(int index) { return start + index; } }; @@ -2387,16 +2387,16 @@ public static Map asIndexMapJ( Collections2.transform(values, v -> Pair.of(function.apply(v), v)); final Set> entrySet = new AbstractSet>() { - public Iterator> iterator() { + @Override public Iterator> iterator() { return entries.iterator(); } - public int size() { + @Override public int size() { return entries.size(); } }; return new AbstractMap() { - public Set> entrySet() { + @Override public Set> entrySet() { return entrySet; } }; @@ -2728,11 +2728,11 @@ private static class TransformingList extends AbstractList { this.list = list; } - public T get(int i) { + @Override public T get(int i) { return function.apply(list.get(i)); } - public int size() { + @Override public int size() { return list.size(); } @@ -2771,11 +2771,11 @@ private static class FilteringIterator implements Iterator { current = moveNext(); } - public boolean hasNext() { + @Override public boolean hasNext() { return current != DUMMY; } - public T next() { + @Override public T next() { final T t = this.current; current = moveNext(); return t; 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 debda9dfc6f..bdf85407b7f 100644 --- a/core/src/main/java/org/apache/calcite/util/XmlOutput.java +++ b/core/src/main/java/org/apache/calcite/util/XmlOutput.java @@ -611,7 +611,7 @@ public String escapeString(String s) { } } - protected StringEscaper clone() { + @Override protected StringEscaper clone() { StringEscaper clone = new StringEscaper(); if (translationVector != null) { clone.translationVector = new ArrayList<>(translationVector); diff --git a/core/src/main/java/org/apache/calcite/util/graph/AttributedDirectedGraph.java b/core/src/main/java/org/apache/calcite/util/graph/AttributedDirectedGraph.java index 2bae5b7697c..51f93f2e0d8 100644 --- a/core/src/main/java/org/apache/calcite/util/graph/AttributedDirectedGraph.java +++ b/core/src/main/java/org/apache/calcite/util/graph/AttributedDirectedGraph.java @@ -52,7 +52,7 @@ public static AttributedDirectedGraph create( // CHECKSTYLE: IGNORE 1 /** @deprecated Use {@link #addEdge(Object, Object, Object...)}. */ - @Deprecated + @Override @Deprecated public E addEdge(V vertex, V targetVertex) { return super.addEdge(vertex, targetVertex); } @@ -87,7 +87,7 @@ public Iterable getEdges(V source, final V target) { /** Removes all edges from a given vertex to another. * Returns whether any were removed. */ - public boolean removeEdge(V source, V target) { + @Override public boolean removeEdge(V source, V target) { // remove out edges final List outEdges = vertexMap.get(source).outEdges; int removeOutCount = 0; diff --git a/core/src/main/java/org/apache/calcite/util/graph/BreadthFirstIterator.java b/core/src/main/java/org/apache/calcite/util/graph/BreadthFirstIterator.java index e6b1067586e..1b150766ce1 100644 --- a/core/src/main/java/org/apache/calcite/util/graph/BreadthFirstIterator.java +++ b/core/src/main/java/org/apache/calcite/util/graph/BreadthFirstIterator.java @@ -61,11 +61,11 @@ public static void reachable(Set set, } } - public boolean hasNext() { + @Override public boolean hasNext() { return !deque.isEmpty(); } - public V next() { + @Override public V next() { V v = deque.removeFirst(); for (E e : graph.getOutwardEdges(v)) { @SuppressWarnings("unchecked") V target = (V) e.target; @@ -76,7 +76,7 @@ public V next() { return v; } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } } diff --git a/core/src/main/java/org/apache/calcite/util/graph/DefaultDirectedGraph.java b/core/src/main/java/org/apache/calcite/util/graph/DefaultDirectedGraph.java index cae5b4bbce4..3f3bc153eba 100644 --- a/core/src/main/java/org/apache/calcite/util/graph/DefaultDirectedGraph.java +++ b/core/src/main/java/org/apache/calcite/util/graph/DefaultDirectedGraph.java @@ -78,7 +78,7 @@ private String toString(Ordering vertexOrdering, + ", edges: " + edgeOrdering.sortedCopy(edges) + ")"; } - public boolean addVertex(V vertex) { + @Override public boolean addVertex(V vertex) { if (vertexMap.containsKey(vertex)) { return false; } else { @@ -87,11 +87,11 @@ public boolean addVertex(V vertex) { } } - public Set edgeSet() { + @Override public Set edgeSet() { return Collections.unmodifiableSet(edges); } - public E addEdge(V vertex, V targetVertex) { + @Override public E addEdge(V vertex, V targetVertex) { final VertexInfo info = vertexMap.get(vertex); if (info == null) { throw new IllegalArgumentException("no vertex " + vertex); @@ -110,7 +110,7 @@ public E addEdge(V vertex, V targetVertex) { } } - public E getEdge(V source, V target) { + @Override public E getEdge(V source, V target) { // REVIEW: could instead use edges.get(new DefaultEdge(source, target)) final VertexInfo info = vertexMap.get(source); for (E outEdge : info.outEdges) { @@ -121,7 +121,7 @@ public E getEdge(V source, V target) { return null; } - public boolean removeEdge(V source, V target) { + @Override public boolean removeEdge(V source, V target) { // remove out edges final List outEdges = vertexMap.get(source).outEdges; boolean outRemoved = false; @@ -150,11 +150,11 @@ public boolean removeEdge(V source, V target) { return outRemoved; } - public Set vertexSet() { + @Override public Set vertexSet() { return vertexMap.keySet(); } - public void removeAllVertices(Collection collection) { + @Override public void removeAllVertices(Collection collection) { // The point at which collection is large enough to make the 'majority' // algorithm more efficient. final float threshold = 0.35f; @@ -208,11 +208,11 @@ private void removeMajorityVertices(Set vertexSet) { } } - public List getOutwardEdges(V source) { + @Override public List getOutwardEdges(V source) { return vertexMap.get(source).outEdges; } - public List getInwardEdges(V target) { + @Override public List getInwardEdges(V target) { return vertexMap.get(target).inEdges; } diff --git a/core/src/main/java/org/apache/calcite/util/graph/DepthFirstIterator.java b/core/src/main/java/org/apache/calcite/util/graph/DepthFirstIterator.java index 3fbbaa29257..466a98079d3 100644 --- a/core/src/main/java/org/apache/calcite/util/graph/DepthFirstIterator.java +++ b/core/src/main/java/org/apache/calcite/util/graph/DepthFirstIterator.java @@ -75,15 +75,15 @@ private static void buildListRecurse( activeVertices.remove(start); } - public boolean hasNext() { + @Override public boolean hasNext() { return iterator.hasNext(); } - public V next() { + @Override public V next() { return iterator.next(); } - public void remove() { + @Override public void remove() { throw new 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 e731e173e7e..3e2230d23c0 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 @@ -40,12 +40,12 @@ public static List predecessorListOf( DirectedGraph graph, V vertex) { final List edges = graph.getInwardEdges(vertex); return new AbstractList() { - public V get(int index) { + @Override public V get(int index) { //noinspection unchecked return (V) edges.get(index).source; } - public int size() { + @Override public int size() { return edges.size(); } }; diff --git a/core/src/main/java/org/apache/calcite/util/graph/TopologicalOrderIterator.java b/core/src/main/java/org/apache/calcite/util/graph/TopologicalOrderIterator.java index ebbbc4ea452..9ea1c1dc270 100644 --- a/core/src/main/java/org/apache/calcite/util/graph/TopologicalOrderIterator.java +++ b/core/src/main/java/org/apache/calcite/util/graph/TopologicalOrderIterator.java @@ -65,11 +65,11 @@ private void populate(Map countMap, List empties) { countMap.keySet().removeAll(empties); } - public boolean hasNext() { + @Override public boolean hasNext() { return !empties.isEmpty(); } - public V next() { + @Override public V next() { V v = empties.remove(0); for (E o : graph.vertexMap.get(v).outEdges) { //noinspection unchecked @@ -82,7 +82,7 @@ public V next() { return v; } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/core/src/main/java/org/apache/calcite/util/javac/JaninoCompiler.java b/core/src/main/java/org/apache/calcite/util/javac/JaninoCompiler.java index 23b430c293e..47508616423 100644 --- a/core/src/main/java/org/apache/calcite/util/javac/JaninoCompiler.java +++ b/core/src/main/java/org/apache/calcite/util/javac/JaninoCompiler.java @@ -50,7 +50,7 @@ public JaninoCompiler() { //~ Methods ---------------------------------------------------------------- // implement JavaCompiler - public void compile() { + @Override public void compile() { // REVIEW: SWZ: 3/12/2006: When this method is invoked multiple times, // it creates a series of AccountingClassLoader objects, each with // the previous as its parent ClassLoader. If we refactored this @@ -90,17 +90,17 @@ public void compile() { } // implement JavaCompiler - public JavaCompilerArgs getArgs() { + @Override public JavaCompilerArgs getArgs() { return args; } // implement JavaCompiler - public ClassLoader getClassLoader() { + @Override public ClassLoader getClassLoader() { return classLoader; } // implement JavaCompiler - public int getTotalByteCodeSize() { + @Override public int getTotalByteCodeSize() { return classLoader.getTotalByteCodeSize(); } @@ -117,21 +117,21 @@ public static class JaninoCompilerArgs extends JavaCompilerArgs { public JaninoCompilerArgs() { } - public boolean supportsSetSource() { + @Override public boolean supportsSetSource() { return true; } - public void setDestdir(String destdir) { + @Override public void setDestdir(String destdir) { super.setDestdir(destdir); this.destdir = destdir; } - public void setSource(String source, String fileName) { + @Override public void setSource(String source, String fileName) { this.source = source; addFile(fileName); } - public void setFullClassName(String fullClassName) { + @Override public void setFullClassName(String fullClassName) { this.fullClassName = fullClassName; } } diff --git a/core/src/main/java/org/apache/calcite/util/mapping/AbstractSourceMapping.java b/core/src/main/java/org/apache/calcite/util/mapping/AbstractSourceMapping.java index c4329e32ed7..3bf8abbac00 100644 --- a/core/src/main/java/org/apache/calcite/util/mapping/AbstractSourceMapping.java +++ b/core/src/main/java/org/apache/calcite/util/mapping/AbstractSourceMapping.java @@ -43,23 +43,23 @@ public AbstractSourceMapping(int sourceCount, int targetCount) { return targetCount; } - public Mapping inverse() { + @Override public Mapping inverse() { return Mappings.invert(this); } - public int size() { + @Override public int size() { return targetCount; } - public void clear() { + @Override public void clear() { throw new UnsupportedOperationException(); } - public MappingType getMappingType() { + @Override public MappingType getMappingType() { return MappingType.INVERSE_PARTIAL_FUNCTION; } - public Iterator iterator() { + @Override public Iterator iterator() { return new Iterator() { int source; int target = -1; @@ -77,21 +77,21 @@ private void moveToNext() { } } - public boolean hasNext() { + @Override public boolean hasNext() { return target < targetCount; } - public IntPair next() { + @Override public IntPair next() { IntPair p = new IntPair(source, target); moveToNext(); return p; } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException("remove"); } }; } - public abstract int getSourceOpt(int source); + @Override public abstract int getSourceOpt(int source); } diff --git a/core/src/main/java/org/apache/calcite/util/mapping/AbstractTargetMapping.java b/core/src/main/java/org/apache/calcite/util/mapping/AbstractTargetMapping.java index cd4db08aae7..22fa0166a22 100644 --- a/core/src/main/java/org/apache/calcite/util/mapping/AbstractTargetMapping.java +++ b/core/src/main/java/org/apache/calcite/util/mapping/AbstractTargetMapping.java @@ -43,23 +43,23 @@ public AbstractTargetMapping(int sourceCount, int targetCount) { return targetCount; } - public Mapping inverse() { + @Override public Mapping inverse() { return Mappings.invert(this); } - public int size() { + @Override public int size() { return sourceCount; } - public void clear() { + @Override public void clear() { throw new UnsupportedOperationException(); } - public MappingType getMappingType() { + @Override public MappingType getMappingType() { return MappingType.PARTIAL_FUNCTION; } - public Iterator iterator() { + @Override public Iterator iterator() { return new Iterator() { int source = -1; int target; @@ -77,21 +77,21 @@ private void moveToNext() { } } - public boolean hasNext() { + @Override public boolean hasNext() { return source < sourceCount; } - public IntPair next() { + @Override public IntPair next() { IntPair p = new IntPair(source, target); moveToNext(); return p; } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException("remove"); } }; } - public abstract int getTargetOpt(int source); + @Override public abstract int getTargetOpt(int source); } 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 2b2a4c06895..4abf84f2a49 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 @@ -36,7 +36,7 @@ public class IntPair { @Deprecated public static final Function SWAP = new Function() { - public IntPair apply(IntPair pair) { + @Override public IntPair apply(IntPair pair) { return of(pair.target, pair.source); } }; @@ -46,7 +46,7 @@ public IntPair apply(IntPair pair) { public static final Ordering ORDERING = Ordering.from( new Comparator() { - public int compare(IntPair o1, IntPair o2) { + @Override public int compare(IntPair o1, IntPair o2) { int c = Integer.compare(o1.source, o2.source); if (c == 0) { c = Integer.compare(o1.target, o2.target); @@ -59,7 +59,7 @@ public int compare(IntPair o1, IntPair o2) { @Deprecated public static final Function LEFT = new Function() { - public Integer apply(IntPair pair) { + @Override public Integer apply(IntPair pair) { return pair.source; } }; @@ -68,7 +68,7 @@ public Integer apply(IntPair pair) { @Deprecated public static final Function RIGHT = new Function() { - public Integer apply(IntPair pair) { + @Override public Integer apply(IntPair pair) { return pair.target; } }; @@ -91,11 +91,11 @@ public static IntPair of(int left, int right) { return new IntPair(left, right); } - public String toString() { + @Override public String toString() { return source + "-" + target; } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { if (obj instanceof IntPair) { IntPair that = (IntPair) obj; return (this.source == that.source) && (this.target == that.target); @@ -103,7 +103,7 @@ public boolean equals(Object obj) { return false; } - public int hashCode() { + @Override public int hashCode() { return Utilities.hash(source, target); } @@ -146,12 +146,12 @@ public static List zip( size = Math.min(lefts.size(), rights.size()); } return new AbstractList() { - public IntPair get(int index) { + @Override public IntPair get(int index) { return IntPair.of(lefts.get(index).intValue(), rights.get(index).intValue()); } - public int size() { + @Override public int size() { return size; } }; diff --git a/core/src/main/java/org/apache/calcite/util/mapping/Mapping.java b/core/src/main/java/org/apache/calcite/util/mapping/Mapping.java index f3c20d77eee..ddf528b2724 100644 --- a/core/src/main/java/org/apache/calcite/util/mapping/Mapping.java +++ b/core/src/main/java/org/apache/calcite/util/mapping/Mapping.java @@ -48,26 +48,26 @@ public interface Mapping *

This method is optional; implementations may throw * {@link UnsupportedOperationException}. */ - Iterator iterator(); + @Override Iterator iterator(); /** * Returns the number of sources. Valid sources will be in the range 0 .. * sourceCount. */ - int getSourceCount(); + @Override int getSourceCount(); /** * Returns the number of targets. Valid targets will be in the range 0 .. * targetCount. */ - int getTargetCount(); + @Override int getTargetCount(); - MappingType getMappingType(); + @Override MappingType getMappingType(); /** * Returns whether this mapping is the identity. */ - boolean isIdentity(); + @Override boolean isIdentity(); /** * Removes all elements in the mapping. @@ -77,5 +77,5 @@ public interface Mapping /** * Returns the number of elements in the mapping. */ - int size(); + @Override int size(); } 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 aa88d1135fc..d0d70b812d6 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 @@ -250,12 +250,12 @@ public static List apply2( final Mapping mapping, final List list) { return new AbstractList() { - public Integer get(int index) { + @Override public Integer get(int index) { final int source = list.get(index); return mapping.getTarget(source); } - public int size() { + @Override public int size() { return list.size(); } }; @@ -294,11 +294,11 @@ public static List apply3( public static List permute(final List list, final TargetMapping mapping) { return new AbstractList() { - public T get(int index) { + @Override public T get(int index) { return list.get(mapping.getTarget(index)); } - public int size() { + @Override public int size() { return mapping.getSourceCount(); } }; @@ -313,12 +313,12 @@ public int size() { */ public static List asList(final TargetMapping mapping) { return new AbstractList() { - public Integer get(int source) { + @Override public Integer get(int source) { int target = mapping.getTargetOpt(source); return target < 0 ? null : target; } - public int size() { + @Override public int size() { return mapping.getSourceCount(); } }; @@ -336,7 +336,7 @@ public int size() { */ public static List asListNonNull(final TargetMapping mapping) { return new AbstractList() { - public Integer get(int source) { + @Override public Integer get(int source) { int target = mapping.getTargetOpt(source); if (target < 0) { throw new IllegalArgumentException("Element " + source + " is not found in mapping " @@ -345,7 +345,7 @@ public Integer get(int source) { return target; } - public int size() { + @Override public int size() { return mapping.getSourceCount(); } }; @@ -764,16 +764,16 @@ public static Iterable invert(final Iterable pairs) { * {@link org.apache.calcite.util.mapping.IntPair}s. */ public static Iterator invert(final Iterator pairs) { return new Iterator() { - public boolean hasNext() { + @Override public boolean hasNext() { return pairs.hasNext(); } - public IntPair next() { + @Override public IntPair next() { final IntPair pair = pairs.next(); return IntPair.of(pair.target, pair.source); } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException("remove"); } }; @@ -827,7 +827,7 @@ public interface FunctionMapping extends CoreMapping { */ int getTarget(int source); - MappingType getMappingType(); + @Override MappingType getMappingType(); int getSourceCount(); } @@ -869,7 +869,7 @@ public interface SourceMapping extends CoreMapping { */ int getTargetOpt(int source); - MappingType getMappingType(); + @Override MappingType getMappingType(); boolean isIdentity(); @@ -890,7 +890,7 @@ public interface SourceMapping extends CoreMapping { *

TODO: figure out which interfaces this should extend */ public interface TargetMapping extends FunctionMapping { - int getSourceCount(); + @Override int getSourceCount(); /** * Returns the source that a target maps to, or -1 if it is not mapped. @@ -906,12 +906,12 @@ public interface TargetMapping extends FunctionMapping { * @return target * @throws NoElementException if source is not mapped */ - int getTarget(int source); + @Override int getTarget(int source); /** * Returns the target that a source maps to, or -1 if it is not mapped. */ - int getTargetOpt(int source); + @Override int getTargetOpt(int source); void set(int source, int target); @@ -922,15 +922,15 @@ public interface TargetMapping extends FunctionMapping { /** Abstract implementation of {@link Mapping}. */ public abstract static class AbstractMapping implements Mapping { - public void set(int source, int target) { + @Override public void set(int source, int target) { throw new UnsupportedOperationException(); } - public int getTargetOpt(int source) { + @Override public int getTargetOpt(int source) { throw new UnsupportedOperationException(); } - public int getTarget(int source) { + @Override public int getTarget(int source) { int target = getTargetOpt(source); if (target == -1) { throw new NoElementException( @@ -939,11 +939,11 @@ public int getTarget(int source) { return target; } - public int getSourceOpt(int target) { + @Override public int getSourceOpt(int target) { throw new UnsupportedOperationException(); } - public int getSource(int target) { + @Override public int getSource(int target) { int source = getSourceOpt(target); if (source == -1) { throw new NoElementException( @@ -952,15 +952,15 @@ public int getSource(int target) { return source; } - public int getSourceCount() { + @Override public int getSourceCount() { throw new UnsupportedOperationException(); } - public int getTargetCount() { + @Override public int getTargetCount() { throw new UnsupportedOperationException(); } - public boolean isIdentity() { + @Override public boolean isIdentity() { int sourceCount = getSourceCount(); int targetCount = getTargetCount(); if (sourceCount != targetCount) { @@ -1017,7 +1017,7 @@ public boolean isIdentity() { * *

This method relies upon the optional method {@link #iterator()}. */ - public String toString() { + @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append("[size=").append(size()) .append(", sourceCount=").append(getSourceCount()) @@ -1038,16 +1038,16 @@ public String toString() { /** Abstract implementation of mapping where both source and target * domains are finite. */ public abstract static class FiniteAbstractMapping extends AbstractMapping { - public Iterator iterator() { + @Override public Iterator iterator() { return new FunctionMappingIter(this); } - public int hashCode() { + @Override public int hashCode() { // not very efficient return toString().hashCode(); } - public boolean equals(Object obj) { + @Override public boolean equals(Object obj) { // not very efficient return (obj instanceof Mapping) && toString().equals(obj.toString()); @@ -1064,19 +1064,19 @@ static class FunctionMappingIter implements Iterator { this.mapping = mapping; } - public boolean hasNext() { + @Override public boolean hasNext() { return (i < mapping.getSourceCount()) || (mapping.getSourceCount() == -1); } - public IntPair next() { + @Override public IntPair next() { int x = i++; return new IntPair( x, mapping.getTarget(x)); } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } } @@ -1232,24 +1232,24 @@ private PartialMapping( this.mappingType = mappingType; } - public MappingType getMappingType() { + @Override public MappingType getMappingType() { return mappingType; } - public int getSourceCount() { + @Override public int getSourceCount() { return targets.length; } - public int getTargetCount() { + @Override public int getTargetCount() { return sources.length; } - public void clear() { + @Override public void clear() { Arrays.fill(sources, -1); Arrays.fill(targets, -1); } - public int size() { + @Override public int size() { int size = 0; int[] a = sources.length < targets.length ? sources : targets; for (int i1 : a) { @@ -1260,14 +1260,14 @@ public int size() { return size; } - public Mapping inverse() { + @Override public Mapping inverse() { return new PartialMapping( targets.clone(), sources.clone(), mappingType.inverse()); } - public Iterator iterator() { + @Override public Iterator iterator() { return new MappingItr(); } @@ -1286,7 +1286,7 @@ private static void assertPartialValid(int[] sources, int[] targets) { } } - public void set(int source, int target) { + @Override public void set(int source, int target) { assert isValid(); final int prevTarget = targets[source]; targets[source] = target; @@ -1304,18 +1304,18 @@ public void set(int source, int target) { /** * Returns the source that a target maps to, or -1 if it is not mapped. */ - public int getSourceOpt(int target) { + @Override public int getSourceOpt(int target) { return sources[target]; } /** * Returns the target that a source maps to, or -1 if it is not mapped. */ - public int getTargetOpt(int source) { + @Override public int getTargetOpt(int source) { return targets[source]; } - public boolean isIdentity() { + @Override public boolean isIdentity() { if (sources.length != targets.length) { return false; } @@ -1336,7 +1336,7 @@ private class MappingItr implements Iterator { advance(); } - public boolean hasNext() { + @Override public boolean hasNext() { return i < targets.length; } @@ -1346,13 +1346,13 @@ private void advance() { } while (i < targets.length && targets[i] == -1); } - public IntPair next() { + @Override public IntPair next() { final IntPair pair = new IntPair(i, targets[i]); advance(); return pair; } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } } @@ -1383,7 +1383,7 @@ static class SurjectionWithInverse extends PartialMapping { * @param source source * @param target target */ - public void set(int source, int target) { + @Override public void set(int source, int target) { assert isValid(); final int prevTarget = targets[source]; if (prevTarget != -1) { @@ -1394,7 +1394,7 @@ public void set(int source, int target) { sources[target] = source; } - public int getSource(int target) { + @Override public int getSource(int target) { return sources[target]; } } @@ -1413,35 +1413,35 @@ public IdentityMapping(int size) { this.size = size; } - public void clear() { + @Override public void clear() { throw new UnsupportedOperationException("Mapping is read-only"); } - public int size() { + @Override public int size() { return size; } - public Mapping inverse() { + @Override public Mapping inverse() { return this; } - public boolean isIdentity() { + @Override public boolean isIdentity() { return true; } - public void set(int source, int target) { + @Override public void set(int source, int target) { throw new UnsupportedOperationException(); } - public MappingType getMappingType() { + @Override public MappingType getMappingType() { return MappingType.BIJECTION; } - public int getSourceCount() { + @Override public int getSourceCount() { return size; } - public int getTargetCount() { + @Override public int getTargetCount() { return size; } @@ -1451,7 +1451,7 @@ public int getTargetCount() { * @param source source * @return target */ - public int getTarget(int source) { + @Override public int getTarget(int source) { if (source < 0 || (size != -1 && source >= size)) { throw new IndexOutOfBoundsException("source #" + source + " has no target in identity mapping of size " + size); @@ -1465,7 +1465,7 @@ public int getTarget(int source) { * @param source source * @return target */ - public int getTargetOpt(int source) { + @Override public int getTargetOpt(int source) { if (source < 0 || (size != -1 && source >= size)) { throw new IndexOutOfBoundsException("source #" + source + " has no target in identity mapping of size " + size); @@ -1479,7 +1479,7 @@ public int getTargetOpt(int source) { * @param target target * @return source */ - public int getSource(int target) { + @Override public int getSource(int target) { if (target < 0 || (size != -1 && target >= size)) { throw new IndexOutOfBoundsException("target #" + target + " has no source in identity mapping of size " + size); @@ -1493,7 +1493,7 @@ public int getSource(int target) { * @param target target * @return source */ - public int getSourceOpt(int target) { + @Override public int getSourceOpt(int target) { if (target < 0 || (size != -1 && target >= size)) { throw new IndexOutOfBoundsException("target #" + target + " has no source in identity mapping of size " + size); @@ -1501,20 +1501,20 @@ public int getSourceOpt(int target) { return target; } - public Iterator iterator() { + @Override public Iterator iterator() { return new Iterator() { int i = 0; - public boolean hasNext() { + @Override public boolean hasNext() { return (size < 0) || (i < size); } - public IntPair next() { + @Override public IntPair next() { int x = i++; return new IntPair(x, x); } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } }; @@ -1538,29 +1538,29 @@ public OverridingSourceMapping( this.target = target; } - public void clear() { + @Override public void clear() { throw new UnsupportedOperationException("Mapping is read-only"); } - public int size() { + @Override public int size() { return parent.getSourceOpt(target) >= 0 ? parent.size() : parent.size() + 1; } - public Mapping inverse() { + @Override public Mapping inverse() { return new OverridingTargetMapping( (TargetMapping) parent.inverse(), target, source); } - public MappingType getMappingType() { + @Override public MappingType getMappingType() { // FIXME: Mapping type might be weaker than parent. return parent.getMappingType(); } - public int getSource(int target) { + @Override public int getSource(int target) { if (target == this.target) { return this.source; } else { @@ -1568,14 +1568,14 @@ public int getSource(int target) { } } - public boolean isIdentity() { + @Override public boolean isIdentity() { // FIXME: It's possible that parent was not the identity but that // this overriding fixed it. return (source == target) && parent.isIdentity(); } - public Iterator iterator() { + @Override public Iterator iterator() { throw Util.needToImplement(this); } } @@ -1597,40 +1597,40 @@ public OverridingTargetMapping( this.source = source; } - public void clear() { + @Override public void clear() { throw new UnsupportedOperationException("Mapping is read-only"); } - public int size() { + @Override public int size() { return parent.getTargetOpt(source) >= 0 ? parent.size() : parent.size() + 1; } - public void set(int source, int target) { + @Override public void set(int source, int target) { parent.set(source, target); } - public Mapping inverse() { + @Override public Mapping inverse() { return new OverridingSourceMapping( parent.inverse(), source, target); } - public MappingType getMappingType() { + @Override public MappingType getMappingType() { // FIXME: Mapping type might be weaker than parent. return parent.getMappingType(); } - public boolean isIdentity() { + @Override public boolean isIdentity() { // FIXME: Possible that parent is not identity but this overriding // fixes it. return (source == target) && ((Mapping) parent).isIdentity(); } - public int getTarget(int source) { + @Override public int getTarget(int source) { if (source == this.source) { return this.target; } else { @@ -1638,7 +1638,7 @@ public int getTarget(int source) { } } - public Iterator iterator() { + @Override public Iterator iterator() { throw Util.needToImplement(this); } } @@ -1677,19 +1677,19 @@ private static class PartialFunctionImpl extends AbstractMapping Arrays.fill(targets, -1); } - public int getSourceCount() { + @Override public int getSourceCount() { return sourceCount; } - public int getTargetCount() { + @Override public int getTargetCount() { return targetCount; } - public void clear() { + @Override public void clear() { Arrays.fill(targets, -1); } - public int size() { + @Override public int size() { int size = 0; for (int target : targets) { if (target >= 0) { @@ -1699,7 +1699,7 @@ public int size() { return size; } - public Iterator iterator() { + @Override public Iterator iterator() { return new Iterator() { int i = -1; @@ -1719,31 +1719,31 @@ private void advance() { } } - public boolean hasNext() { + @Override public boolean hasNext() { return i < sourceCount; } - public IntPair next() { + @Override public IntPair next() { final IntPair pair = new IntPair(i, targets[i]); advance(); return pair; } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } }; } - public MappingType getMappingType() { + @Override public MappingType getMappingType() { return mappingType; } - public Mapping inverse() { + @Override public Mapping inverse() { return target(invert(this), targetCount, sourceCount); } - public void set(int source, int target) { + @Override public void set(int source, int target) { if ((target < 0) && mappingType.isMandatorySource()) { throw new IllegalArgumentException("Target is required"); } @@ -1765,7 +1765,7 @@ public void setAll(Mapping mapping) { * * @return target */ - public int getTargetOpt(int source) { + @Override public int getTargetOpt(int source) { return targets[source]; } } @@ -1784,69 +1784,69 @@ private static class InverseMapping implements Mapping { this.parent = parent; } - public Iterator iterator() { + @Override public Iterator iterator() { final Iterator parentIter = parent.iterator(); return new Iterator() { - public boolean hasNext() { + @Override public boolean hasNext() { return parentIter.hasNext(); } - public IntPair next() { + @Override public IntPair next() { IntPair parentPair = parentIter.next(); return new IntPair(parentPair.target, parentPair.source); } - public void remove() { + @Override public void remove() { parentIter.remove(); } }; } - public void clear() { + @Override public void clear() { parent.clear(); } - public int size() { + @Override public int size() { return parent.size(); } - public int getSourceCount() { + @Override public int getSourceCount() { return parent.getTargetCount(); } - public int getTargetCount() { + @Override public int getTargetCount() { return parent.getSourceCount(); } - public MappingType getMappingType() { + @Override public MappingType getMappingType() { return parent.getMappingType().inverse(); } - public boolean isIdentity() { + @Override public boolean isIdentity() { return parent.isIdentity(); } - public int getTargetOpt(int source) { + @Override public int getTargetOpt(int source) { return parent.getSourceOpt(source); } - public int getTarget(int source) { + @Override public int getTarget(int source) { return parent.getSource(source); } - public int getSource(int target) { + @Override public int getSource(int target) { return parent.getTarget(target); } - public int getSourceOpt(int target) { + @Override public int getSourceOpt(int target) { return parent.getTargetOpt(target); } - public Mapping inverse() { + @Override public Mapping inverse() { return parent; } - public void set(int source, int target) { + @Override public void set(int source, int target) { parent.set(target, source); } } diff --git a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidConnectionImpl.java b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidConnectionImpl.java index 0ac6619d82e..8e66404a8df 100644 --- a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidConnectionImpl.java +++ b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidConnectionImpl.java @@ -513,20 +513,20 @@ public Enumerable enumerable(final QueryType queryType, final ExecutorService service) throws IOException { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final BlockingQueueEnumerator enumerator = new BlockingQueueEnumerator<>(); final RunnableQueueSink sink = new RunnableQueueSink() { - public void send(Row row) throws InterruptedException { + @Override public void send(Row row) throws InterruptedException { enumerator.queue.put(row); } - public void end() { + @Override public void end() { enumerator.done.set(true); } @SuppressWarnings("deprecation") - public void setSourceEnumerable(Enumerable enumerable) + @Override public void setSourceEnumerable(Enumerable enumerable) throws InterruptedException { for (Row row : enumerable) { send(row); @@ -534,7 +534,7 @@ public void setSourceEnumerable(Enumerable enumerable) end(); } - public void run() { + @Override public void run() { try { final Page page = new Page(); final List fieldTypes = @@ -667,14 +667,14 @@ private static class BlockingQueueEnumerator implements Enumerator { E next; - public E current() { + @Override public E current() { if (next == null) { throw new NoSuchElementException(); } return next; } - public boolean moveNext() { + @Override public boolean moveNext() { for (;;) { next = queue.poll(); if (next != null) { @@ -687,9 +687,9 @@ public boolean moveNext() { } } - public void reset() {} + @Override public void reset() {} - public void close() { + @Override public void close() { final Throwable e = throwableHolder.get(); if (e != null) { throwableHolder.set(null); diff --git a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidJsonFilter.java b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidJsonFilter.java index 98822547cce..4dd6b8c4f05 100644 --- a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidJsonFilter.java +++ b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidJsonFilter.java @@ -509,7 +509,7 @@ private JsonSelector(String dimension, String value, this.extractionFunction = extractionFunction; } - public void write(JsonGenerator generator) throws IOException { + @Override public void write(JsonGenerator generator) throws IOException { generator.writeStartObject(); generator.writeStringField("type", type.lowercase()); generator.writeStringField("dimension", dimension); @@ -551,7 +551,7 @@ protected JsonBound(String dimension, String lower, this.extractionFunction = extractionFunction; } - public void write(JsonGenerator generator) throws IOException { + @Override public void write(JsonGenerator generator) throws IOException { generator.writeStartObject(); generator.writeStringField("type", type.lowercase()); generator.writeStringField("dimension", dimension); @@ -589,7 +589,7 @@ private JsonCompositeFilter(Type type, DruidJsonFilter... fields) { this(type, ImmutableList.copyOf(fields)); } - public void write(JsonGenerator generator) throws IOException { + @Override public void write(JsonGenerator generator) throws IOException { generator.writeStartObject(); generator.writeStringField("type", type.lowercase()); switch (type) { @@ -621,7 +621,7 @@ protected JsonInFilter(String dimension, List values, this.extractionFunction = extractionFunction; } - public void write(JsonGenerator generator) throws IOException { + @Override public void write(JsonGenerator generator) throws IOException { generator.writeStartObject(); generator.writeStringField("type", type.lowercase()); generator.writeStringField("dimension", dimension); 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 bc30cfc606c..bf17b8055ed 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 @@ -1597,7 +1597,7 @@ private static class DruidQueryNode implements Node { Hook.QUERY_PLAN.run(querySpec); } - public void run() throws InterruptedException { + @Override public void run() throws InterruptedException { final List fieldTypes = new ArrayList<>(); for (RelDataTypeField field : query.getRowType().getFieldList()) { fieldTypes.add(getPrimitive(field)); @@ -1660,7 +1660,7 @@ private JsonAggregation(String type, String name, String fieldName, String expre this.expression = expression; } - public void write(JsonGenerator generator) throws IOException { + @Override public void write(JsonGenerator generator) throws IOException { generator.writeStartObject(); generator.writeStringField("type", type); generator.writeStringField("name", name); @@ -1703,7 +1703,7 @@ private JsonLimit(String type, Integer limit, List collations) { this.collations = collations; } - public void write(JsonGenerator generator) throws IOException { + @Override public void write(JsonGenerator generator) throws IOException { generator.writeStartObject(); generator.writeStringField("type", type); writeFieldIf(generator, "limit", limit); @@ -1724,7 +1724,7 @@ private JsonCollation(String dimension, String direction, String dimensionOrder) this.dimensionOrder = dimensionOrder; } - public void write(JsonGenerator generator) throws IOException { + @Override public void write(JsonGenerator generator) throws IOException { generator.writeStartObject(); generator.writeStringField("dimension", dimension); writeFieldIf(generator, "direction", direction); @@ -1743,7 +1743,7 @@ private JsonCardinalityAggregation(String type, String name, this.fieldNames = fieldNames; } - public void write(JsonGenerator generator) throws IOException { + @Override public void write(JsonGenerator generator) throws IOException { generator.writeStartObject(); generator.writeStringField("type", type); generator.writeStringField("name", name); @@ -1785,7 +1785,7 @@ private JsonPostAggregation(String name, String type) { } // Expects all subclasses to write the EndObject item - public void write(JsonGenerator generator) throws IOException { + @Override public void write(JsonGenerator generator) throws IOException { generator.writeStartObject(); generator.writeStringField("type", type); generator.writeStringField("name", name); diff --git a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidSchemaFactory.java b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidSchemaFactory.java index 4501b251067..d1dcbded87c 100644 --- a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidSchemaFactory.java +++ b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidSchemaFactory.java @@ -52,7 +52,7 @@ public class DruidSchemaFactory implements SchemaFactory { /** Default Druid URL. */ public static final String DEFAULT_URL = "http://localhost:8082"; - public Schema create(SchemaPlus parentSchema, String name, + @Override public Schema create(SchemaPlus parentSchema, String name, Map operand) { final String url = operand.get("url") instanceof String ? (String) operand.get("url") diff --git a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidTable.java b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidTable.java index 307d1544aa4..0c8c7d6b051 100644 --- a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidTable.java +++ b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidTable.java @@ -228,7 +228,7 @@ public boolean isComplexMetric(String alias) { return complexMetrics.get(alias) != null; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { final RelDataType rowType = protoRowType.apply(typeFactory); final List fieldNames = rowType.getFieldNames(); Preconditions.checkArgument(fieldNames.contains(timestampFieldName)); @@ -236,7 +236,7 @@ public RelDataType getRowType(RelDataTypeFactory typeFactory) { return rowType; } - public RelNode toRel(RelOptTable.ToRelContext context, + @Override public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable) { final RelOptCluster cluster = context.getCluster(); final TableScan scan = LogicalTableScan.create(cluster, relOptTable, ImmutableList.of()); @@ -265,7 +265,7 @@ private static class MapRelProtoDataType implements RelProtoDataType { this.timestampColumn = timestampColumn; } - public RelDataType apply(RelDataTypeFactory typeFactory) { + @Override public RelDataType apply(RelDataTypeFactory typeFactory) { final RelDataTypeFactory.Builder builder = typeFactory.builder(); for (Map.Entry field : fields.entrySet()) { final String key = field.getKey(); diff --git a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidTableFactory.java b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidTableFactory.java index 797a6c6a644..d1fe59aa051 100644 --- a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidTableFactory.java +++ b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidTableFactory.java @@ -48,7 +48,7 @@ public class DruidTableFactory implements TableFactory { private DruidTableFactory() {} // name that is also the same name as a complex metric - public Table create(SchemaPlus schema, String name, Map operand, + @Override public Table create(SchemaPlus schema, String name, Map operand, RelDataType rowType) { final DruidSchema druidSchema = schema.unwrap(DruidSchema.class); // If "dataSource" operand is present it overrides the table name. diff --git a/druid/src/main/java/org/apache/calcite/adapter/druid/Granularities.java b/druid/src/main/java/org/apache/calcite/adapter/druid/Granularities.java index c5287c82d87..c0411236a71 100644 --- a/druid/src/main/java/org/apache/calcite/adapter/druid/Granularities.java +++ b/druid/src/main/java/org/apache/calcite/adapter/druid/Granularities.java @@ -75,7 +75,7 @@ private enum AllGranularity implements Granularity { generator.writeObject("all"); } - @Nonnull public Type getType() { + @Override @Nonnull public Type getType() { return Type.ALL; } } @@ -101,7 +101,7 @@ private PeriodGranularity(Type type, String period, String timeZone) { generator.writeEndObject(); } - @Nonnull public Type getType() { + @Override @Nonnull public Type getType() { return type; } } 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 e14fd595113..e84d1238d50 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 @@ -345,7 +345,7 @@ public static class ElasticsearchQueryable extends AbstractTableQueryable super(queryProvider, schema, table, tableName); } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return null; } diff --git a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvFilterableTable.java b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvFilterableTable.java index c9cae658c5b..6f0474d5189 100644 --- a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvFilterableTable.java +++ b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvFilterableTable.java @@ -48,18 +48,18 @@ public CsvFilterableTable(Source source, RelProtoDataType protoRowType) { super(source, protoRowType); } - public String toString() { + @Override public String toString() { return "CsvFilterableTable"; } - public Enumerable scan(DataContext root, List filters) { + @Override public Enumerable scan(DataContext root, List filters) { final List fieldTypes = getFieldTypes(root.getTypeFactory()); final String[] filterValues = new String[fieldTypes.size()]; filters.removeIf(filter -> addFilter(filter, filterValues)); final List fields = ImmutableIntList.identity(fieldTypes.size()); final AtomicBoolean cancelFlag = DataContext.Variable.CANCEL_FLAG.get(root); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new CsvEnumerator<>(source, cancelFlag, false, filterValues, CsvEnumerator.arrayConverter(fieldTypes, fields, false)); } diff --git a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvScannableTable.java b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvScannableTable.java index bdc2af02159..00827ebb29b 100644 --- a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvScannableTable.java +++ b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvScannableTable.java @@ -43,16 +43,16 @@ public class CsvScannableTable extends CsvTable super(source, protoRowType); } - public String toString() { + @Override public String toString() { return "CsvScannableTable"; } - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { final List fieldTypes = getFieldTypes(root.getTypeFactory()); final List fields = ImmutableIntList.identity(fieldTypes.size()); final AtomicBoolean cancelFlag = DataContext.Variable.CANCEL_FLAG.get(root); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new CsvEnumerator<>(source, cancelFlag, false, null, CsvEnumerator.arrayConverter(fieldTypes, fields, false)); } diff --git a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvSchemaFactory.java b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvSchemaFactory.java index cadeb598269..79b96af9cc9 100644 --- a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvSchemaFactory.java +++ b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvSchemaFactory.java @@ -39,7 +39,7 @@ public class CsvSchemaFactory implements SchemaFactory { private CsvSchemaFactory() { } - public Schema create(SchemaPlus parentSchema, String name, + @Override public Schema create(SchemaPlus parentSchema, String name, Map operand) { final String directory = (String) operand.get("directory"); final File base = diff --git a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvStreamScannableTable.java b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvStreamScannableTable.java index 828547362bf..2854be93965 100644 --- a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvStreamScannableTable.java +++ b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvStreamScannableTable.java @@ -49,16 +49,16 @@ public class CsvStreamScannableTable extends CsvScannableTable return true; } - public String toString() { + @Override public String toString() { return "CsvStreamScannableTable"; } - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { final List fieldTypes = getFieldTypes(root.getTypeFactory()); final List fields = ImmutableIntList.identity(fieldTypes.size()); final AtomicBoolean cancelFlag = DataContext.Variable.CANCEL_FLAG.get(root); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new CsvEnumerator<>(source, cancelFlag, true, null, CsvEnumerator.arrayConverter(fieldTypes, fields, true)); } 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 965b2fbd81c..01c25904dd7 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 @@ -40,7 +40,7 @@ public class CsvStreamTableFactory implements TableFactory { public CsvStreamTableFactory() { } - public CsvTable create(SchemaPlus schema, String name, + @Override public CsvTable create(SchemaPlus schema, String name, Map operand, RelDataType rowType) { String fileName = (String) operand.get("file"); File file = new File(fileName); diff --git a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTable.java b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTable.java index 8f7cc78e075..1163cfe6ed0 100644 --- a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTable.java +++ b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTable.java @@ -43,7 +43,7 @@ public abstract class CsvTable extends AbstractTable { this.protoRowType = protoRowType; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { if (protoRowType != null) { return protoRowType.apply(typeFactory); } diff --git a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTableFactory.java b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTableFactory.java index d3e74c1f96c..1e2c6370480 100644 --- a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTableFactory.java +++ b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTableFactory.java @@ -40,7 +40,7 @@ public class CsvTableFactory implements TableFactory { public CsvTableFactory() { } - public CsvTable create(SchemaPlus schema, String name, + @Override public CsvTable create(SchemaPlus schema, String name, Map operand, RelDataType rowType) { String fileName = (String) operand.get("file"); final File base = diff --git a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTableScan.java b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTableScan.java index f591e292223..baf1fd082d7 100644 --- a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTableScan.java +++ b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTableScan.java @@ -98,7 +98,7 @@ protected CsvTableScan(RelOptCluster cluster, RelOptTable table, / ((double) table.getRowType().getFieldCount() + 2D)); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { PhysType physType = PhysTypeImpl.of( implementor.getTypeFactory(), diff --git a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTranslatableTable.java b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTranslatableTable.java index e183200e226..703c00faee0 100644 --- a/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTranslatableTable.java +++ b/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTranslatableTable.java @@ -47,7 +47,7 @@ public class CsvTranslatableTable extends CsvTable super(source, protoRowType); } - public String toString() { + @Override public String toString() { return "CsvTranslatableTable"; } @@ -57,7 +57,7 @@ public Enumerable project(final DataContext root, final int[] fields) { final AtomicBoolean cancelFlag = DataContext.Variable.CANCEL_FLAG.get(root); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new CsvEnumerator<>( source, cancelFlag, @@ -67,21 +67,21 @@ public Enumerator enumerator() { }; } - public Expression getExpression(SchemaPlus schema, String tableName, + @Override public Expression getExpression(SchemaPlus schema, String tableName, Class clazz) { return Schemas.tableExpression(schema, getElementType(), tableName, clazz); } - public Type getElementType() { + @Override public Type getElementType() { return Object[].class; } - public Queryable asQueryable(QueryProvider queryProvider, + @Override public Queryable asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { throw new UnsupportedOperationException(); } - public RelNode toRel( + @Override public RelNode toRel( RelOptTable.ToRelContext context, RelOptTable relOptTable) { // Request all fields. diff --git a/example/function/src/main/java/org/apache/calcite/example/maze/Maze.java b/example/function/src/main/java/org/apache/calcite/example/maze/Maze.java index 8f0f1bb048a..8be1e7e4606 100644 --- a/example/function/src/main/java/org/apache/calcite/example/maze/Maze.java +++ b/example/function/src/main/java/org/apache/calcite/example/maze/Maze.java @@ -114,11 +114,11 @@ public Enumerator enumerator(final Set solutionSet) { final StringBuilder b = new StringBuilder(); final StringBuilder b2 = new StringBuilder(); - public String current() { + @Override public String current() { return i % 2 == 0 ? b.toString() : b2.toString(); } - public boolean moveNext() { + @Override public boolean moveNext() { if (i >= height * 2) { return false; } @@ -131,11 +131,11 @@ public boolean moveNext() { return true; } - public void reset() { + @Override public void reset() { i = -1; } - public void close() {} + @Override public void close() {} }; } diff --git a/example/function/src/main/java/org/apache/calcite/example/maze/MazeTable.java b/example/function/src/main/java/org/apache/calcite/example/maze/MazeTable.java index 8676b6939d9..64052dd1fab 100644 --- a/example/function/src/main/java/org/apache/calcite/example/maze/MazeTable.java +++ b/example/function/src/main/java/org/apache/calcite/example/maze/MazeTable.java @@ -79,13 +79,13 @@ public static ScannableTable solve(int width, int height, int seed) { return new MazeTable(width, height, seed, true); } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return typeFactory.builder() .add("S", SqlTypeName.VARCHAR, width * 3 + 1) .build(); } - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { final Random random = seed >= 0 ? new Random(seed) : new Random(); final Maze maze = new Maze(width, height); final PrintWriter pw = Util.printWriter(System.out); @@ -94,7 +94,7 @@ public Enumerable scan(DataContext root) { maze.print(pw, true); } return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Set solutionSet; if (solution) { solutionSet = maze.solve(0, 0); diff --git a/file/src/main/java/org/apache/calcite/adapter/file/CsvEnumerator.java b/file/src/main/java/org/apache/calcite/adapter/file/CsvEnumerator.java index 091a4a18eeb..0cbcd90d7e6 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/CsvEnumerator.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/CsvEnumerator.java @@ -169,11 +169,11 @@ static CSVReader openCsv(Source source) throws IOException { return new CSVReader(source.reader()); } - public E current() { + @Override public E current() { return current; } - public boolean moveNext() { + @Override public boolean moveNext() { try { outer: for (;;) { @@ -212,11 +212,11 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { throw new UnsupportedOperationException(); } - public void close() { + @Override public void close() { try { reader.close(); } catch (IOException e) { @@ -331,7 +331,7 @@ static class ArrayRowConverter extends RowConverter { this.stream = stream; } - public Object[] convertRow(String[] strings) { + @Override public Object[] convertRow(String[] strings) { if (stream) { return convertStreamRow(strings); } else { @@ -369,7 +369,7 @@ private SingleColumnRowConverter(CsvFieldType fieldType, int fieldIndex) { this.fieldIndex = fieldIndex; } - public Object convertRow(String[] strings) { + @Override public Object convertRow(String[] strings) { return convert(fieldType, strings[fieldIndex]); } } 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 633079a260d..fecdc3d6773 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 @@ -98,7 +98,7 @@ private CsvStreamReader(Source source, char separator, char quoteChar, * * @throws IOException if bad things happen during the read */ - public String[] readNext() throws IOException { + @Override public String[] readNext() throws IOException { String[] result = null; do { String nextLine = getNextLine(); @@ -136,7 +136,7 @@ private String getNextLine() throws IOException { * * @throws IOException if the close fails */ - public void close() throws IOException { + @Override public void close() throws IOException { } /** Watches for content being appended to a CSV file. */ diff --git a/file/src/main/java/org/apache/calcite/adapter/file/CsvTable.java b/file/src/main/java/org/apache/calcite/adapter/file/CsvTable.java index 20f0023f016..1ab4e705e17 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/CsvTable.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/CsvTable.java @@ -44,7 +44,7 @@ public abstract class CsvTable extends AbstractTable { this.protoRowType = protoRowType; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { if (protoRowType != null) { return protoRowType.apply(typeFactory); } diff --git a/file/src/main/java/org/apache/calcite/adapter/file/CsvTableFactory.java b/file/src/main/java/org/apache/calcite/adapter/file/CsvTableFactory.java index 75e992b7ef0..3809bad5d8a 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/CsvTableFactory.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/CsvTableFactory.java @@ -40,7 +40,7 @@ public class CsvTableFactory implements TableFactory { public CsvTableFactory() { } - public CsvTable create(SchemaPlus schema, String name, + @Override public CsvTable create(SchemaPlus schema, String name, Map operand, RelDataType rowType) { String fileName = (String) operand.get("file"); final File base = diff --git a/file/src/main/java/org/apache/calcite/adapter/file/CsvTableScan.java b/file/src/main/java/org/apache/calcite/adapter/file/CsvTableScan.java index 8d6eb87c9d5..9343e4089e8 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/CsvTableScan.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/CsvTableScan.java @@ -97,7 +97,7 @@ protected CsvTableScan(RelOptCluster cluster, RelOptTable table, / ((double) table.getRowType().getFieldCount() + 2D)); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { PhysType physType = PhysTypeImpl.of( implementor.getTypeFactory(), diff --git a/file/src/main/java/org/apache/calcite/adapter/file/CsvTranslatableTable.java b/file/src/main/java/org/apache/calcite/adapter/file/CsvTranslatableTable.java index 9f86c539432..2175f2d332e 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/CsvTranslatableTable.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/CsvTranslatableTable.java @@ -49,7 +49,7 @@ public class CsvTranslatableTable extends CsvTable super(source, protoRowType); } - public String toString() { + @Override public String toString() { return "CsvTranslatableTable"; } @@ -59,28 +59,28 @@ public Enumerable project(final DataContext root, final int[] fields) { final AtomicBoolean cancelFlag = DataContext.Variable.CANCEL_FLAG.get(root); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new CsvEnumerator<>(source, cancelFlag, getFieldTypes(root.getTypeFactory()), ImmutableIntList.of(fields)); } }; } - public Expression getExpression(SchemaPlus schema, String tableName, + @Override public Expression getExpression(SchemaPlus schema, String tableName, Class clazz) { return Schemas.tableExpression(schema, getElementType(), tableName, clazz); } - public Type getElementType() { + @Override public Type getElementType() { return Object[].class; } - public Queryable asQueryable(QueryProvider queryProvider, + @Override public Queryable asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { throw new UnsupportedOperationException(); } - public RelNode toRel( + @Override public RelNode toRel( RelOptTable.ToRelContext context, RelOptTable relOptTable) { // Request all fields. diff --git a/file/src/main/java/org/apache/calcite/adapter/file/FileEnumerator.java b/file/src/main/java/org/apache/calcite/adapter/file/FileEnumerator.java index 24614bb8d94..6b0ce467021 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/FileEnumerator.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/FileEnumerator.java @@ -43,14 +43,14 @@ class FileEnumerator implements Enumerator { this.fields = fields; } - public Object current() { + @Override public Object current() { if (current == null) { this.moveNext(); } return current; } - public boolean moveNext() { + @Override public boolean moveNext() { try { if (this.iterator.hasNext()) { final Elements row = this.iterator.next(); @@ -68,12 +68,12 @@ public boolean moveNext() { } // required by linq4j Enumerator interface - public void reset() { + @Override public void reset() { throw new UnsupportedOperationException(); } // required by linq4j Enumerator interface - public void close() { + @Override public void close() { } /** Returns an array of integers {0, ..., n - 1}. */ diff --git a/file/src/main/java/org/apache/calcite/adapter/file/FileReader.java b/file/src/main/java/org/apache/calcite/adapter/file/FileReader.java index 736e065c3ef..db2636ca433 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/FileReader.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/FileReader.java @@ -149,7 +149,7 @@ private String tableKey() { return "Table: {url: " + this.source + ", selector: " + this.selector + "}"; } - public FileReaderIterator iterator() { + @Override public FileReaderIterator iterator() { if (this.tableElement == null) { try { getTable(); @@ -202,7 +202,7 @@ private static class FileReaderIterator implements Iterator { this.rowIterator = rows.iterator(); } - public boolean hasNext() { + @Override public boolean hasNext() { return this.rowIterator.hasNext(); } @@ -213,11 +213,11 @@ Elements next(String selector) { } // return th and td elements by default - public Elements next() { + @Override public Elements next() { return next("th,td"); } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException("NFW - can't remove!"); } } diff --git a/file/src/main/java/org/apache/calcite/adapter/file/FileSchemaFactory.java b/file/src/main/java/org/apache/calcite/adapter/file/FileSchemaFactory.java index f0cc65451ac..43d952bbac5 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/FileSchemaFactory.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/FileSchemaFactory.java @@ -43,7 +43,7 @@ public class FileSchemaFactory implements SchemaFactory { private FileSchemaFactory() { } - public Schema create(SchemaPlus parentSchema, String name, + @Override public Schema create(SchemaPlus parentSchema, String name, Map operand) { @SuppressWarnings("unchecked") List> tables = (List) operand.get("tables"); diff --git a/file/src/main/java/org/apache/calcite/adapter/file/FileTable.java b/file/src/main/java/org/apache/calcite/adapter/file/FileTable.java index e6e76f94916..a71d2372241 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/FileTable.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/FileTable.java @@ -71,26 +71,26 @@ static FileTable create(Source source, Map tableDef) return new FileTable(source, selector, index, null, fieldConfigs); } - public String toString() { + @Override public String toString() { return "FileTable"; } - public Statistic getStatistic() { + @Override public Statistic getStatistic() { return Statistics.UNKNOWN; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { if (protoRowType != null) { return protoRowType.apply(typeFactory); } return this.converter.getRowType((JavaTypeFactory) typeFactory); } - public Queryable asQueryable(QueryProvider queryProvider, + @Override public Queryable asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { return new AbstractTableQueryable(queryProvider, schema, this, tableName) { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { try { FileEnumerator enumerator = new FileEnumerator(reader.iterator(), converter); @@ -106,7 +106,7 @@ public Enumerator enumerator() { /** Returns an enumerable over a given projection of the fields. */ public Enumerable project(final int[] fields) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { try { return new FileEnumerator(reader.iterator(), converter, fields); } catch (Exception e) { @@ -116,7 +116,7 @@ public Enumerator enumerator() { }; } - public RelNode toRel(RelOptTable.ToRelContext context, + @Override public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable) { return new EnumerableTableScan(context.getCluster(), context.getCluster().traitSetOf(EnumerableConvention.INSTANCE), diff --git a/file/src/main/java/org/apache/calcite/adapter/file/FileTableScan.java b/file/src/main/java/org/apache/calcite/adapter/file/FileTableScan.java index 7ec452962bb..4200ed569a5 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/FileTableScan.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/FileTableScan.java @@ -78,7 +78,7 @@ protected FileTableScan(RelOptCluster cluster, RelOptTable table, return builder.build(); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { PhysType physType = PhysTypeImpl.of( implementor.getTypeFactory(), diff --git a/file/src/main/java/org/apache/calcite/adapter/file/JsonEnumerator.java b/file/src/main/java/org/apache/calcite/adapter/file/JsonEnumerator.java index 7fd06405198..27fd5713e84 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/JsonEnumerator.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/JsonEnumerator.java @@ -119,19 +119,19 @@ static JsonDataConverter deduceRowType(RelDataTypeFactory typeFactory, Source so return new JsonDataConverter(relDataType, list); } - public Object[] current() { + @Override public Object[] current() { return enumerator.current(); } - public boolean moveNext() { + @Override public boolean moveNext() { return enumerator.moveNext(); } - public void reset() { + @Override public void reset() { enumerator.reset(); } - public void close() { + @Override public void close() { enumerator.close(); } diff --git a/file/src/main/java/org/apache/calcite/adapter/file/JsonScannableTable.java b/file/src/main/java/org/apache/calcite/adapter/file/JsonScannableTable.java index 2210b7e0a58..fe6010ad066 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/JsonScannableTable.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/JsonScannableTable.java @@ -38,13 +38,13 @@ public JsonScannableTable(Source source) { super(source); } - public String toString() { + @Override public String toString() { return "JsonScannableTable"; } - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new JsonEnumerator(getDataList(root.getTypeFactory())); } }; diff --git a/file/src/main/java/org/apache/calcite/adapter/file/JsonTable.java b/file/src/main/java/org/apache/calcite/adapter/file/JsonTable.java index 5fade31f160..17f2da8bdf7 100644 --- a/file/src/main/java/org/apache/calcite/adapter/file/JsonTable.java +++ b/file/src/main/java/org/apache/calcite/adapter/file/JsonTable.java @@ -38,7 +38,7 @@ public JsonTable(Source source) { this.source = source; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { if (rowType == null) { rowType = JsonEnumerator.deduceRowType(typeFactory, source).getRelDataType(); } @@ -55,7 +55,7 @@ public List getDataList(RelDataTypeFactory typeFactory) { return dataList; } - public Statistic getStatistic() { + @Override public Statistic getStatistic() { return Statistics.UNKNOWN; } } diff --git a/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeSchemaFactory.java b/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeSchemaFactory.java index 2a08b2946b6..1c3ad623d41 100644 --- a/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeSchemaFactory.java +++ b/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeSchemaFactory.java @@ -46,7 +46,7 @@ public GeodeSchemaFactory() { // Do Nothing } - public synchronized Schema create(SchemaPlus parentSchema, String name, + @Override public synchronized Schema create(SchemaPlus parentSchema, String name, Map operand) { Map map = (Map) operand; String locatorHost = (String) map.get(LOCATOR_HOST); diff --git a/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeTable.java b/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeTable.java index bbbd7f7da6b..1ff44c34653 100644 --- a/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeTable.java +++ b/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeTable.java @@ -70,7 +70,7 @@ public class GeodeTable extends AbstractQueryableTable implements TranslatableTa this.rowType = GeodeUtils.autodetectRelTypeFromRegion(region); } - public String toString() { + @Override public String toString() { return "GeodeTable {" + regionName + "}"; } @@ -195,7 +195,7 @@ public Enumerable query(final GemFireCache clientCache, LOGGER.info("OQL: " + oqlQuery); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final QueryService queryService = clientCache.getQueryService(); try { SelectResults results = (SelectResults) queryService.newQuery(oqlQuery).execute(); @@ -209,7 +209,7 @@ public Enumerator enumerator() { }; } - public Queryable asQueryable(QueryProvider queryProvider, + @Override public Queryable asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { return new GeodeQueryable<>(queryProvider, schema, this, tableName); } @@ -240,7 +240,7 @@ public GeodeQueryable(QueryProvider queryProvider, SchemaPlus schema, } // tzolov: this should never be called for queryable tables??? - public Enumerator enumerator() { + @Override public Enumerator enumerator() { throw new UnsupportedOperationException("Enumerator on Queryable should never be called"); } diff --git a/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeToEnumerableConverter.java b/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeToEnumerableConverter.java index c8649c610af..fc87daff749 100644 --- a/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeToEnumerableConverter.java +++ b/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeToEnumerableConverter.java @@ -98,11 +98,11 @@ protected GeodeToEnumerableConverter(RelOptCluster cluster, pref.prefer(JavaRowFormat.ARRAY)); final List physFieldClasses = new AbstractList() { - public Class get(int index) { + @Override public Class get(int index) { return physType.fieldClass(index); } - public int size() { + @Override public int size() { return rowType.getFieldCount(); } }; diff --git a/geode/src/main/java/org/apache/calcite/adapter/geode/simple/GeodeSimpleScannableTable.java b/geode/src/main/java/org/apache/calcite/adapter/geode/simple/GeodeSimpleScannableTable.java index 6a94dbdf873..ddeeab2b25f 100644 --- a/geode/src/main/java/org/apache/calcite/adapter/geode/simple/GeodeSimpleScannableTable.java +++ b/geode/src/main/java/org/apache/calcite/adapter/geode/simple/GeodeSimpleScannableTable.java @@ -57,7 +57,7 @@ public GeodeSimpleScannableTable(String regionName, RelDataType relDataType, @Override public Enumerable scan(DataContext root) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new GeodeSimpleEnumerator(clientCache, regionName) { @Override public Object[] convert(Object obj) { Object values = convertToRowValues(relDataType.getFieldList(), obj); diff --git a/kafka/src/main/java/org/apache/calcite/adapter/kafka/KafkaStreamTable.java b/kafka/src/main/java/org/apache/calcite/adapter/kafka/KafkaStreamTable.java index 6e6dc2d5b65..334e7a6baae 100644 --- a/kafka/src/main/java/org/apache/calcite/adapter/kafka/KafkaStreamTable.java +++ b/kafka/src/main/java/org/apache/calcite/adapter/kafka/KafkaStreamTable.java @@ -59,7 +59,7 @@ public class KafkaStreamTable implements ScannableTable, StreamableTable { @Override public Enumerable scan(final DataContext root) { final AtomicBoolean cancelFlag = DataContext.Variable.CANCEL_FLAG.get(root); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { if (tableOptions.getConsumer() != null) { return new KafkaMessageEnumerator(tableOptions.getConsumer(), tableOptions.getRowConverter(), cancelFlag); 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 5c141e42385..d89614df364 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable.java @@ -29,7 +29,7 @@ * @param Element type */ public abstract class AbstractEnumerable extends DefaultEnumerable { - public Iterator iterator() { + @Override public Iterator iterator() { return Linq4j.enumeratorIterator(enumerator()); } } 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 32585e2293f..774c9210eb5 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable2.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/AbstractEnumerable2.java @@ -27,7 +27,7 @@ * @param Element type */ public abstract class AbstractEnumerable2 extends DefaultEnumerable { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Linq4j.IterableEnumerator<>(this); } } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/BaseQueryable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/BaseQueryable.java index fe4a6350622..f0918b29034 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/BaseQueryable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/BaseQueryable.java @@ -43,23 +43,23 @@ public BaseQueryable(QueryProvider provider, Type elementType, this.expression = expression; } - public QueryProvider getProvider() { + @Override public QueryProvider getProvider() { return provider; } - public Type getElementType() { + @Override public Type getElementType() { return elementType; } - public Expression getExpression() { + @Override public Expression getExpression() { return expression; } - public Iterator iterator() { + @Override public Iterator iterator() { return Linq4j.enumeratorIterator(enumerator()); } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return provider.executeQuery(this); } } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/CartesianProductEnumerator.java b/linq4j/src/main/java/org/apache/calcite/linq4j/CartesianProductEnumerator.java index 84bf1d35d80..0ac16b06512 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/CartesianProductEnumerator.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/CartesianProductEnumerator.java @@ -35,7 +35,7 @@ protected CartesianProductEnumerator(List> enumerators) { this.elements = (T[]) new Object[enumerators.size()]; } - public boolean moveNext() { + @Override public boolean moveNext() { if (first) { int i = 0; for (Enumerator enumerator : enumerators) { @@ -65,14 +65,14 @@ public boolean moveNext() { return false; } - public void reset() { + @Override public void reset() { first = true; for (Enumerator enumerator : enumerators) { enumerator.reset(); } } - public void close() { + @Override public void close() { // If there is one or more exceptions, carry on and close all enumerators, // then throw the first. Throwable rte = null; 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 3cc4c9ed0c8..17cafd2b496 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultEnumerable.java @@ -69,7 +69,7 @@ protected OrderedEnumerable getThisOrdered() { return this; } - public R foreach(Function1 func) { + @Override public R foreach(Function1 func) { R result = null; try (Enumerator enumerator = enumerator()) { while (enumerator.moveNext()) { @@ -80,7 +80,7 @@ public R foreach(Function1 func) { } } - public Queryable asQueryable() { + @Override public Queryable asQueryable() { return Extensions.asQueryable(this); } @@ -89,189 +89,189 @@ protected OrderedQueryable asOrderedQueryable() { return EnumerableDefaults.asOrderedQueryable(this); } - public T aggregate(Function2 func) { + @Override public T aggregate(Function2 func) { return EnumerableDefaults.aggregate(getThis(), func); } - public TAccumulate aggregate(TAccumulate seed, + @Override public TAccumulate aggregate(TAccumulate seed, Function2 func) { return EnumerableDefaults.aggregate(getThis(), seed, func); } - public TResult aggregate(TAccumulate seed, + @Override public TResult aggregate(TAccumulate seed, Function2 func, Function1 selector) { return EnumerableDefaults.aggregate(getThis(), seed, func, selector); } - public boolean all(Predicate1 predicate) { + @Override public boolean all(Predicate1 predicate) { return EnumerableDefaults.all(getThis(), predicate); } - public boolean any() { + @Override public boolean any() { return EnumerableDefaults.any(getThis()); } - public boolean any(Predicate1 predicate) { + @Override public boolean any(Predicate1 predicate) { return EnumerableDefaults.any(getThis(), predicate); } - public Enumerable asEnumerable() { + @Override public Enumerable asEnumerable() { return EnumerableDefaults.asEnumerable(getThis()); } - public BigDecimal average(BigDecimalFunction1 selector) { + @Override public BigDecimal average(BigDecimalFunction1 selector) { return EnumerableDefaults.average(getThis(), selector); } - public BigDecimal average(NullableBigDecimalFunction1 selector) { + @Override public BigDecimal average(NullableBigDecimalFunction1 selector) { return EnumerableDefaults.average(getThis(), selector); } - public double average(DoubleFunction1 selector) { + @Override public double average(DoubleFunction1 selector) { return EnumerableDefaults.average(getThis(), selector); } - public Double average(NullableDoubleFunction1 selector) { + @Override public Double average(NullableDoubleFunction1 selector) { return EnumerableDefaults.average(getThis(), selector); } - public int average(IntegerFunction1 selector) { + @Override public int average(IntegerFunction1 selector) { return EnumerableDefaults.average(getThis(), selector); } - public Integer average(NullableIntegerFunction1 selector) { + @Override public Integer average(NullableIntegerFunction1 selector) { return EnumerableDefaults.average(getThis(), selector); } - public long average(LongFunction1 selector) { + @Override public long average(LongFunction1 selector) { return EnumerableDefaults.average(getThis(), selector); } - public Long average(NullableLongFunction1 selector) { + @Override public Long average(NullableLongFunction1 selector) { return EnumerableDefaults.average(getThis(), selector); } - public float average(FloatFunction1 selector) { + @Override public float average(FloatFunction1 selector) { return EnumerableDefaults.average(getThis(), selector); } - public Float average(NullableFloatFunction1 selector) { + @Override public Float average(NullableFloatFunction1 selector) { return EnumerableDefaults.average(getThis(), selector); } - public Enumerable cast(Class clazz) { + @Override public Enumerable cast(Class clazz) { return EnumerableDefaults.cast(getThis(), clazz); } - public Enumerable concat(Enumerable enumerable1) { + @Override public Enumerable concat(Enumerable enumerable1) { return EnumerableDefaults.concat(getThis(), enumerable1); } - public boolean contains(T element) { + @Override public boolean contains(T element) { return EnumerableDefaults.contains(getThis(), element); } - public boolean contains(T element, EqualityComparer comparer) { + @Override public boolean contains(T element, EqualityComparer comparer) { return EnumerableDefaults.contains(getThis(), element, comparer); } - public int count() { + @Override public int count() { return EnumerableDefaults.count(getThis()); } - public int count(Predicate1 predicate) { + @Override public int count(Predicate1 predicate) { return EnumerableDefaults.count(getThis(), predicate); } - public OrderedEnumerable createOrderedEnumerable( + @Override public OrderedEnumerable createOrderedEnumerable( Function1 keySelector, Comparator comparator, boolean descending) { return EnumerableDefaults.createOrderedEnumerable(getThisOrdered(), keySelector, comparator, descending); } - public Enumerable defaultIfEmpty() { + @Override public Enumerable defaultIfEmpty() { return EnumerableDefaults.defaultIfEmpty(getThis()); } - public Enumerable defaultIfEmpty(T value) { + @Override public Enumerable defaultIfEmpty(T value) { return EnumerableDefaults.defaultIfEmpty(getThis(), value); } - public Enumerable distinct() { + @Override public Enumerable distinct() { return EnumerableDefaults.distinct(getThis()); } - public Enumerable distinct(EqualityComparer comparer) { + @Override public Enumerable distinct(EqualityComparer comparer) { return EnumerableDefaults.distinct(getThis(), comparer); } - public T elementAt(int index) { + @Override public T elementAt(int index) { return EnumerableDefaults.elementAt(getThis(), index); } - public T elementAtOrDefault(int index) { + @Override public T elementAtOrDefault(int index) { return EnumerableDefaults.elementAtOrDefault(getThis(), index); } - public Enumerable except(Enumerable enumerable1) { + @Override public Enumerable except(Enumerable enumerable1) { return except(enumerable1, false); } - public Enumerable except(Enumerable enumerable1, boolean all) { + @Override public Enumerable except(Enumerable enumerable1, boolean all) { return EnumerableDefaults.except(getThis(), enumerable1, all); } - public Enumerable except(Enumerable enumerable1, + @Override public Enumerable except(Enumerable enumerable1, EqualityComparer comparer) { return except(enumerable1, comparer, false); } - public Enumerable except(Enumerable enumerable1, + @Override public Enumerable except(Enumerable enumerable1, EqualityComparer comparer, boolean all) { return EnumerableDefaults.except(getThis(), enumerable1, comparer, all); } - public T first() { + @Override public T first() { return EnumerableDefaults.first(getThis()); } - public T first(Predicate1 predicate) { + @Override public T first(Predicate1 predicate) { return EnumerableDefaults.first(getThis(), predicate); } - public T firstOrDefault() { + @Override public T firstOrDefault() { return EnumerableDefaults.firstOrDefault(getThis()); } - public T firstOrDefault(Predicate1 predicate) { + @Override public T firstOrDefault(Predicate1 predicate) { return EnumerableDefaults.firstOrDefault(getThis(), predicate); } - public Enumerable> groupBy( + @Override public Enumerable> groupBy( Function1 keySelector) { return EnumerableDefaults.groupBy(getThis(), keySelector); } - public Enumerable> groupBy( + @Override public Enumerable> groupBy( Function1 keySelector, EqualityComparer comparer) { return EnumerableDefaults.groupBy(getThis(), keySelector, comparer); } - public Enumerable> groupBy( + @Override public Enumerable> groupBy( Function1 keySelector, Function1 elementSelector) { return EnumerableDefaults.groupBy(getThis(), keySelector, elementSelector); } - public Enumerable> groupBy( + @Override public Enumerable> groupBy( Function1 keySelector, Function1 elementSelector, EqualityComparer comparer) { return EnumerableDefaults.groupBy(getThis(), keySelector, elementSelector, comparer); } - public Enumerable groupBy( + @Override public Enumerable groupBy( Function1 keySelector, Function2, TResult> elementSelector, EqualityComparer comparer) { @@ -279,20 +279,20 @@ public Enumerable groupBy( comparer); } - public Enumerable groupBy( + @Override public Enumerable groupBy( Function1 keySelector, Function2, TResult> resultSelector) { return EnumerableDefaults.groupBy(getThis(), keySelector, resultSelector); } - public Enumerable groupBy( + @Override public Enumerable groupBy( Function1 keySelector, Function1 elementSelector, Function2, TResult> resultSelector) { return EnumerableDefaults.groupBy(getThis(), keySelector, elementSelector, resultSelector); } - public Enumerable groupBy( + @Override public Enumerable groupBy( Function1 keySelector, Function1 elementSelector, Function2, TResult> resultSelector, EqualityComparer comparer) { @@ -300,7 +300,7 @@ public Enumerable groupBy( resultSelector, comparer); } - public Enumerable groupBy( + @Override public Enumerable groupBy( Function1 keySelector, Function0 accumulatorInitializer, Function2 accumulatorAdder, @@ -309,7 +309,7 @@ public Enumerable groupBy( accumulatorInitializer, accumulatorAdder, resultSelector); } - public Enumerable groupBy( + @Override public Enumerable groupBy( Function1 keySelector, Function0 accumulatorInitializer, Function2 accumulatorAdder, @@ -319,7 +319,7 @@ public Enumerable groupBy( accumulatorInitializer, accumulatorAdder, resultSelector, comparer); } - public Enumerable sortedGroupBy( + @Override public Enumerable sortedGroupBy( Function1 keySelector, Function0 accumulatorInitializer, Function2 accumulatorAdder, @@ -330,7 +330,7 @@ public Enumerable sortedGroupBy( accumulatorAdder, resultSelector, comparator); } - public Enumerable groupJoin( + @Override public Enumerable groupJoin( Enumerable inner, Function1 outerKeySelector, Function1 innerKeySelector, Function2, TResult> resultSelector) { @@ -338,7 +338,7 @@ public Enumerable groupJoin( innerKeySelector, resultSelector); } - public Enumerable groupJoin( + @Override public Enumerable groupJoin( Enumerable inner, Function1 outerKeySelector, Function1 innerKeySelector, Function2, TResult> resultSelector, @@ -347,33 +347,33 @@ public Enumerable groupJoin( innerKeySelector, resultSelector, comparer); } - public Enumerable intersect(Enumerable enumerable1) { + @Override public Enumerable intersect(Enumerable enumerable1) { return intersect(enumerable1, false); } - public Enumerable intersect(Enumerable enumerable1, boolean all) { + @Override public Enumerable intersect(Enumerable enumerable1, boolean all) { return EnumerableDefaults.intersect(getThis(), enumerable1, all); } - public Enumerable intersect(Enumerable enumerable1, + @Override public Enumerable intersect(Enumerable enumerable1, EqualityComparer comparer) { return intersect(enumerable1, comparer, false); } - public Enumerable intersect(Enumerable enumerable1, + @Override public Enumerable intersect(Enumerable enumerable1, EqualityComparer comparer, boolean all) { return EnumerableDefaults.intersect(getThis(), enumerable1, comparer, all); } - public > C into(C sink) { + @Override public > C into(C sink) { return EnumerableDefaults.into(getThis(), sink); } - public > C removeAll(C sink) { + @Override public > C removeAll(C sink) { return EnumerableDefaults.remove(getThis(), sink); } - public Enumerable hashJoin( + @Override public Enumerable hashJoin( Enumerable inner, Function1 outerKeySelector, Function1 innerKeySelector, Function2 resultSelector) { @@ -381,7 +381,7 @@ public Enumerable hashJoin( innerKeySelector, resultSelector); } - public Enumerable hashJoin( + @Override public Enumerable hashJoin( Enumerable inner, Function1 outerKeySelector, Function1 innerKeySelector, Function2 resultSelector, @@ -390,7 +390,7 @@ public Enumerable hashJoin( innerKeySelector, resultSelector, comparer); } - public Enumerable hashJoin( + @Override public Enumerable hashJoin( Enumerable inner, Function1 outerKeySelector, Function1 innerKeySelector, Function2 resultSelector, @@ -401,7 +401,7 @@ public Enumerable hashJoin( generateNullsOnRight); } - public Enumerable hashJoin( + @Override public Enumerable hashJoin( Enumerable inner, Function1 outerKeySelector, Function1 innerKeySelector, Function2 resultSelector, @@ -413,371 +413,371 @@ public Enumerable hashJoin( generateNullsOnRight, predicate); } - public Enumerable correlateJoin( + @Override public Enumerable correlateJoin( JoinType joinType, Function1> inner, Function2 resultSelector) { return EnumerableDefaults.correlateJoin(joinType, getThis(), inner, resultSelector); } - public T last() { + @Override public T last() { return EnumerableDefaults.last(getThis()); } - public T last(Predicate1 predicate) { + @Override public T last(Predicate1 predicate) { return EnumerableDefaults.last(getThis(), predicate); } - public T lastOrDefault() { + @Override public T lastOrDefault() { return EnumerableDefaults.lastOrDefault(getThis()); } - public T lastOrDefault(Predicate1 predicate) { + @Override public T lastOrDefault(Predicate1 predicate) { return EnumerableDefaults.lastOrDefault(getThis(), predicate); } - public long longCount() { + @Override public long longCount() { return EnumerableDefaults.longCount(getThis()); } - public long longCount(Predicate1 predicate) { + @Override public long longCount(Predicate1 predicate) { return EnumerableDefaults.longCount(getThis(), predicate); } - public T max() { + @Override public T max() { return (T) EnumerableDefaults.max((Enumerable) getThis()); } - public BigDecimal max(BigDecimalFunction1 selector) { + @Override public BigDecimal max(BigDecimalFunction1 selector) { return EnumerableDefaults.max(getThis(), selector); } - public BigDecimal max(NullableBigDecimalFunction1 selector) { + @Override public BigDecimal max(NullableBigDecimalFunction1 selector) { return EnumerableDefaults.max(getThis(), selector); } - public double max(DoubleFunction1 selector) { + @Override public double max(DoubleFunction1 selector) { return EnumerableDefaults.max(getThis(), selector); } - public Double max(NullableDoubleFunction1 selector) { + @Override public Double max(NullableDoubleFunction1 selector) { return EnumerableDefaults.max(getThis(), selector); } - public int max(IntegerFunction1 selector) { + @Override public int max(IntegerFunction1 selector) { return EnumerableDefaults.max(getThis(), selector); } - public Integer max(NullableIntegerFunction1 selector) { + @Override public Integer max(NullableIntegerFunction1 selector) { return EnumerableDefaults.max(getThis(), selector); } - public long max(LongFunction1 selector) { + @Override public long max(LongFunction1 selector) { return EnumerableDefaults.max(getThis(), selector); } - public Long max(NullableLongFunction1 selector) { + @Override public Long max(NullableLongFunction1 selector) { return EnumerableDefaults.max(getThis(), selector); } - public float max(FloatFunction1 selector) { + @Override public float max(FloatFunction1 selector) { return EnumerableDefaults.max(getThis(), selector); } - public Float max(NullableFloatFunction1 selector) { + @Override public Float max(NullableFloatFunction1 selector) { return EnumerableDefaults.max(getThis(), selector); } - public > TResult max( + @Override public > TResult max( Function1 selector) { return EnumerableDefaults.max(getThis(), selector); } - public T min() { + @Override public T min() { return (T) EnumerableDefaults.min((Enumerable) getThis()); } - public BigDecimal min(BigDecimalFunction1 selector) { + @Override public BigDecimal min(BigDecimalFunction1 selector) { return EnumerableDefaults.min(getThis(), selector); } - public BigDecimal min(NullableBigDecimalFunction1 selector) { + @Override public BigDecimal min(NullableBigDecimalFunction1 selector) { return EnumerableDefaults.min(getThis(), selector); } - public double min(DoubleFunction1 selector) { + @Override public double min(DoubleFunction1 selector) { return EnumerableDefaults.min(getThis(), selector); } - public Double min(NullableDoubleFunction1 selector) { + @Override public Double min(NullableDoubleFunction1 selector) { return EnumerableDefaults.min(getThis(), selector); } - public int min(IntegerFunction1 selector) { + @Override public int min(IntegerFunction1 selector) { return EnumerableDefaults.min(getThis(), selector); } - public Integer min(NullableIntegerFunction1 selector) { + @Override public Integer min(NullableIntegerFunction1 selector) { return EnumerableDefaults.min(getThis(), selector); } - public long min(LongFunction1 selector) { + @Override public long min(LongFunction1 selector) { return EnumerableDefaults.min(getThis(), selector); } - public Long min(NullableLongFunction1 selector) { + @Override public Long min(NullableLongFunction1 selector) { return EnumerableDefaults.min(getThis(), selector); } - public float min(FloatFunction1 selector) { + @Override public float min(FloatFunction1 selector) { return EnumerableDefaults.min(getThis(), selector); } - public Float min(NullableFloatFunction1 selector) { + @Override public Float min(NullableFloatFunction1 selector) { return EnumerableDefaults.min(getThis(), selector); } - public > TResult min( + @Override public > TResult min( Function1 selector) { return EnumerableDefaults.min(getThis(), selector); } - public Enumerable ofType(Class clazz) { + @Override public Enumerable ofType(Class clazz) { return EnumerableDefaults.ofType(getThis(), clazz); } - public Enumerable orderBy( + @Override public Enumerable orderBy( Function1 keySelector) { return EnumerableDefaults.orderBy(getThis(), keySelector); } - public Enumerable orderBy(Function1 keySelector, + @Override public Enumerable orderBy(Function1 keySelector, Comparator comparator) { return EnumerableDefaults.orderBy(getThis(), keySelector, comparator); } - public Enumerable orderByDescending( + @Override public Enumerable orderByDescending( Function1 keySelector) { return EnumerableDefaults.orderByDescending(getThis(), keySelector); } - public Enumerable orderByDescending(Function1 keySelector, + @Override public Enumerable orderByDescending(Function1 keySelector, Comparator comparator) { return EnumerableDefaults.orderByDescending(getThis(), keySelector, comparator); } - public Enumerable reverse() { + @Override public Enumerable reverse() { return EnumerableDefaults.reverse(getThis()); } - public Enumerable select(Function1 selector) { + @Override public Enumerable select(Function1 selector) { return EnumerableDefaults.select(getThis(), selector); } - public Enumerable select( + @Override public Enumerable select( Function2 selector) { return EnumerableDefaults.select(getThis(), selector); } - public Enumerable selectMany( + @Override public Enumerable selectMany( Function1> selector) { return EnumerableDefaults.selectMany(getThis(), selector); } - public Enumerable selectMany( + @Override public Enumerable selectMany( Function2> selector) { return EnumerableDefaults.selectMany(getThis(), selector); } - public Enumerable selectMany( + @Override public Enumerable selectMany( Function2> collectionSelector, Function2 resultSelector) { return EnumerableDefaults.selectMany(getThis(), collectionSelector, resultSelector); } - public Enumerable selectMany( + @Override public Enumerable selectMany( Function1> collectionSelector, Function2 resultSelector) { return EnumerableDefaults.selectMany(getThis(), collectionSelector, resultSelector); } - public boolean sequenceEqual(Enumerable enumerable1) { + @Override public boolean sequenceEqual(Enumerable enumerable1) { return EnumerableDefaults.sequenceEqual(getThis(), enumerable1); } - public boolean sequenceEqual(Enumerable enumerable1, + @Override public boolean sequenceEqual(Enumerable enumerable1, EqualityComparer comparer) { return EnumerableDefaults.sequenceEqual(getThis(), enumerable1, comparer); } - public T single() { + @Override public T single() { return EnumerableDefaults.single(getThis()); } - public T single(Predicate1 predicate) { + @Override public T single(Predicate1 predicate) { return EnumerableDefaults.single(getThis(), predicate); } - public T singleOrDefault() { + @Override public T singleOrDefault() { return EnumerableDefaults.singleOrDefault(getThis()); } - public T singleOrDefault(Predicate1 predicate) { + @Override public T singleOrDefault(Predicate1 predicate) { return EnumerableDefaults.singleOrDefault(getThis(), predicate); } - public Enumerable skip(int count) { + @Override public Enumerable skip(int count) { return EnumerableDefaults.skip(getThis(), count); } - public Enumerable skipWhile(Predicate1 predicate) { + @Override public Enumerable skipWhile(Predicate1 predicate) { return EnumerableDefaults.skipWhile(getThis(), predicate); } - public Enumerable skipWhile(Predicate2 predicate) { + @Override public Enumerable skipWhile(Predicate2 predicate) { return EnumerableDefaults.skipWhile(getThis(), predicate); } - public BigDecimal sum(BigDecimalFunction1 selector) { + @Override public BigDecimal sum(BigDecimalFunction1 selector) { return EnumerableDefaults.sum(getThis(), selector); } - public BigDecimal sum(NullableBigDecimalFunction1 selector) { + @Override public BigDecimal sum(NullableBigDecimalFunction1 selector) { return EnumerableDefaults.sum(getThis(), selector); } - public double sum(DoubleFunction1 selector) { + @Override public double sum(DoubleFunction1 selector) { return EnumerableDefaults.sum(getThis(), selector); } - public Double sum(NullableDoubleFunction1 selector) { + @Override public Double sum(NullableDoubleFunction1 selector) { return EnumerableDefaults.sum(getThis(), selector); } - public int sum(IntegerFunction1 selector) { + @Override public int sum(IntegerFunction1 selector) { return EnumerableDefaults.sum(getThis(), selector); } - public Integer sum(NullableIntegerFunction1 selector) { + @Override public Integer sum(NullableIntegerFunction1 selector) { return EnumerableDefaults.sum(getThis(), selector); } - public long sum(LongFunction1 selector) { + @Override public long sum(LongFunction1 selector) { return EnumerableDefaults.sum(getThis(), selector); } - public Long sum(NullableLongFunction1 selector) { + @Override public Long sum(NullableLongFunction1 selector) { return EnumerableDefaults.sum(getThis(), selector); } - public float sum(FloatFunction1 selector) { + @Override public float sum(FloatFunction1 selector) { return EnumerableDefaults.sum(getThis(), selector); } - public Float sum(NullableFloatFunction1 selector) { + @Override public Float sum(NullableFloatFunction1 selector) { return EnumerableDefaults.sum(getThis(), selector); } - public Enumerable take(int count) { + @Override public Enumerable take(int count) { return EnumerableDefaults.take(getThis(), count); } - public Enumerable takeWhile(Predicate1 predicate) { + @Override public Enumerable takeWhile(Predicate1 predicate) { return EnumerableDefaults.takeWhile(getThis(), predicate); } - public Enumerable takeWhile(Predicate2 predicate) { + @Override public Enumerable takeWhile(Predicate2 predicate) { return EnumerableDefaults.takeWhile(getThis(), predicate); } - public > OrderedEnumerable thenBy( + @Override public > OrderedEnumerable thenBy( Function1 keySelector) { return EnumerableDefaults.thenBy(getThisOrdered(), keySelector); } - public OrderedEnumerable thenBy(Function1 keySelector, + @Override public OrderedEnumerable thenBy(Function1 keySelector, Comparator comparator) { return EnumerableDefaults.thenByDescending(getThisOrdered(), keySelector, comparator); } - public > OrderedEnumerable thenByDescending( + @Override public > OrderedEnumerable thenByDescending( Function1 keySelector) { return EnumerableDefaults.thenByDescending(getThisOrdered(), keySelector); } - public OrderedEnumerable thenByDescending( + @Override public OrderedEnumerable thenByDescending( Function1 keySelector, Comparator comparator) { return EnumerableDefaults.thenBy(getThisOrdered(), keySelector, comparator); } - public Map toMap(Function1 keySelector) { + @Override public Map toMap(Function1 keySelector) { return EnumerableDefaults.toMap(getThis(), keySelector); } - public Map toMap(Function1 keySelector, + @Override public Map toMap(Function1 keySelector, EqualityComparer comparer) { return EnumerableDefaults.toMap(getThis(), keySelector, comparer); } - public Map toMap( + @Override public Map toMap( Function1 keySelector, Function1 elementSelector) { return EnumerableDefaults.toMap(getThis(), keySelector, elementSelector); } - public Map toMap( + @Override public Map toMap( Function1 keySelector, Function1 elementSelector, EqualityComparer comparer) { return EnumerableDefaults.toMap(getThis(), keySelector, elementSelector, comparer); } - public List toList() { + @Override public List toList() { return EnumerableDefaults.toList(getThis()); } - public Lookup toLookup(Function1 keySelector) { + @Override public Lookup toLookup(Function1 keySelector) { return EnumerableDefaults.toLookup(getThis(), keySelector); } - public Lookup toLookup(Function1 keySelector, + @Override public Lookup toLookup(Function1 keySelector, EqualityComparer comparer) { return EnumerableDefaults.toLookup(getThis(), keySelector, comparer); } - public Lookup toLookup( + @Override public Lookup toLookup( Function1 keySelector, Function1 elementSelector) { return EnumerableDefaults.toLookup(getThis(), keySelector, elementSelector); } - public Lookup toLookup( + @Override public Lookup toLookup( Function1 keySelector, Function1 elementSelector, EqualityComparer comparer) { return EnumerableDefaults.toLookup(getThis(), keySelector, elementSelector, comparer); } - public Enumerable union(Enumerable source1) { + @Override public Enumerable union(Enumerable source1) { return EnumerableDefaults.union(getThis(), source1); } - public Enumerable union(Enumerable source1, + @Override public Enumerable union(Enumerable source1, EqualityComparer comparer) { return EnumerableDefaults.union(getThis(), source1, comparer); } - public Enumerable where(Predicate1 predicate) { + @Override public Enumerable where(Predicate1 predicate) { return EnumerableDefaults.where(getThis(), predicate); } - public Enumerable where(Predicate2 predicate) { + @Override public Enumerable where(Predicate2 predicate) { return EnumerableDefaults.where(getThis(), predicate); } - public Enumerable zip(Enumerable source1, + @Override public Enumerable zip(Enumerable source1, Function2 resultSelector) { return EnumerableDefaults.zip(getThis(), source1, resultSelector); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultQueryable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultQueryable.java index 4d09d433ad4..4c1eddfa787 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultQueryable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/DefaultQueryable.java @@ -72,7 +72,7 @@ protected OrderedQueryable getThisOrderedQueryable() { @Override public Enumerable asEnumerable() { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return DefaultQueryable.this.enumerator(); } }; @@ -162,129 +162,129 @@ public Enumerator enumerator() { // End disambiguate - public T aggregate(FunctionExpression> selector) { + @Override public T aggregate(FunctionExpression> selector) { return factory.aggregate(getThis(), selector); } - public TAccumulate aggregate(TAccumulate seed, + @Override public TAccumulate aggregate(TAccumulate seed, FunctionExpression> selector) { return factory.aggregate(getThis(), seed, selector); } - public TResult aggregate(TAccumulate seed, + @Override public TResult aggregate(TAccumulate seed, FunctionExpression> func, FunctionExpression> selector) { return factory.aggregate(getThis(), seed, func, selector); } - public boolean all(FunctionExpression> predicate) { + @Override public boolean all(FunctionExpression> predicate) { return factory.all(getThis(), predicate); } - public boolean any(FunctionExpression> predicate) { + @Override public boolean any(FunctionExpression> predicate) { return factory.any(getThis(), predicate); } - public BigDecimal averageBigDecimal( + @Override public BigDecimal averageBigDecimal( FunctionExpression> selector) { return factory.averageBigDecimal(getThis(), selector); } - public BigDecimal averageNullableBigDecimal( + @Override public BigDecimal averageNullableBigDecimal( FunctionExpression> selector) { return factory.averageNullableBigDecimal(getThis(), selector); } - public double averageDouble(FunctionExpression> selector) { + @Override public double averageDouble(FunctionExpression> selector) { return factory.averageDouble(getThis(), selector); } - public Double averageNullableDouble( + @Override public Double averageNullableDouble( FunctionExpression> selector) { return factory.averageNullableDouble(getThis(), selector); } - public int averageInteger(FunctionExpression> selector) { + @Override public int averageInteger(FunctionExpression> selector) { return factory.averageInteger(getThis(), selector); } - public Integer averageNullableInteger( + @Override public Integer averageNullableInteger( FunctionExpression> selector) { return factory.averageNullableInteger(getThis(), selector); } - public float averageFloat(FunctionExpression> selector) { + @Override public float averageFloat(FunctionExpression> selector) { return factory.averageFloat(getThis(), selector); } - public Float averageNullableFloat( + @Override public Float averageNullableFloat( FunctionExpression> selector) { return factory.averageNullableFloat(getThis(), selector); } - public long averageLong(FunctionExpression> selector) { + @Override public long averageLong(FunctionExpression> selector) { return factory.averageLong(getThis(), selector); } - public Long averageNullableLong( + @Override public Long averageNullableLong( FunctionExpression> selector) { return factory.averageNullableLong(getThis(), selector); } - public Queryable concat(Enumerable source2) { + @Override public Queryable concat(Enumerable source2) { return factory.concat(getThis(), source2); } - public int count(FunctionExpression> func) { + @Override public int count(FunctionExpression> func) { return factory.count(getThis(), func); } - public T first(FunctionExpression> predicate) { + @Override public T first(FunctionExpression> predicate) { return factory.first(getThis(), predicate); } - public T firstOrDefault(FunctionExpression> predicate) { + @Override public T firstOrDefault(FunctionExpression> predicate) { return factory.firstOrDefault(getThis(), predicate); } - public Queryable> groupBy( + @Override public Queryable> groupBy( FunctionExpression> keySelector) { return factory.groupBy(getThis(), keySelector); } - public Queryable> groupBy( + @Override public Queryable> groupBy( FunctionExpression> keySelector, EqualityComparer comparer) { return factory.groupBy(getThis(), keySelector, comparer); } - public Queryable> groupBy( + @Override public Queryable> groupBy( FunctionExpression> keySelector, FunctionExpression> elementSelector) { return factory.groupBy(getThis(), keySelector, elementSelector); } - public Queryable> groupBy( + @Override public Queryable> groupBy( FunctionExpression> keySelector, FunctionExpression> elementSelector, EqualityComparer comparer) { return factory.groupBy(getThis(), keySelector, elementSelector, comparer); } - public Queryable groupByK( + @Override public Queryable groupByK( FunctionExpression> keySelector, FunctionExpression, TResult>> resultSelector) { return factory.groupByK(getThis(), keySelector, resultSelector); } - public Queryable groupByK( + @Override public Queryable groupByK( FunctionExpression> keySelector, FunctionExpression, TResult>> resultSelector, EqualityComparer comparer) { return factory.groupByK(getThis(), keySelector, resultSelector, comparer); } - public Queryable groupBy( + @Override public Queryable groupBy( FunctionExpression> keySelector, FunctionExpression> elementSelector, FunctionExpression, TResult>> resultSelector) { @@ -292,7 +292,7 @@ public Queryable groupBy( resultSelector); } - public Queryable groupBy( + @Override public Queryable groupBy( FunctionExpression> keySelector, FunctionExpression> elementSelector, FunctionExpression, TResult>> resultSelector, @@ -301,7 +301,7 @@ public Queryable groupBy( resultSelector, comparer); } - public Queryable groupJoin( + @Override public Queryable groupJoin( Enumerable inner, FunctionExpression> outerKeySelector, FunctionExpression> innerKeySelector, @@ -310,7 +310,7 @@ public Queryable groupJoin( innerKeySelector, resultSelector); } - public Queryable groupJoin( + @Override public Queryable groupJoin( Enumerable inner, FunctionExpression> outerKeySelector, FunctionExpression> innerKeySelector, @@ -320,7 +320,7 @@ public Queryable groupJoin( innerKeySelector, resultSelector, comparer); } - public Queryable join( + @Override public Queryable join( Enumerable inner, FunctionExpression> outerKeySelector, FunctionExpression> innerKeySelector, @@ -329,7 +329,7 @@ public Queryable join( resultSelector); } - public Queryable join( + @Override public Queryable join( Enumerable inner, FunctionExpression> outerKeySelector, FunctionExpression> innerKeySelector, @@ -339,190 +339,190 @@ public Queryable join( resultSelector, comparer); } - public T last(FunctionExpression> predicate) { + @Override public T last(FunctionExpression> predicate) { return factory.last(getThis(), predicate); } - public T lastOrDefault(FunctionExpression> predicate) { + @Override public T lastOrDefault(FunctionExpression> predicate) { return factory.lastOrDefault(getThis(), predicate); } - public long longCount(FunctionExpression> predicate) { + @Override public long longCount(FunctionExpression> predicate) { return factory.longCount(getThis(), predicate); } - public > TResult max( + @Override public > TResult max( FunctionExpression> selector) { return factory.max(getThis(), selector); } - public > TResult min( + @Override public > TResult min( FunctionExpression> selector) { return factory.min(getThis(), selector); } - public OrderedQueryable orderBy( + @Override public OrderedQueryable orderBy( FunctionExpression> keySelector) { return factory.orderBy(getThis(), keySelector); } - public OrderedQueryable orderBy( + @Override public OrderedQueryable orderBy( FunctionExpression> keySelector, Comparator comparator) { return factory.orderBy(getThis(), keySelector, comparator); } - public OrderedQueryable orderByDescending( + @Override public OrderedQueryable orderByDescending( FunctionExpression> keySelector) { return factory.orderByDescending(getThis(), keySelector); } - public OrderedQueryable orderByDescending( + @Override public OrderedQueryable orderByDescending( FunctionExpression> keySelector, Comparator comparator) { return factory.orderByDescending(getThis(), keySelector, comparator); } - public Queryable select( + @Override public Queryable select( FunctionExpression> selector) { return factory.select(getThis(), selector); } - public Queryable selectN( + @Override public Queryable selectN( FunctionExpression> selector) { return factory.selectN(getThis(), selector); } - public Queryable selectMany( + @Override public Queryable selectMany( FunctionExpression>> selector) { return factory.selectMany(getThis(), selector); } - public Queryable selectManyN( + @Override public Queryable selectManyN( FunctionExpression>> selector) { return factory.selectManyN(getThis(), selector); } - public Queryable selectMany( + @Override public Queryable selectMany( FunctionExpression>> collectionSelector, FunctionExpression> resultSelector) { return factory.selectMany(getThis(), collectionSelector, resultSelector); } - public Queryable selectManyN( + @Override public Queryable selectManyN( FunctionExpression>> collectionSelector, FunctionExpression> resultSelector) { return factory.selectManyN(getThis(), collectionSelector, resultSelector); } - public T single(FunctionExpression> predicate) { + @Override public T single(FunctionExpression> predicate) { return factory.single(getThis(), predicate); } - public T singleOrDefault(FunctionExpression> predicate) { + @Override public T singleOrDefault(FunctionExpression> predicate) { return factory.singleOrDefault(getThis(), predicate); } - public Queryable skipWhile(FunctionExpression> predicate) { + @Override public Queryable skipWhile(FunctionExpression> predicate) { return factory.skipWhile(getThis(), predicate); } - public Queryable skipWhileN( + @Override public Queryable skipWhileN( FunctionExpression> predicate) { return factory.skipWhileN(getThis(), predicate); } - public BigDecimal sumBigDecimal( + @Override public BigDecimal sumBigDecimal( FunctionExpression> selector) { return factory.sumBigDecimal(getThis(), selector); } - public BigDecimal sumNullableBigDecimal( + @Override public BigDecimal sumNullableBigDecimal( FunctionExpression> selector) { return factory.sumNullableBigDecimal(getThis(), selector); } - public double sumDouble(FunctionExpression> selector) { + @Override public double sumDouble(FunctionExpression> selector) { return factory.sumDouble(getThis(), selector); } - public Double sumNullableDouble( + @Override public Double sumNullableDouble( FunctionExpression> selector) { return factory.sumNullableDouble(getThis(), selector); } - public int sumInteger(FunctionExpression> selector) { + @Override public int sumInteger(FunctionExpression> selector) { return factory.sumInteger(getThis(), selector); } - public Integer sumNullableInteger( + @Override public Integer sumNullableInteger( FunctionExpression> selector) { return factory.sumNullableInteger(getThis(), selector); } - public long sumLong(FunctionExpression> selector) { + @Override public long sumLong(FunctionExpression> selector) { return factory.sumLong(getThis(), selector); } - public Long sumNullableLong( + @Override public Long sumNullableLong( FunctionExpression> selector) { return factory.sumNullableLong(getThis(), selector); } - public float sumFloat(FunctionExpression> selector) { + @Override public float sumFloat(FunctionExpression> selector) { return factory.sumFloat(getThis(), selector); } - public Float sumNullableFloat( + @Override public Float sumNullableFloat( FunctionExpression> selector) { return factory.sumNullableFloat(getThis(), selector); } - public Queryable takeWhile(FunctionExpression> predicate) { + @Override public Queryable takeWhile(FunctionExpression> predicate) { return factory.takeWhile(getThis(), predicate); } - public Queryable takeWhileN( + @Override public Queryable takeWhileN( FunctionExpression> predicate) { return factory.takeWhileN(getThis(), predicate); } - public > OrderedQueryable thenBy( + @Override public > OrderedQueryable thenBy( FunctionExpression> keySelector) { return factory.thenBy(getThisOrderedQueryable(), keySelector); } - public OrderedQueryable thenBy( + @Override public OrderedQueryable thenBy( FunctionExpression> keySelector, Comparator comparator) { return factory.thenByDescending(getThisOrderedQueryable(), keySelector, comparator); } - public > OrderedQueryable thenByDescending( + @Override public > OrderedQueryable thenByDescending( FunctionExpression> keySelector) { return factory.thenByDescending(getThisOrderedQueryable(), keySelector); } - public OrderedQueryable thenByDescending( + @Override public OrderedQueryable thenByDescending( FunctionExpression> keySelector, Comparator comparator) { return factory.thenBy(getThisOrderedQueryable(), keySelector, comparator); } - public Queryable where( + @Override public Queryable where( FunctionExpression> predicate) { return factory.where(getThis(), predicate); } - public Queryable whereN( + @Override public Queryable whereN( FunctionExpression> predicate) { return factory.whereN(getThis(), predicate); } - public Queryable zip(Enumerable source1, + @Override public Queryable zip(Enumerable source1, FunctionExpression> resultSelector) { return factory.zip(getThis(), source1, resultSelector); } 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 181d0358ee6..5d4300b8f00 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerable.java @@ -33,6 +33,6 @@ public interface Enumerable * * @see EnumerableDefaults#asQueryable(Enumerable) */ - Queryable asQueryable(); + @Override Queryable asQueryable(); } 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 e1b9de84d6f..5f4d484dbd6 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java @@ -320,7 +320,7 @@ public static Float average(Enumerable source, public static Enumerable cast( final Enumerable source, final Class clazz) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new CastingEnumerator<>(source.enumerator(), clazz); } }; @@ -412,11 +412,11 @@ public static Enumerable defaultIfEmpty( private Iterator rest; - public boolean hasNext() { + @Override public boolean hasNext() { return !nonFirst || rest.hasNext(); } - public TSource next() { + @Override public TSource next() { if (nonFirst) { return rest.next(); } else { @@ -427,7 +427,7 @@ public TSource next() { } } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException("remove"); } }); @@ -835,7 +835,7 @@ public static Enumerable sortedGr final Function2 resultSelector, final Comparator comparator) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new SortedAggregateEnumerator( enumerable, keySelector, accumulatorInitializer, accumulatorAdder, resultSelector, comparator); @@ -1037,24 +1037,24 @@ public static Enumerable groupJoin( final Enumerator> entries = Linq4j.enumerator(outerMap.entrySet()); - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { - public TResult current() { + @Override public TResult current() { final Map.Entry entry = entries.current(); final Enumerable inners = innerLookup.get(entry.getKey()); return resultSelector.apply(entry.getValue(), inners == null ? Linq4j.emptyEnumerable() : inners); } - public boolean moveNext() { + @Override public boolean moveNext() { return entries.moveNext(); } - public void reset() { + @Override public void reset() { entries.reset(); } - public void close() { + @Override public void close() { } }; } @@ -1078,24 +1078,24 @@ public static Enumerable groupJoin( final Enumerator> entries = Linq4j.enumerator(outerMap.entrySet()); - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { - public TResult current() { + @Override public TResult current() { final Map.Entry entry = entries.current(); final Enumerable inners = innerLookup.get(entry.getKey()); return resultSelector.apply(entry.getValue(), inners == null ? Linq4j.emptyEnumerable() : inners); } - public boolean moveNext() { + @Override public boolean moveNext() { return entries.moveNext(); } - public void reset() { + @Override public void reset() { entries.reset(); } - public void close() { + @Override public void close() { } }; } @@ -1284,7 +1284,7 @@ private static Enumerable hashEquiJoin final EqualityComparer comparer, final boolean generateNullsOnLeft, final boolean generateNullsOnRight) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Lookup innerLookup = comparer == null ? inner.toLookup(innerKeySelector) @@ -1298,11 +1298,11 @@ public Enumerator enumerator() { ? new HashSet<>(innerLookup.keySet()) : null; - public TResult current() { + @Override public TResult current() { return resultSelector.apply(outers.current(), inners.current()); } - public boolean moveNext() { + @Override public boolean moveNext() { for (;;) { if (inners.moveNext()) { return true; @@ -1355,11 +1355,11 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { outers.reset(); } - public void close() { + @Override public void close() { outers.close(); } }; @@ -1378,7 +1378,7 @@ private static Enumerable hashJoinWith final boolean generateNullsOnRight, final Predicate2 predicate) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { /** * the innerToLookUp will refer the inner , if current join * is a right join, we should figure out the right list first, if @@ -1402,11 +1402,11 @@ public Enumerator enumerator() { ? new ArrayList<>(innerToLookUp.toList()) : null; - public TResult current() { + @Override public TResult current() { return resultSelector.apply(outers.current(), inners.current()); } - public boolean moveNext() { + @Override public boolean moveNext() { for (;;) { if (inners.moveNext()) { return true; @@ -1464,11 +1464,11 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { outers.reset(); } - public void close() { + @Override public void close() { outers.close(); } }; @@ -1489,7 +1489,7 @@ public static Enumerable correlateJoin( } return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { private Enumerator outerEnumerator = outer.enumerator(); private Enumerator innerEnumerator; @@ -1497,11 +1497,11 @@ public Enumerator enumerator() { TInner innerValue; int state = 0; // 0 -- moving outer, 1 moving inner; - public TResult current() { + @Override public TResult current() { return resultSelector.apply(outerValue, innerValue); } - public boolean moveNext() { + @Override public boolean moveNext() { while (true) { switch (state) { case 0: @@ -1554,13 +1554,13 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { state = 0; outerEnumerator.reset(); closeInner(); } - public void close() { + @Override public void close() { outerEnumerator.close(); closeInner(); outerValue = null; @@ -1870,7 +1870,7 @@ private static Enumerable semiJoinWithPredicate final Predicate2 nonEquiPredicate) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { // CALCITE-2909 Delay the computation of the innerLookup until the // moment when we are sure // that it will be really needed, i.e. when the first outer @@ -1914,7 +1914,7 @@ private static Enumerable semiEquiJoin_( final EqualityComparer comparer, final boolean anti) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { // CALCITE-2909 Delay the computation of the innerLookup until the moment when we are sure // that it will be really needed, i.e. when the first outer enumerator item is processed final Supplier> innerLookup = Suppliers.memoize(() -> @@ -2014,7 +2014,7 @@ private static Enumerable nestedLoopJoinOpti } return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { private Enumerator outerEnumerator = outer.enumerator(); private Enumerator innerEnumerator = null; @@ -2183,7 +2183,7 @@ public static boolean isMergeJoinSupported(JoinType joinType) { throw new UnsupportedOperationException("MergeJoin unsupported for join type " + joinType); } return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new MergeJoinEnumerator<>(outer, inner, outerKeySelector, innerKeySelector, extraPredicate, resultSelector, joinType, comparator); } @@ -2748,11 +2748,11 @@ public static Enumerable reverse( final int n = list.size(); return Linq4j.asEnumerable( new AbstractList() { - public TSource get(int index) { + @Override public TSource get(int index) { return list.get(n - 1 - index); } - public int size() { + @Override public int size() { return n; } }); @@ -2769,23 +2769,23 @@ public static Enumerable select( return (Enumerable) source; } return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { final Enumerator enumerator = source.enumerator(); - public TResult current() { + @Override public TResult current() { return selector.apply(enumerator.current()); } - public boolean moveNext() { + @Override public boolean moveNext() { return enumerator.moveNext(); } - public void reset() { + @Override public void reset() { enumerator.reset(); } - public void close() { + @Override public void close() { enumerator.close(); } }; @@ -2801,16 +2801,16 @@ public static Enumerable select( final Enumerable source, final Function2 selector) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { final Enumerator enumerator = source.enumerator(); int n = -1; - public TResult current() { + @Override public TResult current() { return selector.apply(enumerator.current(), n); } - public boolean moveNext() { + @Override public boolean moveNext() { if (enumerator.moveNext()) { ++n; return true; @@ -2819,11 +2819,11 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { enumerator.reset(); } - public void close() { + @Override public void close() { enumerator.close(); } }; @@ -2840,16 +2840,16 @@ public static Enumerable selectMany( final Enumerable source, final Function1> selector) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { Enumerator sourceEnumerator = source.enumerator(); Enumerator resultEnumerator = Linq4j.emptyEnumerator(); - public TResult current() { + @Override public TResult current() { return resultEnumerator.current(); } - public boolean moveNext() { + @Override public boolean moveNext() { for (;;) { if (resultEnumerator.moveNext()) { return true; @@ -2862,12 +2862,12 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { sourceEnumerator.reset(); resultEnumerator = Linq4j.emptyEnumerator(); } - public void close() { + @Override public void close() { sourceEnumerator.close(); resultEnumerator.close(); } @@ -2886,17 +2886,17 @@ public static Enumerable selectMany( final Enumerable source, final Function2> selector) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { int index = -1; Enumerator sourceEnumerator = source.enumerator(); Enumerator resultEnumerator = Linq4j.emptyEnumerator(); - public TResult current() { + @Override public TResult current() { return resultEnumerator.current(); } - public boolean moveNext() { + @Override public boolean moveNext() { for (;;) { if (resultEnumerator.moveNext()) { return true; @@ -2910,12 +2910,12 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { sourceEnumerator.reset(); resultEnumerator = Linq4j.emptyEnumerator(); } - public void close() { + @Override public void close() { sourceEnumerator.close(); resultEnumerator.close(); } @@ -2936,18 +2936,18 @@ public static Enumerable selectMany( final Function2> collectionSelector, final Function2 resultSelector) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { int index = -1; Enumerator sourceEnumerator = source.enumerator(); Enumerator collectionEnumerator = Linq4j.emptyEnumerator(); Enumerator resultEnumerator = Linq4j.emptyEnumerator(); - public TResult current() { + @Override public TResult current() { return resultEnumerator.current(); } - public boolean moveNext() { + @Override public boolean moveNext() { for (;;) { if (resultEnumerator.moveNext()) { return true; @@ -2961,19 +2961,19 @@ public boolean moveNext() { .enumerator(); resultEnumerator = new TransformedEnumerator(collectionEnumerator) { - protected TResult transform(TCollection collectionElement) { + @Override protected TResult transform(TCollection collectionElement) { return resultSelector.apply(sourceElement, collectionElement); } }; } } - public void reset() { + @Override public void reset() { sourceEnumerator.reset(); resultEnumerator = Linq4j.emptyEnumerator(); } - public void close() { + @Override public void close() { sourceEnumerator.close(); resultEnumerator.close(); } @@ -2993,17 +2993,17 @@ public static Enumerable selectMany( final Function1> collectionSelector, final Function2 resultSelector) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { Enumerator sourceEnumerator = source.enumerator(); Enumerator collectionEnumerator = Linq4j.emptyEnumerator(); Enumerator resultEnumerator = Linq4j.emptyEnumerator(); - public TResult current() { + @Override public TResult current() { return resultEnumerator.current(); } - public boolean moveNext() { + @Override public boolean moveNext() { boolean incremented = false; for (;;) { if (resultEnumerator.moveNext()) { @@ -3017,19 +3017,19 @@ public boolean moveNext() { .enumerator(); resultEnumerator = new TransformedEnumerator(collectionEnumerator) { - protected TResult transform(TCollection collectionElement) { + @Override protected TResult transform(TCollection collectionElement) { return resultSelector.apply(sourceElement, collectionElement); } }; } } - public void reset() { + @Override public void reset() { sourceEnumerator.reset(); resultEnumerator = Linq4j.emptyEnumerator(); } - public void close() { + @Override public void close() { sourceEnumerator.close(); resultEnumerator.close(); } @@ -3059,10 +3059,10 @@ public static boolean sequenceEqual(Enumerable first, Objects.requireNonNull(second); if (comparer == null) { comparer = new EqualityComparer() { - public boolean equal(TSource v1, TSource v2) { + @Override public boolean equal(TSource v1, TSource v2) { return Objects.equals(v1, v2); } - public int hashCode(TSource tSource) { + @Override public int hashCode(TSource tSource) { return Objects.hashCode(tSource); } }; @@ -3215,7 +3215,7 @@ public static Enumerable skipWhile( final Enumerable source, final Predicate2 predicate) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new SkipWhileEnumerator<>(source.enumerator(), predicate); } }; @@ -3368,7 +3368,7 @@ public static Enumerable takeWhile( final Enumerable source, final Predicate2 predicate) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new TakeWhileEnumerator<>(source.enumerator(), predicate); } }; @@ -3383,7 +3383,7 @@ public static Enumerable takeWhileLong( final Enumerable source, final Predicate2 predicate) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new TakeWhileLongEnumerator<>(source.enumerator(), predicate); } }; @@ -3647,7 +3647,7 @@ public static Enumerable where( final Enumerable source, final Predicate1 predicate) { assert predicate != null; return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Enumerator enumerator = source.enumerator(); return EnumerableDefaults.where(enumerator, predicate); } @@ -3658,11 +3658,11 @@ private static Enumerator where( final Enumerator enumerator, final Predicate1 predicate) { return new Enumerator() { - public TSource current() { + @Override public TSource current() { return enumerator.current(); } - public boolean moveNext() { + @Override public boolean moveNext() { while (enumerator.moveNext()) { if (predicate.apply(enumerator.current())) { return true; @@ -3671,11 +3671,11 @@ public boolean moveNext() { return false; } - public void reset() { + @Override public void reset() { enumerator.reset(); } - public void close() { + @Override public void close() { enumerator.close(); } }; @@ -3690,16 +3690,16 @@ public static Enumerable where( final Enumerable source, final Predicate2 predicate) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { final Enumerator enumerator = source.enumerator(); int n = -1; - public TSource current() { + @Override public TSource current() { return enumerator.current(); } - public boolean moveNext() { + @Override public boolean moveNext() { while (enumerator.moveNext()) { ++n; if (predicate.apply(enumerator.current(), n)) { @@ -3709,12 +3709,12 @@ public boolean moveNext() { return false; } - public void reset() { + @Override public void reset() { enumerator.reset(); n = -1; } - public void close() { + @Override public void close() { enumerator.close(); } }; @@ -3731,22 +3731,22 @@ public static Enumerable zip( final Enumerable first, final Enumerable second, final Function2 resultSelector) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { final Enumerator e1 = first.enumerator(); final Enumerator e2 = second.enumerator(); - public TResult current() { + @Override public TResult current() { return resultSelector.apply(e1.current(), e2.current()); } - public boolean moveNext() { + @Override public boolean moveNext() { return e1.moveNext() && e2.moveNext(); } - public void reset() { + @Override public void reset() { e1.reset(); e2.reset(); } - public void close() { + @Override public void close() { e1.close(); e2.close(); } @@ -3801,11 +3801,11 @@ static class TakeWhileEnumerator implements Enumerator { this.predicate = predicate; } - public TSource current() { + @Override public TSource current() { return enumerator.current(); } - public boolean moveNext() { + @Override public boolean moveNext() { if (!done) { if (enumerator.moveNext() && predicate.apply(enumerator.current(), ++n)) { @@ -3817,13 +3817,13 @@ public boolean moveNext() { return false; } - public void reset() { + @Override public void reset() { enumerator.reset(); done = false; n = -1; } - public void close() { + @Override public void close() { enumerator.close(); } } @@ -3844,11 +3844,11 @@ static class TakeWhileLongEnumerator implements Enumerator { this.predicate = predicate; } - public TSource current() { + @Override public TSource current() { return enumerator.current(); } - public boolean moveNext() { + @Override public boolean moveNext() { if (!done) { if (enumerator.moveNext() && predicate.apply(enumerator.current(), ++n)) { @@ -3860,13 +3860,13 @@ public boolean moveNext() { return false; } - public void reset() { + @Override public void reset() { enumerator.reset(); done = false; n = -1; } - public void close() { + @Override public void close() { enumerator.close(); } } @@ -3887,11 +3887,11 @@ static class SkipWhileEnumerator implements Enumerator { this.predicate = predicate; } - public TSource current() { + @Override public TSource current() { return enumerator.current(); } - public boolean moveNext() { + @Override public boolean moveNext() { for (;;) { if (!enumerator.moveNext()) { return false; @@ -3906,13 +3906,13 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { enumerator.reset(); started = false; n = -1; } - public void close() { + @Override public void close() { enumerator.close(); } } @@ -3929,19 +3929,19 @@ static class CastingEnumerator implements Enumerator { this.clazz = clazz; } - public T current() { + @Override public T current() { return clazz.cast(enumerator.current()); } - public boolean moveNext() { + @Override public boolean moveNext() { return enumerator.moveNext(); } - public void reset() { + @Override public void reset() { enumerator.reset(); } - public void close() { + @Override public void close() { enumerator.close(); } } @@ -3997,16 +3997,16 @@ protected WrapMap(Function0, V>> mapProvider, EqualityComparer map.entrySet().iterator(); return new Iterator>() { - public boolean hasNext() { + @Override public boolean hasNext() { return iterator.hasNext(); } - public Entry next() { + @Override public Entry next() { Entry, V> next = iterator.next(); return new SimpleEntry<>(next.getKey().element, next.getValue()); } - public void remove() { + @Override public void remove() { iterator.remove(); } }; @@ -4063,20 +4063,20 @@ private static class LookupResultEnumerable this.resultSelector = resultSelector; } - public Iterator iterator() { + @Override public Iterator iterator() { final Iterator> iterator = map.entrySet().iterator(); return new Iterator() { - public boolean hasNext() { + @Override public boolean hasNext() { return iterator.hasNext(); } - public TResult next() { + @Override public TResult next() { final Map.Entry entry = iterator.next(); return resultSelector.apply(entry.getKey(), entry.getValue()); } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } }; @@ -4370,14 +4370,14 @@ private boolean advanceRight(TInner right, TKey rightKey) { return false; } - public TResult current() { + @Override public TResult current() { if (current == DUMMY) { throw new NoSuchElementException(); } return current; } - public boolean moveNext() { + @Override public boolean moveNext() { for (;;) { if (results != null) { if (results.moveNext()) { @@ -4404,7 +4404,7 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { done = false; results = null; current = (TResult) DUMMY; @@ -4416,7 +4416,7 @@ public void reset() { start(); } - public void close() { + @Override public void close() { leftEnumerator.close(); if (rightEnumerator != null) { rightEnumerator.close(); diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableOrderedQueryable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableOrderedQueryable.java index 0fe30bfeba8..a53e006f674 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableOrderedQueryable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableOrderedQueryable.java @@ -35,25 +35,25 @@ class EnumerableOrderedQueryable extends EnumerableQueryable super(provider, rowType, expression, enumerable); } - public > OrderedQueryable thenBy( + @Override public > OrderedQueryable thenBy( FunctionExpression> keySelector) { return QueryableDefaults.thenBy(asOrderedQueryable(), keySelector); } - public OrderedQueryable thenBy( + @Override public OrderedQueryable thenBy( FunctionExpression> keySelector, Comparator comparator) { return QueryableDefaults.thenBy(asOrderedQueryable(), keySelector, comparator); } - public > OrderedQueryable thenByDescending( + @Override public > OrderedQueryable thenByDescending( FunctionExpression> keySelector) { return QueryableDefaults.thenByDescending(asOrderedQueryable(), keySelector); } - public OrderedQueryable thenByDescending( + @Override public OrderedQueryable thenByDescending( FunctionExpression> keySelector, Comparator comparator) { return QueryableDefaults.thenByDescending(asOrderedQueryable(), keySelector, diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableQueryable.java b/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableQueryable.java index 77f1ba12540..a6724b7825e 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableQueryable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableQueryable.java @@ -72,21 +72,21 @@ protected Queryable queryable() { return this; } - public Iterator iterator() { + @Override public Iterator iterator() { return enumerable.iterator(); } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return enumerable.enumerator(); } // Disambiguate - public Queryable union(Enumerable source1) { + @Override public Queryable union(Enumerable source1) { return EnumerableDefaults.union(getThis(), source1).asQueryable(); } - public Queryable union(Enumerable source1, + @Override public Queryable union(Enumerable source1, EqualityComparer comparer) { return EnumerableDefaults.union(getThis(), source1, comparer).asQueryable(); } @@ -129,15 +129,15 @@ public Queryable union(Enumerable source1, return EnumerableDefaults.except(getThis(), enumerable1, all).asQueryable(); } - public Queryable take(int count) { + @Override public Queryable take(int count) { return EnumerableDefaults.take(getThis(), count).asQueryable(); } - public Queryable skip(int count) { + @Override public Queryable skip(int count) { return EnumerableDefaults.skip(getThis(), count).asQueryable(); } - public Queryable reverse() { + @Override public Queryable reverse() { return EnumerableDefaults.reverse(getThis()).asQueryable(); } @@ -157,135 +157,135 @@ public Queryable reverse() { return EnumerableDefaults.defaultIfEmpty(getThis()).asQueryable(); } - public Queryable cast(Class clazz) { + @Override public Queryable cast(Class clazz) { return EnumerableDefaults.cast(getThis(), clazz).asQueryable(); } // Queryable methods - public Type getElementType() { + @Override public Type getElementType() { return elementType; } - public Expression getExpression() { + @Override public Expression getExpression() { return expression; } - public QueryProvider getProvider() { + @Override public QueryProvider getProvider() { return provider; } // ............. - public T aggregate(FunctionExpression> selector) { + @Override public T aggregate(FunctionExpression> selector) { return EnumerableDefaults.aggregate(getThis(), selector.getFunction()); } - public TAccumulate aggregate(TAccumulate seed, + @Override public TAccumulate aggregate(TAccumulate seed, FunctionExpression> selector) { return EnumerableDefaults.aggregate(getThis(), seed, selector.getFunction()); } - public TResult aggregate(TAccumulate seed, + @Override public TResult aggregate(TAccumulate seed, FunctionExpression> func, FunctionExpression> selector) { return EnumerableDefaults.aggregate(getThis(), seed, func.getFunction(), selector.getFunction()); } - public boolean all(FunctionExpression> predicate) { + @Override public boolean all(FunctionExpression> predicate) { return EnumerableDefaults.all(getThis(), predicate.getFunction()); } - public boolean any(FunctionExpression> predicate) { + @Override public boolean any(FunctionExpression> predicate) { return EnumerableDefaults.any(getThis(), predicate.getFunction()); } - public BigDecimal averageBigDecimal( + @Override public BigDecimal averageBigDecimal( FunctionExpression> selector) { return EnumerableDefaults.average(getThis(), selector.getFunction()); } - public BigDecimal averageNullableBigDecimal( + @Override public BigDecimal averageNullableBigDecimal( FunctionExpression> selector) { return EnumerableDefaults.average(getThis(), selector.getFunction()); } - public double averageDouble(FunctionExpression> selector) { + @Override public double averageDouble(FunctionExpression> selector) { return EnumerableDefaults.average(getThis(), selector.getFunction()); } - public Double averageNullableDouble( + @Override public Double averageNullableDouble( FunctionExpression> selector) { return EnumerableDefaults.average(getThis(), selector.getFunction()); } - public int averageInteger(FunctionExpression> selector) { + @Override public int averageInteger(FunctionExpression> selector) { return EnumerableDefaults.average(getThis(), selector.getFunction()); } - public Integer averageNullableInteger( + @Override public Integer averageNullableInteger( FunctionExpression> selector) { return EnumerableDefaults.average(getThis(), selector.getFunction()); } - public float averageFloat(FunctionExpression> selector) { + @Override public float averageFloat(FunctionExpression> selector) { return EnumerableDefaults.average(getThis(), selector.getFunction()); } - public Float averageNullableFloat( + @Override public Float averageNullableFloat( FunctionExpression> selector) { return EnumerableDefaults.average(getThis(), selector.getFunction()); } - public long averageLong(FunctionExpression> selector) { + @Override public long averageLong(FunctionExpression> selector) { return EnumerableDefaults.average(getThis(), selector.getFunction()); } - public Long averageNullableLong( + @Override public Long averageNullableLong( FunctionExpression> selector) { return EnumerableDefaults.average(getThis(), selector.getFunction()); } - public Queryable concat(Enumerable source2) { + @Override public Queryable concat(Enumerable source2) { return EnumerableDefaults.concat(getThis(), source2).asQueryable(); } - public int count(FunctionExpression> predicate) { + @Override public int count(FunctionExpression> predicate) { return EnumerableDefaults.count(getThis(), predicate.getFunction()); } - public T first(FunctionExpression> predicate) { + @Override public T first(FunctionExpression> predicate) { return EnumerableDefaults.first(getThis(), predicate.getFunction()); } - public T firstOrDefault(FunctionExpression> predicate) { + @Override public T firstOrDefault(FunctionExpression> predicate) { return EnumerableDefaults.firstOrDefault(getThis(), predicate.getFunction()); } - public Queryable> groupBy( + @Override public Queryable> groupBy( FunctionExpression> keySelector) { return EnumerableDefaults.groupBy(getThis(), keySelector.getFunction()) .asQueryable(); } - public Queryable> groupBy( + @Override public Queryable> groupBy( FunctionExpression> keySelector, EqualityComparer comparer) { return EnumerableDefaults.groupBy(getThis(), keySelector.getFunction(), comparer).asQueryable(); } - public Queryable> groupBy( + @Override public Queryable> groupBy( FunctionExpression> keySelector, FunctionExpression> elementSelector) { return EnumerableDefaults.groupBy(getThis(), keySelector.getFunction(), elementSelector.getFunction()).asQueryable(); } - public Queryable> groupBy( + @Override public Queryable> groupBy( FunctionExpression> keySelector, FunctionExpression> elementSelector, EqualityComparer comparer) { @@ -293,14 +293,14 @@ public Queryable> groupBy( elementSelector.getFunction(), comparer).asQueryable(); } - public Queryable groupByK( + @Override public Queryable groupByK( FunctionExpression> keySelector, FunctionExpression, TResult>> resultSelector) { return EnumerableDefaults.groupBy(getThis(), keySelector.getFunction(), resultSelector.getFunction()).asQueryable(); } - public Queryable groupByK( + @Override public Queryable groupByK( FunctionExpression> keySelector, FunctionExpression, TResult>> resultSelector, EqualityComparer comparer) { @@ -308,7 +308,7 @@ public Queryable groupByK( resultSelector.getFunction(), comparer).asQueryable(); } - public Queryable groupBy( + @Override public Queryable groupBy( FunctionExpression> keySelector, FunctionExpression> elementSelector, FunctionExpression, TResult>> resultSelector) { @@ -317,7 +317,7 @@ public Queryable groupBy( .asQueryable(); } - public Queryable groupBy( + @Override public Queryable groupBy( FunctionExpression> keySelector, FunctionExpression> elementSelector, FunctionExpression, TResult>> resultSelector, @@ -327,7 +327,7 @@ public Queryable groupBy( .asQueryable(); } - public Queryable groupJoin( + @Override public Queryable groupJoin( Enumerable inner, FunctionExpression> outerKeySelector, FunctionExpression> innerKeySelector, @@ -337,7 +337,7 @@ public Queryable groupJoin( resultSelector.getFunction()).asQueryable(); } - public Queryable groupJoin( + @Override public Queryable groupJoin( Enumerable inner, FunctionExpression> outerKeySelector, FunctionExpression> innerKeySelector, @@ -348,7 +348,7 @@ public Queryable groupJoin( resultSelector.getFunction(), comparer).asQueryable(); } - public Queryable join( + @Override public Queryable join( Enumerable inner, FunctionExpression> outerKeySelector, FunctionExpression> innerKeySelector, @@ -358,7 +358,7 @@ public Queryable join( resultSelector.getFunction()).asQueryable(); } - public Queryable join( + @Override public Queryable join( Enumerable inner, FunctionExpression> outerKeySelector, FunctionExpression> innerKeySelector, @@ -369,35 +369,35 @@ public Queryable join( resultSelector.getFunction(), comparer).asQueryable(); } - public T last(FunctionExpression> predicate) { + @Override public T last(FunctionExpression> predicate) { return EnumerableDefaults.last(getThis(), predicate.getFunction()); } - public T lastOrDefault(FunctionExpression> predicate) { + @Override public T lastOrDefault(FunctionExpression> predicate) { return EnumerableDefaults.lastOrDefault(getThis(), predicate.getFunction()); } - public long longCount(FunctionExpression> predicate) { + @Override public long longCount(FunctionExpression> predicate) { return EnumerableDefaults.longCount(getThis(), predicate.getFunction()); } - public > TResult max( + @Override public > TResult max( FunctionExpression> selector) { return EnumerableDefaults.max(getThis(), selector.getFunction()); } - public > TResult min( + @Override public > TResult min( FunctionExpression> selector) { return EnumerableDefaults.min(getThis(), selector.getFunction()); } - public OrderedQueryable orderBy( + @Override public OrderedQueryable orderBy( FunctionExpression> keySelector) { return EnumerableDefaults.asOrderedQueryable( EnumerableDefaults.orderBy(getThis(), keySelector.getFunction())); } - public OrderedQueryable orderBy( + @Override public OrderedQueryable orderBy( FunctionExpression> keySelector, Comparator comparator) { return EnumerableDefaults.asOrderedQueryable( @@ -405,14 +405,14 @@ public OrderedQueryable orderBy( comparator)); } - public OrderedQueryable orderByDescending( + @Override public OrderedQueryable orderByDescending( FunctionExpression> keySelector) { return EnumerableDefaults.asOrderedQueryable( EnumerableDefaults.orderByDescending(getThis(), keySelector.getFunction())); } - public OrderedQueryable orderByDescending( + @Override public OrderedQueryable orderByDescending( FunctionExpression> keySelector, Comparator comparator) { return EnumerableDefaults.asOrderedQueryable( @@ -420,31 +420,31 @@ public OrderedQueryable orderByDescending( keySelector.getFunction(), comparator)); } - public Queryable select( + @Override public Queryable select( FunctionExpression> selector) { return EnumerableDefaults.select(getThis(), selector.getFunction()) .asQueryable(); } - public Queryable selectN( + @Override public Queryable selectN( FunctionExpression> selector) { return EnumerableDefaults.select(getThis(), selector.getFunction()) .asQueryable(); } - public Queryable selectMany( + @Override public Queryable selectMany( FunctionExpression>> selector) { return EnumerableDefaults.selectMany(getThis(), selector.getFunction()) .asQueryable(); } - public Queryable selectManyN( + @Override public Queryable selectManyN( FunctionExpression>> selector) { return EnumerableDefaults.selectMany(getThis(), selector.getFunction()) .asQueryable(); } - public Queryable selectMany( + @Override public Queryable selectMany( FunctionExpression>> collectionSelector, FunctionExpression> resultSelector) { @@ -453,7 +453,7 @@ public Queryable selectMany( .asQueryable(); } - public Queryable selectManyN( + @Override public Queryable selectManyN( FunctionExpression>> collectionSelector, FunctionExpression> resultSelector) { @@ -462,107 +462,107 @@ public Queryable selectManyN( .asQueryable(); } - public T single(FunctionExpression> predicate) { + @Override public T single(FunctionExpression> predicate) { return EnumerableDefaults.single(getThis(), predicate.getFunction()); } - public T singleOrDefault(FunctionExpression> predicate) { + @Override public T singleOrDefault(FunctionExpression> predicate) { return EnumerableDefaults.singleOrDefault(getThis(), predicate.getFunction()); } - public Queryable skipWhile(FunctionExpression> predicate) { + @Override public Queryable skipWhile(FunctionExpression> predicate) { return EnumerableDefaults.skipWhile(getThis(), predicate.getFunction()) .asQueryable(); } - public Queryable skipWhileN( + @Override public Queryable skipWhileN( FunctionExpression> predicate) { return EnumerableDefaults.skipWhile(getThis(), predicate.getFunction()) .asQueryable(); } - public BigDecimal sumBigDecimal( + @Override public BigDecimal sumBigDecimal( FunctionExpression> selector) { return EnumerableDefaults.sum(getThis(), selector.getFunction()); } - public BigDecimal sumNullableBigDecimal( + @Override public BigDecimal sumNullableBigDecimal( FunctionExpression> selector) { return EnumerableDefaults.sum(getThis(), selector.getFunction()); } - public double sumDouble(FunctionExpression> selector) { + @Override public double sumDouble(FunctionExpression> selector) { return EnumerableDefaults.sum(getThis(), selector.getFunction()); } - public Double sumNullableDouble( + @Override public Double sumNullableDouble( FunctionExpression> selector) { return EnumerableDefaults.sum(getThis(), selector.getFunction()); } - public int sumInteger(FunctionExpression> selector) { + @Override public int sumInteger(FunctionExpression> selector) { return EnumerableDefaults.sum(getThis(), selector.getFunction()); } - public Integer sumNullableInteger( + @Override public Integer sumNullableInteger( FunctionExpression> selector) { return EnumerableDefaults.sum(getThis(), selector.getFunction()); } - public long sumLong(FunctionExpression> selector) { + @Override public long sumLong(FunctionExpression> selector) { return EnumerableDefaults.sum(getThis(), selector.getFunction()); } - public Long sumNullableLong( + @Override public Long sumNullableLong( FunctionExpression> selector) { return EnumerableDefaults.sum(getThis(), selector.getFunction()); } - public float sumFloat(FunctionExpression> selector) { + @Override public float sumFloat(FunctionExpression> selector) { return EnumerableDefaults.sum(getThis(), selector.getFunction()); } - public Float sumNullableFloat( + @Override public Float sumNullableFloat( FunctionExpression> selector) { return EnumerableDefaults.sum(getThis(), selector.getFunction()); } - public Queryable takeWhile(FunctionExpression> predicate) { + @Override public Queryable takeWhile(FunctionExpression> predicate) { return EnumerableDefaults.takeWhile(getThis(), predicate.getFunction()) .asQueryable(); } - public Queryable takeWhileN( + @Override public Queryable takeWhileN( FunctionExpression> predicate) { return EnumerableDefaults.takeWhile(getThis(), predicate.getFunction()) .asQueryable(); } - public Queryable where( + @Override public Queryable where( FunctionExpression> predicate) { return EnumerableDefaults.where(getThis(), predicate.getFunction()) .asQueryable(); } - public Queryable whereN( + @Override public Queryable whereN( FunctionExpression> predicate) { return EnumerableDefaults.where(getThis(), predicate.getFunction()) .asQueryable(); } - public Queryable zip(Enumerable source1, + @Override public Queryable zip(Enumerable source1, FunctionExpression> resultSelector) { return EnumerableDefaults.zip(getThis(), source1, resultSelector.getFunction()).asQueryable(); } - public T aggregate(Function2 func) { + @Override public T aggregate(Function2 func) { return EnumerableDefaults.aggregate(getThis(), func); } - public TResult aggregate(TAccumulate seed, + @Override public TResult aggregate(TAccumulate seed, Function2 func, Function1 selector) { return EnumerableDefaults.aggregate(getThis(), seed, func, selector); diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerator.java b/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerator.java index 90bc29ce039..bd9e28be31f 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerator.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/Enumerator.java @@ -123,5 +123,5 @@ public interface Enumerator extends AutoCloseable { *

This method is idempotent. Calling it multiple times has the same effect * as calling it once. */ - void close(); + @Override void close(); } 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 573dcb90849..1f5db136958 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedQueryable.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/ExtendedQueryable.java @@ -159,7 +159,7 @@ Long averageNullableLong( /** * Concatenates two sequences. */ - Queryable concat(Enumerable source2); + @Override Queryable concat(Enumerable source2); /** * Returns the number of elements in the specified @@ -172,26 +172,26 @@ Long averageNullableLong( * the type parameter's default value in a singleton collection if * the sequence is empty. */ - Queryable defaultIfEmpty(); + @Override Queryable defaultIfEmpty(); /** * Returns distinct elements from a sequence by using * the default equality comparer to compare values. */ - Queryable distinct(); + @Override Queryable distinct(); /** * Returns distinct elements from a sequence by using * a specified EqualityComparer<TSource> to compare values. */ - Queryable distinct(EqualityComparer comparer); + @Override Queryable distinct(EqualityComparer comparer); /** * Produces the set difference of two sequences by * using the default equality comparer to compare values, * eliminate duplicates. (Defined by Enumerable.) */ - Queryable except(Enumerable enumerable); + @Override Queryable except(Enumerable enumerable); /** * Produces the set difference of two sequences by @@ -199,14 +199,14 @@ Long averageNullableLong( * using {@code all} to indicate whether to eliminate duplicates. * (Defined by Enumerable.) */ - Queryable except(Enumerable enumerable, boolean all); + @Override Queryable except(Enumerable enumerable, boolean all); /** * Produces the set difference of two sequences by * using the specified {@code EqualityComparer} to compare * values, eliminate duplicates. */ - Queryable except(Enumerable enumerable, + @Override Queryable except(Enumerable enumerable, EqualityComparer comparer); /** @@ -214,7 +214,7 @@ Queryable except(Enumerable enumerable, * using the specified {@code EqualityComparer} to compare * values, using {@code all} to indicate whether to eliminate duplicates. */ - Queryable except(Enumerable enumerable, + @Override Queryable except(Enumerable enumerable, EqualityComparer comparer, boolean all); /** * Returns the first element of a sequence that @@ -342,7 +342,7 @@ Queryable groupJoin(Enumerable inner, * using the default equality comparer to compare values, * eliminate duplicates.(Defined by Queryable.) */ - Queryable intersect(Enumerable enumerable); + @Override Queryable intersect(Enumerable enumerable); /** * Produces the set intersection of two sequences by @@ -350,14 +350,14 @@ Queryable groupJoin(Enumerable inner, * using {@code all} to indicate whether to eliminate duplicates. * (Defined by Queryable.) */ - Queryable intersect(Enumerable enumerable, boolean all); + @Override Queryable intersect(Enumerable enumerable, boolean all); /** * Produces the set intersection of two sequences by * using the specified {@code EqualityComparer} to compare * values, eliminate duplicates. */ - Queryable intersect(Enumerable enumerable, + @Override Queryable intersect(Enumerable enumerable, EqualityComparer comparer); /** @@ -365,7 +365,7 @@ Queryable intersect(Enumerable enumerable, * using the specified {@code EqualityComparer} to compare * values, using {@code all} to indicate whether to eliminate duplicates. */ - Queryable intersect(Enumerable enumerable, + @Override Queryable intersect(Enumerable enumerable, EqualityComparer comparer, boolean all); /** @@ -443,9 +443,9 @@ > TResult min( *

NOTE: clazz parameter not present in C# LINQ; necessary because of * Java type erasure.

*/ - Queryable ofType(Class clazz); + @Override Queryable ofType(Class clazz); - Queryable cast(Class clazz); + @Override Queryable cast(Class clazz); /** * Sorts the elements of a sequence in ascending @@ -480,7 +480,7 @@ OrderedQueryable orderByDescending( /** * Inverts the order of the elements in a sequence. */ - Queryable reverse(); + @Override Queryable reverse(); /** @@ -564,7 +564,7 @@ Queryable selectManyN( * exception if there is more than one element in the * sequence. */ - TSource singleOrDefault(); + @Override TSource singleOrDefault(); /** * Returns the only element of a sequence that @@ -578,7 +578,7 @@ Queryable selectManyN( * Bypasses a specified number of elements in a * sequence and then returns the remaining elements. */ - Queryable skip(int count); + @Override Queryable skip(int count); /** * Bypasses elements in a sequence as long as a @@ -677,7 +677,7 @@ Float sumNullableFloat( * Returns a specified number of contiguous elements * from the start of a sequence. */ - Queryable take(int count); + @Override Queryable take(int count); /** * Returns elements from a sequence as long as a @@ -698,13 +698,13 @@ Queryable takeWhileN( * Produces the set union of two sequences by using * the default equality comparer. */ - Queryable union(Enumerable source1); + @Override Queryable union(Enumerable source1); /** * Produces the set union of two sequences by using a * specified {@code EqualityComparer}. */ - Queryable union(Enumerable source1, + @Override Queryable union(Enumerable source1, EqualityComparer comparer); /** diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/GroupingImpl.java b/linq4j/src/main/java/org/apache/calcite/linq4j/GroupingImpl.java index 9444dc540cf..dcc83601eb9 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/GroupingImpl.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/GroupingImpl.java @@ -55,23 +55,23 @@ class GroupingImpl extends AbstractEnumerable } // implement Map.Entry - public Enumerable getValue() { + @Override public Enumerable getValue() { return Linq4j.asEnumerable(values); } // implement Map.Entry - public Enumerable setValue(Enumerable value) { + @Override public Enumerable setValue(Enumerable value) { // immutable throw new UnsupportedOperationException(); } // implement Map.Entry // implement Grouping - public K getKey() { + @Override public K getKey() { return key; } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return Linq4j.enumerator(values); } } 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 b1251e898b0..dab1d5edfc6 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/Linq4j.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/Linq4j.java @@ -50,31 +50,31 @@ public static Method getMethod(String className, String methodName, * enumerator method; does not attempt optimization. */ public static final QueryProvider DEFAULT_PROVIDER = new QueryProviderImpl() { - public Enumerator executeQuery(Queryable queryable) { + @Override public Enumerator executeQuery(Queryable queryable) { return queryable.enumerator(); } }; private static final Enumerator EMPTY_ENUMERATOR = new Enumerator() { - public Object current() { + @Override public Object current() { throw new NoSuchElementException(); } - public boolean moveNext() { + @Override public boolean moveNext() { return false; } - public void reset() { + @Override public void reset() { } - public void close() { + @Override public void close() { } }; public static final Enumerable EMPTY_ENUMERABLE = new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return EMPTY_ENUMERATOR; } }; @@ -206,7 +206,7 @@ private static Enumerator listEnumerator(List list) { public static Enumerator transform(Enumerator enumerator, final Function1 func) { return new TransformedEnumerator(enumerator) { - protected E transform(F from) { + @Override protected E transform(F from) { return func.apply(from); } }; @@ -292,7 +292,7 @@ public static Enumerable ofType( */ public static Enumerable singletonEnumerable(final T element) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return singletonEnumerator(element); } }; @@ -450,14 +450,14 @@ static class IterableEnumerator implements Enumerator { current = (T) DUMMY; } - public T current() { + @Override public T current() { if (current == DUMMY) { throw new NoSuchElementException(); } return current; } - public boolean moveNext() { + @Override public boolean moveNext() { if (iterator.hasNext()) { current = iterator.next(); return true; @@ -466,12 +466,12 @@ public boolean moveNext() { return false; } - public void reset() { + @Override public void reset() { iterator = iterable.iterator(); current = (T) DUMMY; } - public void close() { + @Override public void close() { final Iterator iterator1 = this.iterator; this.iterator = null; closeIterator(iterator1); @@ -488,17 +488,17 @@ static class CompositeEnumerable extends AbstractEnumerable { this.enumerableList = enumerableList; } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { // Never null. Enumerator current = emptyEnumerator(); final Enumerator> enumerableEnumerator = iterableEnumerator(enumerableList); - public E current() { + @Override public E current() { return current.current(); } - public boolean moveNext() { + @Override public boolean moveNext() { for (;;) { if (current.moveNext()) { return true; @@ -512,12 +512,12 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { enumerableEnumerator.reset(); current = emptyEnumerator(); } - public void close() { + @Override public void close() { current.close(); current = emptyEnumerator(); } @@ -535,7 +535,7 @@ static class IterableEnumerable extends AbstractEnumerable2 { this.iterable = iterable; } - public Iterator iterator() { + @Override public Iterator iterator() { return iterable.iterator(); } @@ -625,19 +625,19 @@ private static class SingletonEnumerator implements Enumerator { this.e = e; } - public E current() { + @Override public E current() { return e; } - public boolean moveNext() { + @Override public boolean moveNext() { return i++ == 0; } - public void reset() { + @Override public void reset() { i = 0; } - public void close() { + @Override public void close() { } } @@ -647,19 +647,19 @@ public void close() { private static class SingletonNullEnumerator implements Enumerator { int i = 0; - public E current() { + @Override public E current() { return null; } - public boolean moveNext() { + @Override public boolean moveNext() { return i++ == 0; } - public void reset() { + @Override public void reset() { i = 0; } - public void close() { + @Override public void close() { } } @@ -676,21 +676,21 @@ private static class EnumeratorIterator hasNext = enumerator.moveNext(); } - public boolean hasNext() { + @Override public boolean hasNext() { return hasNext; } - public T next() { + @Override public T next() { T t = enumerator.current(); hasNext = enumerator.moveNext(); return t; } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } - public void close() { + @Override public void close() { enumerator.close(); } } @@ -706,19 +706,19 @@ private static class ListEnumerator implements Enumerator { this.list = list; } - public V current() { + @Override public V current() { return list.get(i); } - public boolean moveNext() { + @Override public boolean moveNext() { return ++i < list.size(); } - public void reset() { + @Override public void reset() { i = -1; } - public void close() { + @Override public void close() { } } @@ -732,7 +732,7 @@ private static class CartesianProductListEnumerator super(enumerators); } - public List current() { + @Override public List current() { return Arrays.asList(elements.clone()); } } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/LookupImpl.java b/linq4j/src/main/java/org/apache/calcite/linq4j/LookupImpl.java index def63c4fad2..7a5c4d4f41f 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/LookupImpl.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/LookupImpl.java @@ -46,26 +46,26 @@ class LookupImpl extends AbstractEnumerable> this.map = map; } - public Enumerator> enumerator() { + @Override public Enumerator> enumerator() { return new Enumerator>() { Enumerator>> enumerator = Linq4j.enumerator( map.entrySet()); - public Grouping current() { + @Override public Grouping current() { final Entry> keyAndList = enumerator.current(); return new GroupingImpl<>(keyAndList.getKey(), keyAndList.getValue()); } - public boolean moveNext() { + @Override public boolean moveNext() { return enumerator.moveNext(); } - public void reset() { + @Override public void reset() { enumerator.reset(); } - public void close() { + @Override public void close() { enumerator.close(); } }; @@ -73,129 +73,129 @@ public void close() { // Map methods - public int size() { + @Override public int size() { return map.size(); } - public boolean isEmpty() { + @Override public boolean isEmpty() { return map.isEmpty(); } - public boolean containsKey(Object key) { + @Override public boolean containsKey(Object key) { return map.containsKey(key); } - public boolean containsValue(Object value) { + @Override public boolean containsValue(Object value) { @SuppressWarnings("unchecked") List list = (List) value; return map.containsValue(list); } - public Enumerable get(Object key) { + @Override public Enumerable get(Object key) { final List list = map.get(key); return list == null ? null : Linq4j.asEnumerable(list); } - public Enumerable put(K key, Enumerable value) { + @Override public Enumerable put(K key, Enumerable value) { final List list = map.put(key, value.toList()); return list == null ? null : Linq4j.asEnumerable(list); } - public Enumerable remove(Object key) { + @Override public Enumerable remove(Object key) { final List list = map.remove(key); return list == null ? null : Linq4j.asEnumerable(list); } - public void putAll(Map> m) { + @Override public void putAll(Map> m) { for (Entry> entry : m.entrySet()) { map.put(entry.getKey(), entry.getValue().toList()); } } - public void clear() { + @Override public void clear() { map.clear(); } - public Set keySet() { + @Override public Set keySet() { return map.keySet(); } - public Collection> values() { + @Override public Collection> values() { final Collection> lists = map.values(); return new AbstractCollection>() { - public Iterator> iterator() { + @Override public Iterator> iterator() { return new Iterator>() { final Iterator> iterator = lists.iterator(); - public boolean hasNext() { + @Override public boolean hasNext() { return iterator.hasNext(); } - public Enumerable next() { + @Override public Enumerable next() { return Linq4j.asEnumerable(iterator.next()); } - public void remove() { + @Override public void remove() { iterator.remove(); } }; } - public int size() { + @Override public int size() { return lists.size(); } }; } - public Set>> entrySet() { + @Override public Set>> entrySet() { final Set>> entries = map.entrySet(); return new AbstractSet>>() { - public Iterator>> iterator() { + @Override public Iterator>> iterator() { final Iterator>> iterator = entries.iterator(); return new Iterator>>() { - public boolean hasNext() { + @Override public boolean hasNext() { return iterator.hasNext(); } - public Entry> next() { + @Override public Entry> next() { final Entry> entry = iterator.next(); return new AbstractMap.SimpleEntry<>(entry.getKey(), Linq4j.asEnumerable(entry.getValue())); } - public void remove() { + @Override public void remove() { iterator.remove(); } }; } - public int size() { + @Override public int size() { return entries.size(); } }; } - public Enumerable applyResultSelector( + @Override public Enumerable applyResultSelector( final Function2, TResult> resultSelector) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Enumerator> groupingEnumerator = LookupImpl.this.enumerator(); return new Enumerator() { - public TResult current() { + @Override public TResult current() { final Grouping grouping = groupingEnumerator.current(); return resultSelector.apply(grouping.getKey(), grouping); } - public boolean moveNext() { + @Override public boolean moveNext() { return groupingEnumerator.moveNext(); } - public void reset() { + @Override public void reset() { groupingEnumerator.reset(); } - public void close() { + @Override public void close() { groupingEnumerator.close(); } }; @@ -209,17 +209,17 @@ public void close() { */ public Enumerable valuesEnumerable() { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Enumerator> listEnumerator = Linq4j.iterableEnumerator(values()); return new Enumerator() { Enumerator enumerator = Linq4j.emptyEnumerator(); - public V current() { + @Override public V current() { return enumerator.current(); } - public boolean moveNext() { + @Override public boolean moveNext() { for (;;) { if (enumerator.moveNext()) { return true; @@ -233,12 +233,12 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { listEnumerator.reset(); enumerator = Linq4j.emptyEnumerator(); } - public void close() { + @Override public void close() { enumerator.close(); } }; diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/Ord.java b/linq4j/src/main/java/org/apache/calcite/linq4j/Ord.java index 500952980ba..7e92686a1f4 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/Ord.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/Ord.java @@ -63,15 +63,15 @@ public static Iterator> zip(final Iterator iterator) { return new Iterator>() { int n = 0; - public boolean hasNext() { + @Override public boolean hasNext() { return iterator.hasNext(); } - public Ord next() { + @Override public Ord next() { return Ord.of(n++, iterator.next()); } - public void remove() { + @Override public void remove() { iterator.remove(); } }; @@ -114,29 +114,29 @@ public static Iterable> reverse(Iterable elements) { return () -> new Iterator>() { int i = elementList.size() - 1; - public boolean hasNext() { + @Override public boolean hasNext() { return i >= 0; } - public Ord next() { + @Override public Ord next() { return Ord.of(i, elementList.get(i--)); } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException("remove"); } }; } - public Integer getKey() { + @Override public Integer getKey() { return i; } - public E getValue() { + @Override public E getValue() { return e; } - public E setValue(E value) { + @Override public E setValue(E value) { throw new UnsupportedOperationException(); } @@ -185,11 +185,11 @@ private static class OrdList extends AbstractList> { this.elements = elements; } - public Ord get(int index) { + @Override public Ord get(int index) { return Ord.of(index, elements.get(index)); } - public int size() { + @Override public int size() { return elements.size(); } } 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 3484c977f8b..a9fafcbe352 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProviderImpl.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryProviderImpl.java @@ -33,19 +33,19 @@ public QueryProviderImpl() { super(); } - public Queryable createQuery(Expression expression, Class rowType) { + @Override public Queryable createQuery(Expression expression, Class rowType) { return new QueryableImpl<>(this, rowType, expression); } - public Queryable createQuery(Expression expression, Type rowType) { + @Override public Queryable createQuery(Expression expression, Type rowType) { return new QueryableImpl<>(this, rowType, expression); } - public T execute(Expression expression, Class type) { + @Override public T execute(Expression expression, Class type) { throw new UnsupportedOperationException(); } - public T execute(Expression expression, Type type) { + @Override public T execute(Expression expression, Type type) { throw new UnsupportedOperationException(); } 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 8200c17470d..b4f5a069429 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableDefaults.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableDefaults.java @@ -225,7 +225,7 @@ public static Queryable cast(final Queryable source, final Class clazz) { return new BaseQueryable(source.getProvider(), clazz, source.getExpression()) { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new EnumerableDefaults.CastingEnumerator<>(source.enumerator(), clazz); } @@ -910,7 +910,7 @@ public static Queryable skipWhileN(final Queryable source, final FunctionExpression> predicate) { return new BaseQueryable(source.getProvider(), source.getElementType(), source.getExpression()) { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new EnumerableDefaults.SkipWhileEnumerator<>( source.enumerator(), predicate.getFunction()); } @@ -1045,7 +1045,7 @@ public static Queryable takeWhileN(final Queryable source, final FunctionExpression> predicate) { return new BaseQueryable(source.getProvider(), source.getElementType(), source.getExpression()) { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new EnumerableDefaults.TakeWhileEnumerator<>( source.enumerator(), predicate.getFunction()); } @@ -1118,7 +1118,7 @@ public static Queryable union(Queryable source0, public static Queryable where(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.where(source, predicate); } }; @@ -1156,14 +1156,14 @@ public interface Replayable extends Queryable { * @param element type */ public abstract static class ReplayableQueryable extends DefaultQueryable implements Replayable { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { } - public Iterator iterator() { + @Override public Iterator iterator() { return Linq4j.enumeratorIterator(enumerator()); } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return getProvider().executeQuery(this); } @@ -1198,15 +1198,15 @@ protected NonLeafReplayableQueryable(Queryable original) { this.original = original; } - public Type getElementType() { + @Override public Type getElementType() { return original.getElementType(); } - public Expression getExpression() { + @Override public Expression getExpression() { return original.getExpression(); } - public QueryProvider getProvider() { + @Override public QueryProvider getProvider() { return original.getProvider(); } } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableRecorder.java b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableRecorder.java index 17d399d58f7..c7c47b92d9e 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableRecorder.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/QueryableRecorder.java @@ -55,635 +55,635 @@ public static QueryableRecorder instance() { return INSTANCE; } - public T aggregate(final Queryable source, + @Override public T aggregate(final Queryable source, final FunctionExpression> func) { return new QueryableDefaults.NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.aggregate(source, func); } }.single(); // CHECKSTYLE: IGNORE 0 } - public TAccumulate aggregate(final Queryable source, + @Override public TAccumulate aggregate(final Queryable source, final TAccumulate seed, final FunctionExpression> func) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.aggregate(source, seed, func); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public TResult aggregate(final Queryable source, + @Override public TResult aggregate(final Queryable source, final TAccumulate seed, final FunctionExpression> func, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.aggregate(source, seed, func, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public boolean all(final Queryable source, + @Override public boolean all(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.all(source, predicate); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public boolean any(final Queryable source) { + @Override public boolean any(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.any(source); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public boolean any(final Queryable source, + @Override public boolean any(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.any(source, predicate); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public BigDecimal averageBigDecimal(final Queryable source, + @Override public BigDecimal averageBigDecimal(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.averageBigDecimal(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public BigDecimal averageNullableBigDecimal(final Queryable source, + @Override public BigDecimal averageNullableBigDecimal(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.averageNullableBigDecimal(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public double averageDouble(final Queryable source, + @Override public double averageDouble(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.averageDouble(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public Double averageNullableDouble(final Queryable source, + @Override public Double averageNullableDouble(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.averageNullableDouble(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public int averageInteger(final Queryable source, + @Override public int averageInteger(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.averageInteger(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public Integer averageNullableInteger(final Queryable source, + @Override public Integer averageNullableInteger(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.averageNullableInteger(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public float averageFloat(final Queryable source, + @Override public float averageFloat(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.averageFloat(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public Float averageNullableFloat(final Queryable source, + @Override public Float averageNullableFloat(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.averageNullableFloat(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public long averageLong(final Queryable source, + @Override public long averageLong(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.averageLong(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public Long averageNullableLong(final Queryable source, + @Override public Long averageNullableLong(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.averageNullableLong(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public Queryable cast(final Queryable source, + @Override public Queryable cast(final Queryable source, final Class clazz) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.cast(source, clazz); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable concat(final Queryable source, + @Override public Queryable concat(final Queryable source, final Enumerable source2) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.concat(source, source2); } }; } - public boolean contains(final Queryable source, final T element) { + @Override public boolean contains(final Queryable source, final T element) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.contains(source, element); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public boolean contains(final Queryable source, final T element, + @Override public boolean contains(final Queryable source, final T element, final EqualityComparer comparer) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.contains(source, element, comparer); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public int count(final Queryable source) { + @Override public int count(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.count(source); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public int count(final Queryable source, + @Override public int count(final Queryable source, final FunctionExpression> func) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.count(source, func); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public Queryable defaultIfEmpty(final Queryable source) { + @Override public Queryable defaultIfEmpty(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.defaultIfEmpty(source); } }; } - public Queryable defaultIfEmpty(final Queryable source, final T value) { + @Override public Queryable defaultIfEmpty(final Queryable source, final T value) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.defaultIfEmpty(source, value); } }; } - public Queryable distinct(final Queryable source) { + @Override public Queryable distinct(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.distinct(source); } }; } - public Queryable distinct(final Queryable source, + @Override public Queryable distinct(final Queryable source, final EqualityComparer comparer) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.distinct(source, comparer); } }; } - public T elementAt(final Queryable source, final int index) { + @Override public T elementAt(final Queryable source, final int index) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.elementAt(source, index); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public T elementAtOrDefault(final Queryable source, final int index) { + @Override public T elementAtOrDefault(final Queryable source, final int index) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.elementAtOrDefault(source, index); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public Queryable except(final Queryable source, + @Override public Queryable except(final Queryable source, final Enumerable enumerable) { return except(source, enumerable, false); } - public Queryable except(final Queryable source, + @Override public Queryable except(final Queryable source, final Enumerable enumerable, boolean all) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.except(source, enumerable, all); } }; } - public Queryable except(final Queryable source, + @Override public Queryable except(final Queryable source, final Enumerable enumerable, final EqualityComparer comparer) { return except(source, enumerable, comparer, false); } - public Queryable except(final Queryable source, + @Override public Queryable except(final Queryable source, final Enumerable enumerable, final EqualityComparer comparer, boolean all) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.except(source, enumerable, comparer, all); } }; } - public T first(final Queryable source) { + @Override public T first(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.first(source); } }.single(); // CHECKSTYLE: IGNORE 0 } - public T first(final Queryable source, + @Override public T first(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.first(source, predicate); } }.single(); // CHECKSTYLE: IGNORE 0 } - public T firstOrDefault(final Queryable source) { + @Override public T firstOrDefault(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.firstOrDefault(source); } }.single(); // CHECKSTYLE: IGNORE 0 } - public T firstOrDefault(final Queryable source, + @Override public T firstOrDefault(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.firstOrDefault(source, predicate); } }.single(); // CHECKSTYLE: IGNORE 0 } - public Queryable> groupBy(final Queryable source, + @Override public Queryable> groupBy(final Queryable source, final FunctionExpression> keySelector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.groupBy(source, keySelector); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable> groupBy(final Queryable source, + @Override public Queryable> groupBy(final Queryable source, final FunctionExpression> keySelector, final EqualityComparer comparer) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.groupBy(source, keySelector, comparer); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable> groupBy( + @Override public Queryable> groupBy( final Queryable source, final FunctionExpression> keySelector, final FunctionExpression> elementSelector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.groupBy(source, keySelector, elementSelector); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable> groupBy( + @Override public Queryable> groupBy( final Queryable source, final FunctionExpression> keySelector, final FunctionExpression> elementSelector, final EqualityComparer comparer) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.groupBy(source, keySelector, elementSelector, comparer); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable groupByK( + @Override public Queryable groupByK( final Queryable source, final FunctionExpression> keySelector, final FunctionExpression, TResult>> resultSelector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.groupByK(source, keySelector, resultSelector); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable groupByK(final Queryable source, + @Override public Queryable groupByK(final Queryable source, final FunctionExpression> keySelector, final FunctionExpression, TResult>> resultSelector, final EqualityComparer comparer) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.groupByK(source, keySelector, resultSelector, comparer); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable groupBy( + @Override public Queryable groupBy( final Queryable source, final FunctionExpression> keySelector, final FunctionExpression> elementSelector, final FunctionExpression, TResult>> resultSelector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.groupBy(source, keySelector, elementSelector, resultSelector); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable groupBy( + @Override public Queryable groupBy( final Queryable source, final FunctionExpression> keySelector, final FunctionExpression> elementSelector, final FunctionExpression, TResult>> resultSelector, final EqualityComparer comparer) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.groupBy(source, keySelector, elementSelector, resultSelector, comparer); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable groupJoin( + @Override public Queryable groupJoin( final Queryable source, final Enumerable inner, final FunctionExpression> outerKeySelector, final FunctionExpression> innerKeySelector, final FunctionExpression, TResult>> resultSelector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.groupJoin(source, inner, outerKeySelector, innerKeySelector, resultSelector); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable groupJoin( + @Override public Queryable groupJoin( final Queryable source, final Enumerable inner, final FunctionExpression> outerKeySelector, final FunctionExpression> innerKeySelector, final FunctionExpression, TResult>> resultSelector, final EqualityComparer comparer) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.groupJoin(source, inner, outerKeySelector, innerKeySelector, resultSelector, comparer); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable intersect(final Queryable source, + @Override public Queryable intersect(final Queryable source, final Enumerable enumerable) { return intersect(source, enumerable, false); } - public Queryable intersect(final Queryable source, + @Override public Queryable intersect(final Queryable source, final Enumerable enumerable, boolean all) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.intersect(source, enumerable, all); } }; } - public Queryable intersect(final Queryable source, + @Override public Queryable intersect(final Queryable source, final Enumerable enumerable, final EqualityComparer comparer) { return intersect(source, enumerable, comparer, false); } - public Queryable intersect(final Queryable source, + @Override public Queryable intersect(final Queryable source, final Enumerable enumerable, final EqualityComparer comparer, boolean all) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.intersect(source, enumerable, comparer, all); } }; } - public Queryable join( + @Override public Queryable join( final Queryable source, final Enumerable inner, final FunctionExpression> outerKeySelector, final FunctionExpression> innerKeySelector, final FunctionExpression> resultSelector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.join(source, inner, outerKeySelector, innerKeySelector, resultSelector); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable join( + @Override public Queryable join( final Queryable source, final Enumerable inner, final FunctionExpression> outerKeySelector, final FunctionExpression> innerKeySelector, final FunctionExpression> resultSelector, final EqualityComparer comparer) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.join(source, inner, outerKeySelector, innerKeySelector, resultSelector, comparer); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public T last(final Queryable source) { + @Override public T last(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.last(source); } }.single(); // CHECKSTYLE: IGNORE 0 } - public T last(final Queryable source, + @Override public T last(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.last(source, predicate); } }.single(); // CHECKSTYLE: IGNORE 0 } - public T lastOrDefault(final Queryable source) { + @Override public T lastOrDefault(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.lastOrDefault(source); } }.single(); // CHECKSTYLE: IGNORE 0 } - public T lastOrDefault(final Queryable source, + @Override public T lastOrDefault(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.lastOrDefault(source, predicate); } }.single(); // CHECKSTYLE: IGNORE 0 } - public long longCount(final Queryable source) { + @Override public long longCount(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.longCount(source); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public long longCount(final Queryable source, + @Override public long longCount(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.longCount(source, predicate); } }.longCount(); // CHECKSTYLE: IGNORE 0 } - public T max(final Queryable source) { + @Override public T max(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.max(source); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public > TResult max( + @Override public > TResult max( final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.max(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public T min(final Queryable source) { + @Override public T min(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.min(source); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public > TResult min( + @Override public > TResult min( final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.min(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public Queryable ofType(final Queryable source, + @Override public Queryable ofType(final Queryable source, final Class clazz) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.ofType(source, clazz); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public OrderedQueryable orderBy( + @Override public OrderedQueryable orderBy( final Queryable source, final FunctionExpression> keySelector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.orderBy(source, keySelector); } }; } - public OrderedQueryable orderBy(final Queryable source, + @Override public OrderedQueryable orderBy(final Queryable source, final FunctionExpression> keySelector, final Comparator comparator) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.orderBy(source, keySelector, comparator); } }; } - public OrderedQueryable orderByDescending( + @Override public OrderedQueryable orderByDescending( final Queryable source, final FunctionExpression> keySelector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.orderByDescending(source, keySelector); } }; } - public OrderedQueryable orderByDescending(final Queryable source, + @Override public OrderedQueryable orderByDescending(final Queryable source, final FunctionExpression> keySelector, final Comparator comparator) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.orderByDescending(source, keySelector, comparator); } }; } - public Queryable reverse(final Queryable source) { + @Override public Queryable reverse(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.reverse(source); } }; } - public Queryable select(final Queryable source, + @Override public Queryable select(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.select(source, selector); } @@ -693,336 +693,336 @@ public void replay(QueryableFactory factory) { }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable selectN(final Queryable source, + @Override public Queryable selectN(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.selectN(source, selector); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable selectMany(final Queryable source, + @Override public Queryable selectMany(final Queryable source, final FunctionExpression>> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.selectMany(source, selector); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable selectManyN(final Queryable source, + @Override public Queryable selectManyN(final Queryable source, final FunctionExpression>> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.selectManyN(source, selector); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable selectMany( + @Override public Queryable selectMany( final Queryable source, final FunctionExpression>> collectionSelector, final FunctionExpression> resultSelector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.selectMany(source, collectionSelector, resultSelector); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public Queryable selectManyN( + @Override public Queryable selectManyN( final Queryable source, final FunctionExpression>> collectionSelector, final FunctionExpression> resultSelector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.selectManyN(source, collectionSelector, resultSelector); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 } - public boolean sequenceEqual(final Queryable source, + @Override public boolean sequenceEqual(final Queryable source, final Enumerable enumerable) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.sequenceEqual(source, enumerable); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public boolean sequenceEqual(final Queryable source, + @Override public boolean sequenceEqual(final Queryable source, final Enumerable enumerable, final EqualityComparer comparer) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.sequenceEqual(source, enumerable, comparer); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public T single(final Queryable source) { + @Override public T single(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.single(source); } }.single(); // CHECKSTYLE: IGNORE 0 } - public T single(final Queryable source, + @Override public T single(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.single(source, predicate); } }.single(); // CHECKSTYLE: IGNORE 0 } - public T singleOrDefault(final Queryable source) { + @Override public T singleOrDefault(final Queryable source) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.singleOrDefault(source); } }.single(); // CHECKSTYLE: IGNORE 0 } - public T singleOrDefault(final Queryable source, + @Override public T singleOrDefault(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.singleOrDefault(source, predicate); } }.single(); // CHECKSTYLE: IGNORE 0 } - public Queryable skip(final Queryable source, final int count) { + @Override public Queryable skip(final Queryable source, final int count) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.skip(source, count); } }; } - public Queryable skipWhile(final Queryable source, + @Override public Queryable skipWhile(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.skipWhile(source, predicate); } }; } - public Queryable skipWhileN(final Queryable source, + @Override public Queryable skipWhileN(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.skipWhileN(source, predicate); } }; } - public BigDecimal sumBigDecimal(final Queryable source, + @Override public BigDecimal sumBigDecimal(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.sumBigDecimal(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public BigDecimal sumNullableBigDecimal(final Queryable source, + @Override public BigDecimal sumNullableBigDecimal(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.sumNullableBigDecimal(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public double sumDouble(final Queryable source, + @Override public double sumDouble(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.sumDouble(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public Double sumNullableDouble(final Queryable source, + @Override public Double sumNullableDouble(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.sumNullableDouble(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public int sumInteger(final Queryable source, + @Override public int sumInteger(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.sumInteger(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public Integer sumNullableInteger(final Queryable source, + @Override public Integer sumNullableInteger(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.sumNullableInteger(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public long sumLong(final Queryable source, + @Override public long sumLong(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.sumLong(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public Long sumNullableLong(final Queryable source, + @Override public Long sumNullableLong(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.sumNullableLong(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public float sumFloat(final Queryable source, + @Override public float sumFloat(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.sumFloat(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public Float sumNullableFloat(final Queryable source, + @Override public Float sumNullableFloat(final Queryable source, final FunctionExpression> selector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.sumNullableFloat(source, selector); } }.castSingle(); // CHECKSTYLE: IGNORE 0 } - public Queryable take(final Queryable source, final int count) { + @Override public Queryable take(final Queryable source, final int count) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.take(source, count); } }; } - public Queryable takeWhile(final Queryable source, + @Override public Queryable takeWhile(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.takeWhile(source, predicate); } }; } - public Queryable takeWhileN(final Queryable source, + @Override public Queryable takeWhileN(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.takeWhileN(source, predicate); } }; } - public > OrderedQueryable thenBy( + @Override public > OrderedQueryable thenBy( final OrderedQueryable source, final FunctionExpression> keySelector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.thenBy(source, keySelector); } }; } - public OrderedQueryable thenBy(final OrderedQueryable source, + @Override public OrderedQueryable thenBy(final OrderedQueryable source, final FunctionExpression> keySelector, final Comparator comparator) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.thenBy(source, keySelector, comparator); } }; } - public > OrderedQueryable thenByDescending( + @Override public > OrderedQueryable thenByDescending( final OrderedQueryable source, final FunctionExpression> keySelector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.thenByDescending(source, keySelector); } }; } - public OrderedQueryable thenByDescending( + @Override public OrderedQueryable thenByDescending( final OrderedQueryable source, final FunctionExpression> keySelector, final Comparator comparator) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.thenByDescending(source, keySelector, comparator); } }; } - public Queryable union(final Queryable source, + @Override public Queryable union(final Queryable source, final Enumerable source1) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.union(source, source1); } }; } - public Queryable union(final Queryable source, + @Override public Queryable union(final Queryable source, final Enumerable source1, final EqualityComparer comparer) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.union(source, source1, comparer); } }; } - public Queryable where(final Queryable source, + @Override public Queryable where(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.where(source, predicate); } }; } - public Queryable whereN(final Queryable source, + @Override public Queryable whereN(final Queryable source, final FunctionExpression> predicate) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.whereN(source, predicate); } }; } - public Queryable zip(final Queryable source, + @Override public Queryable zip(final Queryable source, final Enumerable source1, final FunctionExpression> resultSelector) { return new NonLeafReplayableQueryable(source) { - public void replay(QueryableFactory factory) { + @Override public void replay(QueryableFactory factory) { factory.zip(source, source1, resultSelector); } }.castQueryable(); // CHECKSTYLE: IGNORE 0 diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/TransformedEnumerator.java b/linq4j/src/main/java/org/apache/calcite/linq4j/TransformedEnumerator.java index 60a056fe0e3..cea0bcf3b87 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/TransformedEnumerator.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/TransformedEnumerator.java @@ -31,19 +31,19 @@ public TransformedEnumerator(Enumerator enumerator) { protected abstract E transform(F from); - public boolean moveNext() { + @Override public boolean moveNext() { return enumerator.moveNext(); } - public E current() { + @Override public E current() { return transform(enumerator.current()); } - public void reset() { + @Override public void reset() { enumerator.reset(); } - public void close() { + @Override public void close() { enumerator.close(); } } 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 539ea5016d3..58deaaefbbc 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 @@ -268,11 +268,11 @@ public static Function1 adapt(final FloatFunction1 f) { public static List adapt(final List list, final Function1 f) { return new AbstractList() { - public R get(int index) { + @Override public R get(int index) { return f.apply(list.get(index)); } - public int size() { + @Override public int size() { return list.size(); } }; @@ -288,11 +288,11 @@ public int size() { public static List adapt(final T[] ts, final Function1 f) { return new AbstractList() { - public R get(int index) { + @Override public R get(int index) { return f.apply(ts[index]); } - public int size() { + @Override public int size() { return ts.length; } }; @@ -491,11 +491,11 @@ public static EqualityComparer selectorComparer( /** Array equality comparer. */ private static class ArrayEqualityComparer implements EqualityComparer { - public boolean equal(Object[] v1, Object[] v2) { + @Override public boolean equal(Object[] v1, Object[] v2) { return Arrays.deepEquals(v1, v2); } - public int hashCode(Object[] t) { + @Override public int hashCode(Object[] t) { return Arrays.deepHashCode(t); } } @@ -503,11 +503,11 @@ public int hashCode(Object[] t) { /** Identity equality comparer. */ private static class IdentityEqualityComparer implements EqualityComparer { - public boolean equal(Object v1, Object v2) { + @Override public boolean equal(Object v1, Object v2) { return Objects.equals(v1, v2); } - public int hashCode(Object t) { + @Override public int hashCode(Object t) { return t == null ? 0x789d : t.hashCode(); } } @@ -524,14 +524,14 @@ private static final class SelectorEqualityComparer this.selector = selector; } - public boolean equal(T v1, T v2) { + @Override public boolean equal(T v1, T v2) { return v1 == v2 || v1 != null && v2 != null && Objects.equals(selector.apply(v1), selector.apply(v2)); } - public int hashCode(T t) { + @Override public int hashCode(T t) { return t == null ? 0x789d : selector.apply(t).hashCode(); } } @@ -539,7 +539,7 @@ public int hashCode(T t) { /** Nulls first comparator. */ private static class NullsFirstComparator implements Comparator, Serializable { - public int compare(Comparable o1, Comparable o2) { + @Override public int compare(Comparable o1, Comparable o2) { if (o1 == o2) { return 0; } @@ -557,7 +557,7 @@ public int compare(Comparable o1, Comparable o2) { /** Nulls last comparator. */ private static class NullsLastComparator implements Comparator, Serializable { - public int compare(Comparable o1, Comparable o2) { + @Override public int compare(Comparable o1, Comparable o2) { if (o1 == o2) { return 0; } @@ -575,7 +575,7 @@ public int compare(Comparable o1, Comparable o2) { /** Nulls first reverse comparator. */ private static class NullsFirstReverseComparator implements Comparator, Serializable { - public int compare(Comparable o1, Comparable o2) { + @Override public int compare(Comparable o1, Comparable o2) { if (o1 == o2) { return 0; } @@ -593,7 +593,7 @@ public int compare(Comparable o1, Comparable o2) { /** Nulls last reverse comparator. */ private static class NullsLastReverseComparator implements Comparator, Serializable { - public int compare(Comparable o1, Comparable o2) { + @Override public int compare(Comparable o1, Comparable o2) { if (o1 == o2) { return 0; } @@ -615,15 +615,15 @@ public int compare(Comparable o1, Comparable o2) { * @param second argument type */ private static final class Ignore implements Function0, Function1, Function2 { - public R apply() { + @Override public R apply() { return null; } - public R apply(T0 p0) { + @Override public R apply(T0 p0) { return null; } - public R apply(T0 p0, T1 p1) { + @Override public R apply(T0 p0, T1 p1) { return null; } @@ -643,11 +643,11 @@ private static class GeneratingList extends AbstractList this.fn = fn; } - public int size() { + @Override public int size() { return size; } - public E get(int index) { + @Override public E get(int index) { return fn.apply(index); } } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/AbstractNode.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/AbstractNode.java index 014db9045cc..dbbb0286077 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/AbstractNode.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/AbstractNode.java @@ -52,7 +52,7 @@ public Type getType() { return writer.toString(); } - public void accept(ExpressionWriter writer) { + @Override public void accept(ExpressionWriter writer) { accept(writer, 0, 0); } @@ -65,7 +65,7 @@ void accept(ExpressionWriter writer, int lprec, int rprec) { "un-parse not supported: " + getClass() + ":" + nodeType); } - public Node accept(Shuttle shuttle) { + @Override public Node accept(Shuttle shuttle) { throw new RuntimeException( "visit not supported: " + getClass() + ":" + nodeType); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ArrayLengthRecordField.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ArrayLengthRecordField.java index d6a6e2061e8..cabb59bb11e 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ArrayLengthRecordField.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ArrayLengthRecordField.java @@ -34,27 +34,27 @@ public ArrayLengthRecordField(String fieldName, Class clazz) { this.clazz = clazz; } - public boolean nullable() { + @Override public boolean nullable() { return false; } - public String getName() { + @Override public String getName() { return fieldName; } - public Type getType() { + @Override public Type getType() { return int.class; } - public int getModifiers() { + @Override public int getModifiers() { return 0; } - public Object get(Object o) throws IllegalAccessException { + @Override public Object get(Object o) throws IllegalAccessException { return Array.getLength(o); } - public Type getDeclaringClass() { + @Override public Type getDeclaringClass() { return clazz; } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BinaryExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BinaryExpression.java index a18025c2c9f..bd41b048d13 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BinaryExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BinaryExpression.java @@ -44,11 +44,11 @@ public class BinaryExpression extends Expression { return visitor.visit(this, expression0, expression1); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } - public Object evaluate(Evaluator evaluator) { + @Override public Object evaluate(Evaluator evaluator) { switch (nodeType) { case AndAlso: return (Boolean) expression0.evaluate(evaluator) @@ -203,7 +203,7 @@ public Object evaluate(Evaluator evaluator) { } } - void accept(ExpressionWriter writer, int lprec, int rprec) { + @Override void accept(ExpressionWriter writer, int lprec, int rprec) { if (writer.requireParentheses(this, lprec, rprec)) { return; } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BlockStatement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BlockStatement.java index 2aaa40bbf9d..8d8945c5358 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BlockStatement.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/BlockStatement.java @@ -59,7 +59,7 @@ private boolean distinctVariables(boolean fail) { return shuttle.visit(this, newStatements); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ClassDeclaration.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ClassDeclaration.java index f4e0c9a266c..6920caad9dc 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ClassDeclaration.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ClassDeclaration.java @@ -42,7 +42,7 @@ public ClassDeclaration(int modifier, String name, Type extended, this.implemented = implemented; } - public void accept(ExpressionWriter writer) { + @Override public void accept(ExpressionWriter writer) { String modifiers = Modifier.toString(modifier); writer.append(modifiers); if (!modifiers.isEmpty()) { @@ -59,14 +59,14 @@ public void accept(ExpressionWriter writer) { writer.newlineAndIndent(); } - public ClassDeclaration accept(Shuttle shuttle) { + @Override public ClassDeclaration accept(Shuttle shuttle) { shuttle = shuttle.preVisit(this); final List members1 = Expressions.acceptMemberDeclarations(memberDeclarations, shuttle); return shuttle.visit(this, members1); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } 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 55c00cefba4..64400e60015 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 @@ -41,7 +41,7 @@ public ConditionalExpression(List expressionList, Type type) { this.expressionList = expressionList; } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } 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 9d15a458bed..952e435197e 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 @@ -46,7 +46,7 @@ public ConditionalStatement(List expressionList) { return shuttle.visit(this, list); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConstantExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConstantExpression.java index 38b75879bc5..78cf208f33c 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConstantExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConstantExpression.java @@ -54,7 +54,7 @@ public ConstantExpression(Type type, Object value) { } } - public Object evaluate(Evaluator evaluator) { + @Override public Object evaluate(Evaluator evaluator) { return value; } @@ -62,7 +62,7 @@ public Object evaluate(Evaluator evaluator) { return shuttle.visit(this); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConstructorDeclaration.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConstructorDeclaration.java index 5cac1b91cae..aff9d788d07 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConstructorDeclaration.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ConstructorDeclaration.java @@ -52,11 +52,11 @@ public ConstructorDeclaration(int modifier, Type declaredAgainst, return shuttle.visit(this, body); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } - public void accept(ExpressionWriter writer) { + @Override public void accept(ExpressionWriter writer) { String modifiers = Modifier.toString(modifier); writer.append(modifiers); if (!modifiers.isEmpty()) { diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DeclarationStatement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DeclarationStatement.java index 31a529dcecc..84e2eba433d 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DeclarationStatement.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DeclarationStatement.java @@ -45,7 +45,7 @@ public DeclarationStatement(int modifiers, ParameterExpression parameter, return shuttle.visit(this, initializer); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DefaultExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DefaultExpression.java index 57381686917..93fca6aad6d 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DefaultExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DefaultExpression.java @@ -28,7 +28,7 @@ public DefaultExpression(Class type) { return shuttle.visit(this); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DeterministicCodeOptimizer.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DeterministicCodeOptimizer.java index e9168071c70..430bcf5193b 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DeterministicCodeOptimizer.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DeterministicCodeOptimizer.java @@ -224,7 +224,7 @@ && isMethodDeterministic(methodCallExpression.method)) { * @param expression input expression * @return parameter of the already existing declaration, or null */ - protected ParameterExpression findDeclaredExpression(Expression expression) { + @Override protected ParameterExpression findDeclaredExpression(Expression expression) { if (!dedup.isEmpty()) { ParameterExpression pe = dedup.get(expression); if (pe != null) { @@ -369,7 +369,7 @@ protected boolean allMethodsDeterministic(Class klass) { * * @return new Visitor that is used to optimize class declarations */ - protected DeterministicCodeOptimizer goDeeper() { + @Override protected DeterministicCodeOptimizer goDeeper() { return new DeterministicCodeOptimizer(this); } } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DynamicExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DynamicExpression.java index e56f1b89918..1bba6b3a397 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DynamicExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/DynamicExpression.java @@ -28,7 +28,7 @@ public DynamicExpression(Class type) { return shuttle.visit(this); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } 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 ed8a0391f61..9ec2984874e 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 @@ -34,7 +34,7 @@ public abstract class Expression extends AbstractNode { * @param nodeType Node type * @param type Type of the expression */ - public Expression(ExpressionType nodeType, Type type) { + protected Expression(ExpressionType nodeType, Type type) { super(nodeType, type); assert nodeType != null; assert type != null; 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 8260055542d..f62c8a8f5c2 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 @@ -3265,31 +3265,31 @@ private static class FluentArrayList extends ArrayList super(c); } - public FluentList append(T t) { + @Override public FluentList append(T t) { add(t); return this; } - public FluentList appendIf(boolean condition, T t) { + @Override public FluentList appendIf(boolean condition, T t) { if (condition) { add(t); } return this; } - public FluentList appendIfNotNull(T t) { + @Override public FluentList appendIfNotNull(T t) { if (t != null) { add(t); } return this; } - public FluentList appendAll(Iterable ts) { + @Override public FluentList appendAll(Iterable ts) { addAll(toCollection(ts)); return this; } - public FluentList appendAll(T... ts) { + @Override public FluentList appendAll(T... ts) { addAll(Arrays.asList(ts)); return this; } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/FieldDeclaration.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/FieldDeclaration.java index 7780f8c4dfb..ca235274ac3 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/FieldDeclaration.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/FieldDeclaration.java @@ -43,11 +43,11 @@ public FieldDeclaration(int modifier, ParameterExpression parameter, return shuttle.visit(this, initializer); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } - public void accept(ExpressionWriter writer) { + @Override public void accept(ExpressionWriter writer) { String modifiers = Modifier.toString(modifier); writer.append(modifiers); if (!modifiers.isEmpty()) { diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ForEachStatement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ForEachStatement.java index d2cc3eff9dd..a76ee68901b 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ForEachStatement.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ForEachStatement.java @@ -44,7 +44,7 @@ public ForEachStatement(ParameterExpression parameter, Expression iterable, return shuttle.visit(this, parameter, iterable1, body1); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ForStatement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ForStatement.java index feb2b616451..3b7c9a5d1a1 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ForStatement.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ForStatement.java @@ -54,7 +54,7 @@ public ForStatement(List declarations, return shuttle.visit(this, decls1, condition1, post1, body1); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/FunctionExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/FunctionExpression.java index 6ebf8b60a7c..8e1afaeab07 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/FunctionExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/FunctionExpression.java @@ -72,7 +72,7 @@ public FunctionExpression(Class type, BlockStatement body, return shuttle.visit(this, body); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/GotoStatement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/GotoStatement.java index 4c00e62f70c..8d0332f1b85 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/GotoStatement.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/GotoStatement.java @@ -61,7 +61,7 @@ public class GotoStatement extends Statement { return shuttle.visit(this, expression1); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/IndexExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/IndexExpression.java index 0f1c909f722..50bb8633d46 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/IndexExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/IndexExpression.java @@ -43,7 +43,7 @@ public IndexExpression(Expression array, List indexExpressions) { return shuttle.visit(this, array, indexExpressions); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/InvocationExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/InvocationExpression.java index aa83443aa02..dc91a62072d 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/InvocationExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/InvocationExpression.java @@ -29,7 +29,7 @@ public InvocationExpression(ExpressionType nodeType, Class type) { return shuttle.visit(this); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/LabelStatement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/LabelStatement.java index 38a5d279892..a65e78616b9 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/LabelStatement.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/LabelStatement.java @@ -37,7 +37,7 @@ public LabelStatement(Expression defaultValue, ExpressionType nodeType) { return shuttle.visit(this); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/LambdaExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/LambdaExpression.java index ee4386d40d4..dddafee40f4 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/LambdaExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/LambdaExpression.java @@ -29,7 +29,7 @@ public LambdaExpression(ExpressionType nodeType, Class type) { return shuttle.visit(this); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ListInitExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ListInitExpression.java index 59e2e4cc6b0..cf69b932d8e 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ListInitExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ListInitExpression.java @@ -28,7 +28,7 @@ public ListInitExpression(ExpressionType nodeType, Class type) { return shuttle.visit(this); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MemberDeclaration.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MemberDeclaration.java index c2463313838..a3a5e2d3e80 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MemberDeclaration.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MemberDeclaration.java @@ -20,5 +20,5 @@ * Declaration of a member of a class. */ public abstract class MemberDeclaration implements Node { - public abstract MemberDeclaration accept(Shuttle shuttle); + @Override public abstract MemberDeclaration accept(Shuttle shuttle); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MemberExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MemberExpression.java index d746ea19e58..945f49a335e 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MemberExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MemberExpression.java @@ -48,11 +48,11 @@ public MemberExpression(Expression expression, PseudoField field) { return shuttle.visit(this, expression1); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } - public Object evaluate(Evaluator evaluator) { + @Override public Object evaluate(Evaluator evaluator) { final Object o = expression == null ? null : expression.evaluate(evaluator); diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MemberInitExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MemberInitExpression.java index 1757660ad63..749a75ee124 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MemberInitExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MemberInitExpression.java @@ -29,7 +29,7 @@ public MemberInitExpression() { return shuttle.visit(this); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MethodCallExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MethodCallExpression.java index f98cfe0be02..5317367685b 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MethodCallExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MethodCallExpression.java @@ -60,7 +60,7 @@ public class MethodCallExpression extends Expression { return shuttle.visit(this, targetExpression, expressions); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MethodDeclaration.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MethodDeclaration.java index f40c15fb04a..a864f61c98f 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MethodDeclaration.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/MethodDeclaration.java @@ -53,11 +53,11 @@ public MethodDeclaration(int modifier, String name, Type resultType, return shuttle.visit(this, body); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } - public void accept(ExpressionWriter writer) { + @Override public void accept(ExpressionWriter writer) { String modifiers = Modifier.toString(modifier); writer.append(modifiers); if (!modifiers.isEmpty()) { diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/NewArrayExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/NewArrayExpression.java index 54cba746fde..59850c7ea2c 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/NewArrayExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/NewArrayExpression.java @@ -49,7 +49,7 @@ public NewArrayExpression(Type type, int dimension, Expression bound, return shuttle.visit(this, dimension, bound, expressions); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } 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 d42d67f5cf2..36e0916817e 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 @@ -50,7 +50,7 @@ public NewExpression(Type type, List arguments, return shuttle.visit(this, arguments, memberDeclarations); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ParameterExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ParameterExpression.java index fb7eaf2d22d..c51283731c0 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ParameterExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ParameterExpression.java @@ -47,11 +47,11 @@ public ParameterExpression(int modifier, Type type, String name) { return shuttle.visit(this); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } - public Object evaluate(Evaluator evaluator) { + @Override public Object evaluate(Evaluator evaluator) { return evaluator.peek(this); } 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 f95105d9391..05074468f83 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 @@ -253,11 +253,11 @@ public static Class unbox(Class type) { public static List asList(final Object array) { // REVIEW: A per-type list might be more efficient. (Or might not.) return new AbstractList() { - public Object get(int index) { + @Override public Object get(int index) { return Array.get(array, index); } - public int size() { + @Override public int size() { return Array.getLength(array); } }; diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ReflectedPseudoField.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ReflectedPseudoField.java index 4dc11a7b53d..4a5ace11f62 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ReflectedPseudoField.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ReflectedPseudoField.java @@ -31,23 +31,23 @@ public ReflectedPseudoField(Field field) { this.field = field; } - public String getName() { + @Override public String getName() { return field.getName(); } - public Type getType() { + @Override public Type getType() { return field.getType(); } - public int getModifiers() { + @Override public int getModifiers() { return field.getModifiers(); } - public Object get(Object o) throws IllegalAccessException { + @Override public Object get(Object o) throws IllegalAccessException { return field.get(o); } - public Class getDeclaringClass() { + @Override public Class getDeclaringClass() { return field.getDeclaringClass(); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/SwitchStatement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/SwitchStatement.java index 2ebcdc1bd8d..62265ebb262 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/SwitchStatement.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/SwitchStatement.java @@ -29,7 +29,7 @@ public SwitchStatement(ExpressionType nodeType) { return shuttle.visit(this); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/TernaryExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/TernaryExpression.java index 00ef60c370f..f42011dbaeb 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/TernaryExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/TernaryExpression.java @@ -46,11 +46,11 @@ public class TernaryExpression extends Expression { return shuttle.visit(this, expression0, expression1, expression2); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } - void accept(ExpressionWriter writer, int lprec, int rprec) { + @Override void accept(ExpressionWriter writer, int lprec, int rprec) { if (writer.requireParentheses(this, lprec, rprec)) { return; } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ThrowStatement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ThrowStatement.java index 0cd427d70d0..8b3504bff28 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ThrowStatement.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/ThrowStatement.java @@ -35,7 +35,7 @@ public ThrowStatement(Expression expression) { return shuttle.visit(this, expression); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/TryStatement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/TryStatement.java index 0ee3d7a96b1..cf3d4dd2891 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/TryStatement.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/TryStatement.java @@ -50,7 +50,7 @@ public TryStatement(Statement body, List catchBlocks, return shuttle.visit(this, body1, catchBlocks1, fynally1); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/TypeBinaryExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/TypeBinaryExpression.java index 967c228849c..869a960e2f8 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/TypeBinaryExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/TypeBinaryExpression.java @@ -40,11 +40,11 @@ public TypeBinaryExpression(ExpressionType nodeType, Expression expression, return shuttle.visit(this, expression); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } - void accept(ExpressionWriter writer, int lprec, int rprec) { + @Override void accept(ExpressionWriter writer, int lprec, int rprec) { if (writer.requireParentheses(this, lprec, rprec)) { return; } 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 a449a46a925..1eae6210449 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 @@ -555,15 +555,15 @@ static class ParameterizedTypeImpl implements ParameterizedType { return buf.toString(); } - public Type[] getActualTypeArguments() { + @Override public Type[] getActualTypeArguments() { return typeArguments.toArray(new Type[0]); } - public Type getRawType() { + @Override public Type getRawType() { return rawType; } - public Type getOwnerType() { + @Override public Type getOwnerType() { return ownerType; } } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/UnaryExpression.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/UnaryExpression.java index d07e545aa81..f3eeda61e9f 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/UnaryExpression.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/UnaryExpression.java @@ -37,11 +37,11 @@ public class UnaryExpression extends Expression { return shuttle.visit(this, expression); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } - void accept(ExpressionWriter writer, int lprec, int rprec) { + @Override void accept(ExpressionWriter writer, int lprec, int rprec) { switch (nodeType) { case Convert: if (!writer.requireParentheses(this, lprec, rprec)) { diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/VisitorImpl.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/VisitorImpl.java index 8d8431f2775..ffc84e83d78 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/VisitorImpl.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/VisitorImpl.java @@ -29,38 +29,38 @@ public VisitorImpl() { super(); } - public R visit(BinaryExpression binaryExpression) { + @Override public R visit(BinaryExpression binaryExpression) { R r0 = binaryExpression.expression0.accept(this); R r1 = binaryExpression.expression1.accept(this); return r1; } - public R visit(BlockStatement blockStatement) { + @Override public R visit(BlockStatement blockStatement) { return Expressions.acceptNodes(blockStatement.statements, this); } - public R visit(ClassDeclaration classDeclaration) { + @Override public R visit(ClassDeclaration classDeclaration) { return Expressions.acceptNodes(classDeclaration.memberDeclarations, this); } - public R visit(ConditionalExpression conditionalExpression) { + @Override public R visit(ConditionalExpression conditionalExpression) { return Expressions.acceptNodes(conditionalExpression.expressionList, this); } - public R visit(ConditionalStatement conditionalStatement) { + @Override public R visit(ConditionalStatement conditionalStatement) { return Expressions.acceptNodes(conditionalStatement.expressionList, this); } - public R visit(ConstantExpression constantExpression) { + @Override public R visit(ConstantExpression constantExpression) { return null; } - public R visit(ConstructorDeclaration constructorDeclaration) { + @Override public R visit(ConstructorDeclaration constructorDeclaration) { R r0 = Expressions.acceptNodes(constructorDeclaration.parameters, this); return constructorDeclaration.body.accept(this); } - public R visit(DeclarationStatement declarationStatement) { + @Override public R visit(DeclarationStatement declarationStatement) { R r = declarationStatement.parameter.accept(this); if (declarationStatement.initializer != null) { r = declarationStatement.initializer.accept(this); @@ -68,67 +68,67 @@ public R visit(DeclarationStatement declarationStatement) { return r; } - public R visit(DefaultExpression defaultExpression) { + @Override public R visit(DefaultExpression defaultExpression) { return null; } - public R visit(DynamicExpression dynamicExpression) { + @Override public R visit(DynamicExpression dynamicExpression) { return null; } - public R visit(FieldDeclaration fieldDeclaration) { + @Override public R visit(FieldDeclaration fieldDeclaration) { R r0 = fieldDeclaration.parameter.accept(this); return fieldDeclaration.initializer == null ? null : fieldDeclaration.initializer.accept(this); } - public R visit(ForStatement forStatement) { + @Override public R visit(ForStatement forStatement) { R r0 = Expressions.acceptNodes(forStatement.declarations, this); R r1 = forStatement.condition.accept(this); R r2 = forStatement.post.accept(this); return forStatement.body.accept(this); } - public R visit(ForEachStatement forEachStatement) { + @Override public R visit(ForEachStatement forEachStatement) { R r0 = forEachStatement.parameter.accept(this); R r1 = forEachStatement.iterable.accept(this); return forEachStatement.body.accept(this); } - public R visit(FunctionExpression functionExpression) { + @Override public R visit(FunctionExpression functionExpression) { @SuppressWarnings("unchecked") final List parameterList = functionExpression.parameterList; R r0 = Expressions.acceptNodes(parameterList, this); return functionExpression.body.accept(this); } - public R visit(GotoStatement gotoStatement) { + @Override public R visit(GotoStatement gotoStatement) { return gotoStatement.expression == null ? null : gotoStatement.expression.accept(this); } - public R visit(IndexExpression indexExpression) { + @Override public R visit(IndexExpression indexExpression) { R r0 = indexExpression.array.accept(this); return Expressions.acceptNodes(indexExpression.indexExpressions, this); } - public R visit(InvocationExpression invocationExpression) { + @Override public R visit(InvocationExpression invocationExpression) { return null; } - public R visit(LabelStatement labelStatement) { + @Override public R visit(LabelStatement labelStatement) { return labelStatement.defaultValue.accept(this); } - public R visit(LambdaExpression lambdaExpression) { + @Override public R visit(LambdaExpression lambdaExpression) { return null; } - public R visit(ListInitExpression listInitExpression) { + @Override public R visit(ListInitExpression listInitExpression) { return null; } - public R visit(MemberExpression memberExpression) { + @Override public R visit(MemberExpression memberExpression) { R r = null; if (memberExpression.expression != null) { r = memberExpression.expression.accept(this); @@ -136,11 +136,11 @@ public R visit(MemberExpression memberExpression) { return r; } - public R visit(MemberInitExpression memberInitExpression) { + @Override public R visit(MemberInitExpression memberInitExpression) { return null; } - public R visit(MethodCallExpression methodCallExpression) { + @Override public R visit(MethodCallExpression methodCallExpression) { R r = null; if (methodCallExpression.targetExpression != null) { r = methodCallExpression.targetExpression.accept(this); @@ -148,12 +148,12 @@ public R visit(MethodCallExpression methodCallExpression) { return Expressions.acceptNodes(methodCallExpression.expressions, this); } - public R visit(MethodDeclaration methodDeclaration) { + @Override public R visit(MethodDeclaration methodDeclaration) { R r0 = Expressions.acceptNodes(methodDeclaration.parameters, this); return methodDeclaration.body.accept(this); } - public R visit(NewArrayExpression newArrayExpression) { + @Override public R visit(NewArrayExpression newArrayExpression) { R r = null; if (newArrayExpression.bound != null) { r = newArrayExpression.bound.accept(this); @@ -161,30 +161,30 @@ public R visit(NewArrayExpression newArrayExpression) { return Expressions.acceptNodes(newArrayExpression.expressions, this); } - public R visit(NewExpression newExpression) { + @Override public R visit(NewExpression newExpression) { R r0 = Expressions.acceptNodes(newExpression.arguments, this); return Expressions.acceptNodes(newExpression.memberDeclarations, this); } - public R visit(ParameterExpression parameterExpression) { + @Override public R visit(ParameterExpression parameterExpression) { return null; } - public R visit(SwitchStatement switchStatement) { + @Override public R visit(SwitchStatement switchStatement) { return null; } - public R visit(TernaryExpression ternaryExpression) { + @Override public R visit(TernaryExpression ternaryExpression) { R r0 = ternaryExpression.expression0.accept(this); R r1 = ternaryExpression.expression1.accept(this); return ternaryExpression.expression2.accept(this); } - public R visit(ThrowStatement throwStatement) { + @Override public R visit(ThrowStatement throwStatement) { return throwStatement.expression.accept(this); } - public R visit(TryStatement tryStatement) { + @Override public R visit(TryStatement tryStatement) { R r = tryStatement.body.accept(this); for (CatchBlock catchBlock : tryStatement.catchBlocks) { r = catchBlock.parameter.accept(this); @@ -196,15 +196,15 @@ public R visit(TryStatement tryStatement) { return r; } - public R visit(TypeBinaryExpression typeBinaryExpression) { + @Override public R visit(TypeBinaryExpression typeBinaryExpression) { return typeBinaryExpression.expression.accept(this); } - public R visit(UnaryExpression unaryExpression) { + @Override public R visit(UnaryExpression unaryExpression) { return unaryExpression.expression.accept(this); } - public R visit(WhileStatement whileStatement) { + @Override public R visit(WhileStatement whileStatement) { R r0 = whileStatement.condition.accept(this); return whileStatement.body.accept(this); } diff --git a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/WhileStatement.java b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/WhileStatement.java index 76ab8b0f286..aa77d634bd8 100644 --- a/linq4j/src/main/java/org/apache/calcite/linq4j/tree/WhileStatement.java +++ b/linq4j/src/main/java/org/apache/calcite/linq4j/tree/WhileStatement.java @@ -40,7 +40,7 @@ public WhileStatement(Expression condition, Statement body) { return shuttle.visit(this, condition1, body1); } - public R accept(Visitor visitor) { + @Override public R accept(Visitor visitor) { return visitor.visit(this); } diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoAggregate.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoAggregate.java index 9d7fd8fcc24..d95b2638825 100644 --- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoAggregate.java +++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoAggregate.java @@ -92,7 +92,7 @@ public MongoAggregate(RelOptCluster cluster, RelTraitSet traitSet, } } - public void implement(Implementor implementor) { + @Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); List list = new ArrayList<>(); final List inNames = diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoEnumerator.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoEnumerator.java index b4a3bb27c56..a4d4074630a 100644 --- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoEnumerator.java +++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoEnumerator.java @@ -47,11 +47,11 @@ class MongoEnumerator implements Enumerator { this.getter = getter; } - public Object current() { + @Override public Object current() { return current; } - public boolean moveNext() { + @Override public boolean moveNext() { try { if (cursor.hasNext()) { Document map = cursor.next(); @@ -66,11 +66,11 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { throw new UnsupportedOperationException(); } - public void close() { + @Override public void close() { if (cursor instanceof MongoCursor) { ((MongoCursor) cursor).close(); } diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoFilter.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoFilter.java index 61a35c06f6c..158b44bac84 100644 --- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoFilter.java +++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoFilter.java @@ -62,12 +62,12 @@ public MongoFilter( return super.computeSelfCost(planner, mq).multiplyBy(0.1); } - public MongoFilter copy(RelTraitSet traitSet, RelNode input, + @Override public MongoFilter copy(RelTraitSet traitSet, RelNode input, RexNode condition) { return new MongoFilter(getCluster(), traitSet, input, condition); } - public void implement(Implementor implementor) { + @Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); Translator translator = new Translator(implementor.rexBuilder, diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoProject.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoProject.java index b465fd5e7b3..9b0328cf9d3 100644 --- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoProject.java +++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoProject.java @@ -64,7 +64,7 @@ public MongoProject(RelOptCluster cluster, RelTraitSet traitSet, return super.computeSelfCost(planner, mq).multiplyBy(0.1); } - public void implement(Implementor implementor) { + @Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); final MongoRules.RexToMongoTranslator translator = 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 c9775363d4e..f5863023493 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 @@ -36,7 +36,7 @@ public class MongoSchemaFactory implements SchemaFactory { public MongoSchemaFactory() { } - public Schema create(SchemaPlus parentSchema, String name, + @Override public Schema create(SchemaPlus parentSchema, String name, Map operand) { final String host = (String) operand.get("host"); final String database = (String) operand.get("database"); diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoSort.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoSort.java index 8bd8cce9d57..d48bd93dd3c 100644 --- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoSort.java +++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoSort.java @@ -56,7 +56,7 @@ public MongoSort(RelOptCluster cluster, RelTraitSet traitSet, fetch); } - public void implement(Implementor implementor) { + @Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); if (!collation.getFieldCollations().isEmpty()) { final List keys = new ArrayList<>(); 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 c78d537c0ae..e3d46e5c8b4 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 @@ -60,11 +60,11 @@ public class MongoTable extends AbstractQueryableTable this.collectionName = collectionName; } - public String toString() { + @Override public String toString() { return "MongoTable {" + collectionName + "}"; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { final RelDataType mapType = typeFactory.createMapType( typeFactory.createSqlType(SqlTypeName.VARCHAR), @@ -73,12 +73,12 @@ public RelDataType getRowType(RelDataTypeFactory typeFactory) { return typeFactory.builder().add("_MAP", mapType).build(); } - public Queryable asQueryable(QueryProvider queryProvider, + @Override public Queryable asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { return new MongoQueryable<>(queryProvider, schema, this, tableName); } - public RelNode toRel( + @Override public RelNode toRel( RelOptTable.ToRelContext context, RelOptTable relOptTable) { final RelOptCluster cluster = context.getCluster(); @@ -107,7 +107,7 @@ private Enumerable find(MongoDatabase mongoDb, String filterJson, projectJson == null ? null : BsonDocument.parse(projectJson); final Function1 getter = MongoEnumerator.getter(fields); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { @SuppressWarnings("unchecked") final FindIterable cursor = collection.find(filter).projection(project); return new MongoEnumerator(cursor.iterator(), getter); @@ -138,7 +138,7 @@ private Enumerable aggregate(final MongoDatabase mongoDb, final Function1 getter = MongoEnumerator.getter(fields); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Iterator resultIterator; try { resultIterator = mongoDb.getCollection(collectionName) @@ -162,7 +162,7 @@ public static class MongoQueryable extends AbstractTableQueryable { super(queryProvider, schema, table, tableName); } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { //noinspection unchecked final Enumerable enumerable = (Enumerable) getTable().find(getMongoDb(), null, null, null); 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 4a6657b82af..3c32629b059 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 @@ -84,7 +84,7 @@ protected MongoTableScan(RelOptCluster cluster, RelTraitSet traitSet, } } - public void implement(Implementor implementor) { + @Override public void implement(Implementor implementor) { implementor.mongoTable = mongoTable; implementor.table = table; } diff --git a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoToEnumerableConverter.java b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoToEnumerableConverter.java index 5d95e2c9a7b..91db089cdf6 100644 --- a/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoToEnumerableConverter.java +++ b/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoToEnumerableConverter.java @@ -66,7 +66,7 @@ protected MongoToEnumerableConverter( return super.computeSelfCost(planner, mq).multiplyBy(.1); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { // Generates a call to "find" or "aggregate", depending upon whether // an aggregate is present. // diff --git a/pig/src/main/java/org/apache/calcite/adapter/pig/PigSchemaFactory.java b/pig/src/main/java/org/apache/calcite/adapter/pig/PigSchemaFactory.java index bf4cea9488a..ad7e0db8d2e 100644 --- a/pig/src/main/java/org/apache/calcite/adapter/pig/PigSchemaFactory.java +++ b/pig/src/main/java/org/apache/calcite/adapter/pig/PigSchemaFactory.java @@ -36,7 +36,7 @@ public class PigSchemaFactory implements SchemaFactory { private PigSchemaFactory() { } - public Schema create(SchemaPlus parentSchema, String name, + @Override public Schema create(SchemaPlus parentSchema, String name, Map operand) { return new PigSchema(); } 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 c6436d654bc..7604f3a7e9f 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 @@ -36,7 +36,7 @@ public PigTableFactory() { } @SuppressWarnings("unchecked") - public PigTable create(SchemaPlus schema, String name, + @Override public PigTable create(SchemaPlus schema, String name, Map operand, RelDataType rowType) { String fileName = (String) operand.get("file"); File file = new File(fileName); diff --git a/pig/src/main/java/org/apache/calcite/adapter/pig/PigToEnumerableConverter.java b/pig/src/main/java/org/apache/calcite/adapter/pig/PigToEnumerableConverter.java index 94d325d4be7..4a6fe1b74f0 100644 --- a/pig/src/main/java/org/apache/calcite/adapter/pig/PigToEnumerableConverter.java +++ b/pig/src/main/java/org/apache/calcite/adapter/pig/PigToEnumerableConverter.java @@ -65,7 +65,7 @@ protected PigToEnumerableConverter( * store results in a predefined file so they can be read here and returned as * a {@code Result} object. */ - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { final BlockBuilder list = new BlockBuilder(); final PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), rowType, diff --git a/piglet/src/main/java/org/apache/calcite/piglet/PigRelSqlUdfs.java b/piglet/src/main/java/org/apache/calcite/piglet/PigRelSqlUdfs.java index 9ff48cbe80f..c34425c39ca 100644 --- a/piglet/src/main/java/org/apache/calcite/piglet/PigRelSqlUdfs.java +++ b/piglet/src/main/java/org/apache/calcite/piglet/PigRelSqlUdfs.java @@ -181,7 +181,7 @@ private static SqlOperandMetadata multisetProjectionCheck() { final int paramCount = 2; return new SqlOperandMetadata() { - public boolean checkOperandTypes( + @Override public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { // Need at least two arguments if (callBinding.getOperandCount() < 2) { @@ -212,19 +212,19 @@ public boolean checkOperandTypes( return true; } - public SqlOperandCountRange getOperandCountRange() { + @Override public SqlOperandCountRange getOperandCountRange() { return SqlOperandCountRanges.from(2); } - public String getAllowedSignatures(SqlOperator op, String opName) { + @Override public String getAllowedSignatures(SqlOperator op, String opName) { return opName + "(...)"; } - public boolean isOptional(int i) { + @Override public boolean isOptional(int i) { return false; } - public Consistency getConsistency() { + @Override public Consistency getConsistency() { return Consistency.NONE; } diff --git a/piglet/src/main/java/org/apache/calcite/piglet/PigRelToSqlConverter.java b/piglet/src/main/java/org/apache/calcite/piglet/PigRelToSqlConverter.java index 65674cc7178..674a54e7ce7 100644 --- a/piglet/src/main/java/org/apache/calcite/piglet/PigRelToSqlConverter.java +++ b/piglet/src/main/java/org/apache/calcite/piglet/PigRelToSqlConverter.java @@ -88,7 +88,7 @@ public class PigRelToSqlConverter extends RelToSqlConverter { // CHECKSTYLE: IGNORE 1 /** @see #dispatch */ - public Result visit(Window e) { + @Override public Result visit(Window e) { final Result x = visitInput(e, 0, Clause.SELECT); final Builder builder = x.builder(e); final List selectList = diff --git a/piglet/src/main/java/org/apache/calcite/piglet/PigTypes.java b/piglet/src/main/java/org/apache/calcite/piglet/PigTypes.java index 373925f771d..15418cf65ee 100644 --- a/piglet/src/main/java/org/apache/calcite/piglet/PigTypes.java +++ b/piglet/src/main/java/org/apache/calcite/piglet/PigTypes.java @@ -72,7 +72,7 @@ public RelDataType createMapType(RelDataType keyType, return createTypeWithNullability(super.createMapType(keyType, valueType), nullable); } - public RelDataType toSql(RelDataType type) { + @Override public RelDataType toSql(RelDataType type) { if (type instanceof JavaType && ((JavaType) type).getJavaClass() == DataBag.class) { // We don't know the structure of each tuple inside the bag until the runtime. diff --git a/plus/src/main/java/org/apache/calcite/adapter/os/DuTableFunction.java b/plus/src/main/java/org/apache/calcite/adapter/os/DuTableFunction.java index 98d388f85e3..3a0a72369b4 100644 --- a/plus/src/main/java/org/apache/calcite/adapter/os/DuTableFunction.java +++ b/plus/src/main/java/org/apache/calcite/adapter/os/DuTableFunction.java @@ -41,7 +41,7 @@ private DuTableFunction() {} public static ScannableTable eval(boolean b) { return new ScannableTable() { - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { return Processes.processLines("du", "-ak") .select(a0 -> { final String[] fields = a0.split("\t"); @@ -49,26 +49,26 @@ public Enumerable scan(DataContext root) { }); } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return typeFactory.builder() .add("size_k", SqlTypeName.BIGINT) .add("path", SqlTypeName.VARCHAR) .build(); } - public Statistic getStatistic() { + @Override public Statistic getStatistic() { return Statistics.of(1000d, ImmutableList.of(ImmutableBitSet.of(1))); } - public Schema.TableType getJdbcTableType() { + @Override public Schema.TableType getJdbcTableType() { return Schema.TableType.TABLE; } - public boolean isRolledUp(String column) { + @Override public boolean isRolledUp(String column) { return false; } - public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, + @Override public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, SqlNode parent, CalciteConnectionConfig config) { return true; } diff --git a/plus/src/main/java/org/apache/calcite/adapter/os/FilesTableFunction.java b/plus/src/main/java/org/apache/calcite/adapter/os/FilesTableFunction.java index 603fabb8d6a..769e20f0984 100644 --- a/plus/src/main/java/org/apache/calcite/adapter/os/FilesTableFunction.java +++ b/plus/src/main/java/org/apache/calcite/adapter/os/FilesTableFunction.java @@ -56,7 +56,7 @@ private FilesTableFunction() {} */ public static ScannableTable eval(final String path) { return new ScannableTable() { - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return typeFactory.builder() .add("access_time", SqlTypeName.TIMESTAMP) // %A@ sec since epoch .add("block_count", SqlTypeName.INTEGER) // %b in 512B blocks @@ -144,7 +144,7 @@ private Enumerable sourceMacOs() { return Processes.processLines('\n', args); } - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { final RelDataType rowType = getRowType(root.getTypeFactory()); final List fieldNames = ImmutableList.copyOf(rowType.getFieldNames()); @@ -160,16 +160,16 @@ public Enumerable scan(DataContext root) { enumerable = sourceLinux(); } return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Enumerator e = enumerable.enumerator(); return new Enumerator() { Object[] current; - public Object[] current() { + @Override public Object[] current() { return current; } - public boolean moveNext() { + @Override public boolean moveNext() { current = new Object[fieldNames.size()]; for (int i = 0; i < current.length; i++) { if (!e.moveNext()) { @@ -226,11 +226,11 @@ private int count(String s, char c) { return n; } - public void reset() { + @Override public void reset() { throw new UnsupportedOperationException(); } - public void close() { + @Override public void close() { e.close(); } @@ -259,19 +259,19 @@ private Object field(String field, String value) { }; } - public Statistic getStatistic() { + @Override public Statistic getStatistic() { return Statistics.of(1000d, ImmutableList.of(ImmutableBitSet.of(1))); } - public Schema.TableType getJdbcTableType() { + @Override public Schema.TableType getJdbcTableType() { return Schema.TableType.TABLE; } - public boolean isRolledUp(String column) { + @Override public boolean isRolledUp(String column) { return false; } - public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, + @Override public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, SqlNode parent, CalciteConnectionConfig config) { return true; } diff --git a/plus/src/main/java/org/apache/calcite/adapter/os/GitCommitsTableFunction.java b/plus/src/main/java/org/apache/calcite/adapter/os/GitCommitsTableFunction.java index 435df784cb3..e92751f3f2f 100644 --- a/plus/src/main/java/org/apache/calcite/adapter/os/GitCommitsTableFunction.java +++ b/plus/src/main/java/org/apache/calcite/adapter/os/GitCommitsTableFunction.java @@ -53,24 +53,24 @@ private GitCommitsTableFunction() {} public static ScannableTable eval(boolean b) { return new ScannableTable() { - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { final Enumerable enumerable = Processes.processLines("git", "log", "--pretty=raw"); return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Enumerator e = enumerable.enumerator(); return new Enumerator() { private Object[] objects; private final StringBuilder b = new StringBuilder(); - public Object[] current() { + @Override public Object[] current() { if (objects == null) { throw new NoSuchElementException(); } return objects; } - public boolean moveNext() { + @Override public boolean moveNext() { if (!e.moveNext()) { objects = null; return false; @@ -127,11 +127,11 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { throw new UnsupportedOperationException(); } - public void close() { + @Override public void close() { e.close(); } }; @@ -139,7 +139,7 @@ public void close() { }; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return typeFactory.builder() .add("commit", SqlTypeName.CHAR, 40) .add("tree", SqlTypeName.CHAR, 40) @@ -153,19 +153,19 @@ public RelDataType getRowType(RelDataTypeFactory typeFactory) { .build(); } - public Statistic getStatistic() { + @Override public Statistic getStatistic() { return Statistics.of(1000d, ImmutableList.of(ImmutableBitSet.of(0))); } - public Schema.TableType getJdbcTableType() { + @Override public Schema.TableType getJdbcTableType() { return Schema.TableType.TABLE; } - public boolean isRolledUp(String column) { + @Override public boolean isRolledUp(String column) { return false; } - public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, + @Override public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, SqlNode parent, CalciteConnectionConfig config) { return true; } diff --git a/plus/src/main/java/org/apache/calcite/adapter/os/JpsTableFunction.java b/plus/src/main/java/org/apache/calcite/adapter/os/JpsTableFunction.java index 9bc9cce4e0a..fda75aa7378 100644 --- a/plus/src/main/java/org/apache/calcite/adapter/os/JpsTableFunction.java +++ b/plus/src/main/java/org/apache/calcite/adapter/os/JpsTableFunction.java @@ -42,7 +42,7 @@ private JpsTableFunction() { public static ScannableTable eval(boolean b) { return new ScannableTable() { - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { return Processes.processLines("jps", "-mlvV") .select(a0 -> { final String[] fields = a0.split(" "); @@ -50,26 +50,26 @@ public Enumerable scan(DataContext root) { }); } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return typeFactory.builder() .add("pid", SqlTypeName.BIGINT) .add("info", SqlTypeName.VARCHAR) .build(); } - public Statistic getStatistic() { + @Override public Statistic getStatistic() { return Statistics.of(1000d, ImmutableList.of(ImmutableBitSet.of(1))); } - public Schema.TableType getJdbcTableType() { + @Override public Schema.TableType getJdbcTableType() { return Schema.TableType.TABLE; } - public boolean isRolledUp(String column) { + @Override public boolean isRolledUp(String column) { return false; } - public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, + @Override public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, SqlNode parent, CalciteConnectionConfig config) { return true; } diff --git a/plus/src/main/java/org/apache/calcite/adapter/os/Processes.java b/plus/src/main/java/org/apache/calcite/adapter/os/Processes.java index d397166096a..06e4e6447bc 100644 --- a/plus/src/main/java/org/apache/calcite/adapter/os/Processes.java +++ b/plus/src/main/java/org/apache/calcite/adapter/os/Processes.java @@ -77,7 +77,7 @@ private static class ProcessLinesEnumerator this.processSupplier = processSupplier; } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Process process = processSupplier.get(); final InputStream is = process.getInputStream(); final BufferedInputStream bis = @@ -88,11 +88,11 @@ public Enumerator enumerator() { return new Enumerator() { private String line; - public String current() { + @Override public String current() { return line; } - public boolean moveNext() { + @Override public boolean moveNext() { try { line = br.readLine(); return line != null; @@ -101,11 +101,11 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { throw new UnsupportedOperationException(); } - public void close() { + @Override public void close() { try { br.close(); } catch (IOException e) { @@ -128,7 +128,7 @@ private static class SeparatedLinesEnumerable this.sep = sep; } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Process process = processSupplier.get(); final InputStream is = process.getInputStream(); final BufferedInputStream bis = @@ -140,11 +140,11 @@ public Enumerator enumerator() { private final StringBuilder b = new StringBuilder(); private String line; - public String current() { + @Override public String current() { return line; } - public boolean moveNext() { + @Override public boolean moveNext() { try { for (;;) { int c = br.read(); @@ -163,11 +163,11 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { throw new UnsupportedOperationException(); } - public void close() { + @Override public void close() { try { br.close(); } catch (IOException e) { @@ -187,7 +187,7 @@ private static class ProcessFactory implements Supplier { this.args = args; } - public Process get() { + @Override public Process get() { try { return new ProcessBuilder().command(args).start(); } catch (IOException e) { diff --git a/plus/src/main/java/org/apache/calcite/adapter/os/PsTableFunction.java b/plus/src/main/java/org/apache/calcite/adapter/os/PsTableFunction.java index 1085ec1b35c..5962c6b6c94 100644 --- a/plus/src/main/java/org/apache/calcite/adapter/os/PsTableFunction.java +++ b/plus/src/main/java/org/apache/calcite/adapter/os/PsTableFunction.java @@ -53,7 +53,7 @@ private PsTableFunction() {} public static ScannableTable eval(boolean b) { return new ScannableTable() { - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { final RelDataType rowType = getRowType(root.getTypeFactory()); final List fieldNames = ImmutableList.copyOf(rowType.getFieldNames()); @@ -77,7 +77,7 @@ public Enumerable scan(DataContext root) { return Processes.processLines(args) .select( new Function1() { - public Object[] apply(String line) { + @Override public Object[] apply(String line) { final String[] fields = line.trim().split(" +"); final Object[] values = new Object[fieldNames.size()]; for (int i = 0; i < values.length; i++) { @@ -136,7 +136,7 @@ private Object field(String field, String value) { }); } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return typeFactory.builder() .add("pid", SqlTypeName.INTEGER) .add("ppid", SqlTypeName.INTEGER) @@ -158,19 +158,19 @@ public RelDataType getRowType(RelDataTypeFactory typeFactory) { .build(); } - public Statistic getStatistic() { + @Override public Statistic getStatistic() { return Statistics.of(1000d, ImmutableList.of(ImmutableBitSet.of(1))); } - public Schema.TableType getJdbcTableType() { + @Override public Schema.TableType getJdbcTableType() { return Schema.TableType.TABLE; } - public boolean isRolledUp(String column) { + @Override public boolean isRolledUp(String column) { return false; } - public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, + @Override public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, SqlNode parent, CalciteConnectionConfig config) { return true; } diff --git a/plus/src/main/java/org/apache/calcite/adapter/os/SqlShell.java b/plus/src/main/java/org/apache/calcite/adapter/os/SqlShell.java index 6370c675ce2..1d477bc4435 100644 --- a/plus/src/main/java/org/apache/calcite/adapter/os/SqlShell.java +++ b/plus/src/main/java/org/apache/calcite/adapter/os/SqlShell.java @@ -192,7 +192,7 @@ private static void addFunction(StringBuilder b, String name, Class c) { /** Output format. */ enum Format { SPACED { - protected void output(PrintWriter out, ResultSet r) throws SQLException { + @Override protected void output(PrintWriter out, ResultSet r) throws SQLException { final int n = r.getMetaData().getColumnCount(); final StringBuilder b = new StringBuilder(); while (r.next()) { @@ -208,7 +208,7 @@ protected void output(PrintWriter out, ResultSet r) throws SQLException { } }, HEADERS { - protected void output(PrintWriter out, ResultSet r) throws SQLException { + @Override protected void output(PrintWriter out, ResultSet r) throws SQLException { final ResultSetMetaData m = r.getMetaData(); final int n = m.getColumnCount(); final StringBuilder b = new StringBuilder(); @@ -224,7 +224,7 @@ protected void output(PrintWriter out, ResultSet r) throws SQLException { } }, CSV { - protected void output(PrintWriter out, ResultSet r) throws SQLException { + @Override protected void output(PrintWriter out, ResultSet r) throws SQLException { // We aim to comply with https://tools.ietf.org/html/rfc4180. // It's a bug if we don't. final ResultSetMetaData m = r.getMetaData(); @@ -268,7 +268,7 @@ private void value(StringBuilder b, String s) { } }, JSON { - protected void output(PrintWriter out, final ResultSet r) + @Override protected void output(PrintWriter out, final ResultSet r) throws SQLException { final ResultSetMetaData m = r.getMetaData(); final int n = m.getColumnCount(); @@ -323,7 +323,7 @@ protected void output(PrintWriter out, final ResultSet r) } }, MYSQL { - protected void output(PrintWriter out, final ResultSet r) + @Override protected void output(PrintWriter out, final ResultSet r) throws SQLException { // E.g. // +-------+--------+ diff --git a/plus/src/main/java/org/apache/calcite/adapter/os/StdinTableFunction.java b/plus/src/main/java/org/apache/calcite/adapter/os/StdinTableFunction.java index 7e226e065ea..26e36cd3ca9 100644 --- a/plus/src/main/java/org/apache/calcite/adapter/os/StdinTableFunction.java +++ b/plus/src/main/java/org/apache/calcite/adapter/os/StdinTableFunction.java @@ -50,25 +50,25 @@ private StdinTableFunction() {} public static ScannableTable eval(boolean b) { return new ScannableTable() { - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { final InputStream is = DataContext.Variable.STDIN.get(root); return new AbstractEnumerable() { final InputStreamReader in = new InputStreamReader(is, StandardCharsets.UTF_8); final BufferedReader br = new BufferedReader(in); - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new Enumerator() { String line; int i; - public Object[] current() { + @Override public Object[] current() { if (line == null) { throw new NoSuchElementException(); } return new Object[] {i, line}; } - public boolean moveNext() { + @Override public boolean moveNext() { try { line = br.readLine(); ++i; @@ -78,11 +78,11 @@ public boolean moveNext() { } } - public void reset() { + @Override public void reset() { throw new UnsupportedOperationException(); } - public void close() { + @Override public void close() { try { br.close(); } catch (IOException e) { @@ -94,26 +94,26 @@ public void close() { }; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return typeFactory.builder() .add("ordinal", SqlTypeName.INTEGER) .add("line", SqlTypeName.VARCHAR) .build(); } - public Statistic getStatistic() { + @Override public Statistic getStatistic() { return Statistics.of(1000d, ImmutableList.of(ImmutableBitSet.of(1))); } - public Schema.TableType getJdbcTableType() { + @Override public Schema.TableType getJdbcTableType() { return Schema.TableType.TABLE; } - public boolean isRolledUp(String column) { + @Override public boolean isRolledUp(String column) { return false; } - public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, + @Override public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, SqlNode parent, CalciteConnectionConfig config) { return true; } diff --git a/plus/src/main/java/org/apache/calcite/adapter/os/VmstatTableFunction.java b/plus/src/main/java/org/apache/calcite/adapter/os/VmstatTableFunction.java index e5b64295564..263c6d5474d 100644 --- a/plus/src/main/java/org/apache/calcite/adapter/os/VmstatTableFunction.java +++ b/plus/src/main/java/org/apache/calcite/adapter/os/VmstatTableFunction.java @@ -46,7 +46,7 @@ private VmstatTableFunction() {} public static ScannableTable eval(boolean b) { return new ScannableTable() { - public Enumerable scan(DataContext root) { + @Override public Enumerable scan(DataContext root) { final RelDataType rowType = getRowType(root.getTypeFactory()); final List fieldNames = ImmutableList.copyOf(rowType.getFieldNames()); @@ -69,7 +69,7 @@ public Enumerable scan(DataContext root) { return Processes.processLines(args) .select( new Function1() { - public Object[] apply(String line) { + @Override public Object[] apply(String line) { final String[] fields = line.trim().split("\\s+"); final Object[] values = new Object[fieldNames.size()]; for (int i = 0; i < values.length; i++) { @@ -97,7 +97,7 @@ private Object field(String field, String value) { }); } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { final String osName = System.getProperty("os.name"); final RelDataTypeFactory.Builder builder = typeFactory.builder(); switch (osName) { @@ -149,19 +149,19 @@ public RelDataType getRowType(RelDataTypeFactory typeFactory) { } } - public Statistic getStatistic() { + @Override public Statistic getStatistic() { return Statistics.of(1000d, ImmutableList.of(ImmutableBitSet.of(1))); } - public Schema.TableType getJdbcTableType() { + @Override public Schema.TableType getJdbcTableType() { return Schema.TableType.TABLE; } - public boolean isRolledUp(String column) { + @Override public boolean isRolledUp(String column) { return false; } - public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, + @Override public boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, SqlNode parent, CalciteConnectionConfig config) { return true; } diff --git a/plus/src/main/java/org/apache/calcite/adapter/tpcds/TpcdsSchema.java b/plus/src/main/java/org/apache/calcite/adapter/tpcds/TpcdsSchema.java index 903bd2ae51f..68840bad5ca 100644 --- a/plus/src/main/java/org/apache/calcite/adapter/tpcds/TpcdsSchema.java +++ b/plus/src/main/java/org/apache/calcite/adapter/tpcds/TpcdsSchema.java @@ -151,12 +151,12 @@ private class TpcdsQueryableTable return Statistics.of(rowCount, ImmutableList.of()); } - public Queryable asQueryable(final QueryProvider queryProvider, + @Override public Queryable asQueryable(final QueryProvider queryProvider, final SchemaPlus schema, final String tableName) { //noinspection unchecked return (Queryable) new AbstractTableQueryable(queryProvider, schema, this, tableName) { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Session session = Session.getDefaultSession() .withTable(tpcdsTable) @@ -167,7 +167,7 @@ public Enumerator enumerator() { new Function1>, Enumerable>() { final Column[] columns = tpcdsTable.getColumns(); - public Enumerable apply( + @Override public Enumerable apply( List> inRows) { final List rows = new ArrayList<>(); for (List strings : inRows) { @@ -186,7 +186,7 @@ public Enumerable apply( }; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { final RelDataTypeFactory.Builder builder = typeFactory.builder(); for (Column column : tpcdsTable.getColumns()) { builder.add(column.getName().toUpperCase(Locale.ROOT), 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 c29f9fe8721..07e8aab1106 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 @@ -34,7 +34,7 @@ public class TpcdsSchemaFactory implements SchemaFactory { public TpcdsSchemaFactory() { } - public Schema create(SchemaPlus parentSchema, String name, + @Override public Schema create(SchemaPlus parentSchema, String name, Map operand) { @SuppressWarnings("RawTypeCanBeGeneric") final Map map = operand; double scale = Util.first((Double) map.get("scale"), 1D); diff --git a/plus/src/main/java/org/apache/calcite/adapter/tpch/TpchSchema.java b/plus/src/main/java/org/apache/calcite/adapter/tpch/TpchSchema.java index 9b01a917f66..5812225b86f 100644 --- a/plus/src/main/java/org/apache/calcite/adapter/tpch/TpchSchema.java +++ b/plus/src/main/java/org/apache/calcite/adapter/tpch/TpchSchema.java @@ -91,17 +91,17 @@ private class TpchQueryableTable this.tpchTable = tpchTable; } - public Queryable asQueryable(final QueryProvider queryProvider, + @Override public Queryable asQueryable(final QueryProvider queryProvider, final SchemaPlus schema, final String tableName) { //noinspection unchecked return (Queryable) new AbstractTableQueryable(queryProvider, schema, this, tableName) { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final Enumerator iterator = Linq4j.iterableEnumerator( tpchTable.createGenerator(scaleFactor, part, partCount)); return new Enumerator() { - public Object[] current() { + @Override public Object[] current() { final List> columns = tpchTable.getColumns(); final Object[] objects = new Object[columns.size()]; int i = 0; @@ -128,22 +128,22 @@ private Object value(TpchColumn tpchColumn, E current) { } } - public boolean moveNext() { + @Override public boolean moveNext() { return iterator.moveNext(); } - public void reset() { + @Override public void reset() { iterator.reset(); } - public void close() { + @Override public void close() { } }; } }; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { final RelDataTypeFactory.Builder builder = typeFactory.builder(); String prefix = ""; if (columnPrefix) { 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 710f0f09dc4..ab73c85d7bf 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 @@ -34,7 +34,7 @@ public class TpchSchemaFactory implements SchemaFactory { public TpchSchemaFactory() { } - public Schema create(SchemaPlus parentSchema, String name, + @Override public Schema create(SchemaPlus parentSchema, String name, Map operand) { Map map = (Map) operand; double scale = Util.first((Double) map.get("scale"), 1D); diff --git a/plus/src/main/java/org/apache/calcite/chinook/ConnectionFactory.java b/plus/src/main/java/org/apache/calcite/chinook/ConnectionFactory.java index 582a5a15dad..18b0df5f0a1 100644 --- a/plus/src/main/java/org/apache/calcite/chinook/ConnectionFactory.java +++ b/plus/src/main/java/org/apache/calcite/chinook/ConnectionFactory.java @@ -29,7 +29,7 @@ public class ConnectionFactory implements Quidem.ConnectionFactory { private static final CalciteConnectionProvider CALCITE = new CalciteConnectionProvider(); - public Connection connect(String db, boolean bln) throws Exception { + @Override public Connection connect(String db, boolean bln) throws Exception { return DatabaseWrapper.valueOf(db).connection(); } diff --git a/redis/src/main/java/org/apache/calcite/adapter/redis/RedisEnumerator.java b/redis/src/main/java/org/apache/calcite/adapter/redis/RedisEnumerator.java index a964677ddf6..5edb5d063e2 100644 --- a/redis/src/main/java/org/apache/calcite/adapter/redis/RedisEnumerator.java +++ b/redis/src/main/java/org/apache/calcite/adapter/redis/RedisEnumerator.java @@ -64,19 +64,19 @@ static Map deduceRowType(RedisTableFieldInfo tableFieldInfo) { return fieldBuilder; } - public Object[] current() { + @Override public Object[] current() { return enumerator.current(); } - public boolean moveNext() { + @Override public boolean moveNext() { return enumerator.moveNext(); } - public void reset() { + @Override public void reset() { enumerator.reset(); } - public void close() { + @Override public void close() { enumerator.close(); } } diff --git a/redis/src/main/java/org/apache/calcite/adapter/redis/RedisSchemaFactory.java b/redis/src/main/java/org/apache/calcite/adapter/redis/RedisSchemaFactory.java index 6ad14b26c4a..bfc36ec2bb5 100644 --- a/redis/src/main/java/org/apache/calcite/adapter/redis/RedisSchemaFactory.java +++ b/redis/src/main/java/org/apache/calcite/adapter/redis/RedisSchemaFactory.java @@ -37,7 +37,7 @@ public class RedisSchemaFactory implements SchemaFactory { public RedisSchemaFactory() { } - public Schema create(SchemaPlus schema, String name, + @Override public Schema create(SchemaPlus schema, String name, Map operand) { Preconditions.checkArgument(operand.get("tables") != null, "tables must be specified"); diff --git a/redis/src/main/java/org/apache/calcite/adapter/redis/RedisTable.java b/redis/src/main/java/org/apache/calcite/adapter/redis/RedisTable.java index 2a56c424f11..f6ddbdf9f40 100644 --- a/redis/src/main/java/org/apache/calcite/adapter/redis/RedisTable.java +++ b/redis/src/main/java/org/apache/calcite/adapter/redis/RedisTable.java @@ -64,7 +64,7 @@ public RedisTable( this.redisConfig = redisConfig; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { if (protoRowType != null) { return protoRowType.apply(typeFactory); } @@ -102,7 +102,7 @@ static Table create( @Override public Enumerable scan(DataContext root) { return new AbstractEnumerable() { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { return new RedisEnumerator(redisConfig, schema, tableName); } }; diff --git a/server/src/main/java/org/apache/calcite/server/MutableArrayTable.java b/server/src/main/java/org/apache/calcite/server/MutableArrayTable.java index f450edc2bbd..9f7d52522fd 100644 --- a/server/src/main/java/org/apache/calcite/server/MutableArrayTable.java +++ b/server/src/main/java/org/apache/calcite/server/MutableArrayTable.java @@ -62,32 +62,32 @@ class MutableArrayTable extends AbstractModifiableTable Objects.requireNonNull(initializerExpressionFactory); } - public Collection getModifiableCollection() { + @Override public Collection getModifiableCollection() { return rows; } - public Queryable asQueryable(QueryProvider queryProvider, + @Override public Queryable asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { return new AbstractTableQueryable(queryProvider, schema, this, tableName) { - public Enumerator enumerator() { + @Override public Enumerator enumerator() { //noinspection unchecked return (Enumerator) Linq4j.enumerator(rows); } }; } - public Type getElementType() { + @Override public Type getElementType() { return Object[].class; } - public Expression getExpression(SchemaPlus schema, String tableName, + @Override public Expression getExpression(SchemaPlus schema, String tableName, Class clazz) { return Schemas.tableExpression(schema, getElementType(), tableName, clazz); } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { return protoRowType.apply(typeFactory); } 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 f3c0c3021b7..076585b3a8d 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 @@ -61,7 +61,7 @@ protected EnumerableToSparkConverter(RelOptCluster cluster, return super.computeSelfCost(planner, mq).multiplyBy(.01); } - public Result implementSpark(Implementor implementor) { + @Override public Result implementSpark(Implementor implementor) { // Generate: // Enumerable source = ...; // return SparkRuntime.createRdd(sparkContext, source); 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 b646005e351..a7ceb422faf 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 @@ -165,15 +165,15 @@ private static String findLocalIpAddress() throws IOException { private static Iterable iterable(final Enumeration enumeration) { return () -> new Iterator() { - public boolean hasNext() { + @Override public boolean hasNext() { return enumeration.hasMoreElements(); } - public E next() { + @Override public E next() { return enumeration.nextElement(); } - public void remove() { + @Override public void remove() { throw new UnsupportedOperationException(); } }; diff --git a/spark/src/main/java/org/apache/calcite/adapter/spark/JdbcToSparkConverter.java b/spark/src/main/java/org/apache/calcite/adapter/spark/JdbcToSparkConverter.java index 5090f68ad3c..73d0e2b89fb 100644 --- a/spark/src/main/java/org/apache/calcite/adapter/spark/JdbcToSparkConverter.java +++ b/spark/src/main/java/org/apache/calcite/adapter/spark/JdbcToSparkConverter.java @@ -65,7 +65,7 @@ protected JdbcToSparkConverter(RelOptCluster cluster, RelTraitSet traits, return super.computeSelfCost(planner, mq).multiplyBy(.1); } - public SparkRel.Result implementSpark(SparkRel.Implementor implementor) { + @Override public SparkRel.Result implementSpark(SparkRel.Implementor implementor) { // Generate: // ResultSetEnumerable.of(schema.getDataSource(), "select ...") final BlockBuilder list = new BlockBuilder(); diff --git a/spark/src/main/java/org/apache/calcite/adapter/spark/SparkHandlerImpl.java b/spark/src/main/java/org/apache/calcite/adapter/spark/SparkHandlerImpl.java index 2a6992410fb..975bf775348 100644 --- a/spark/src/main/java/org/apache/calcite/adapter/spark/SparkHandlerImpl.java +++ b/spark/src/main/java/org/apache/calcite/adapter/spark/SparkHandlerImpl.java @@ -83,7 +83,7 @@ public static CalcitePrepare.SparkHandler instance() { return Holder.INSTANCE; } - public RelNode flattenTypes(RelOptPlanner planner, RelNode rootRel, + @Override public RelNode flattenTypes(RelOptPlanner planner, RelNode rootRel, boolean restructure) { RelNode root2 = planner.changeTraits(rootRel, @@ -91,22 +91,22 @@ public RelNode flattenTypes(RelOptPlanner planner, RelNode rootRel, return planner.changeTraits(root2, rootRel.getTraitSet().simplify()); } - public void registerRules(RuleSetBuilder builder) { + @Override public void registerRules(RuleSetBuilder builder) { for (RelOptRule rule : SparkRules.rules()) { builder.addRule(rule); } builder.removeRule(EnumerableRules.ENUMERABLE_VALUES_RULE); } - public Object sparkContext() { + @Override public Object sparkContext() { return sparkContext; } - public boolean enabled() { + @Override public boolean enabled() { return true; } - public ArrayBindable compile(ClassDeclaration expr, String s) { + @Override public ArrayBindable compile(ClassDeclaration expr, String s) { final String className = "CalciteProgram" + classId.getAndIncrement(); final String classFileName = className + ".java"; String source = "public class " + className + "\n" diff --git a/spark/src/main/java/org/apache/calcite/adapter/spark/SparkRules.java b/spark/src/main/java/org/apache/calcite/adapter/spark/SparkRules.java index fc5274e6bba..6cac1c0c0a2 100644 --- a/spark/src/main/java/org/apache/calcite/adapter/spark/SparkRules.java +++ b/spark/src/main/java/org/apache/calcite/adapter/spark/SparkRules.java @@ -195,7 +195,7 @@ public static class SparkValues extends Values implements SparkRel { getCluster(), rowType, tuples, traitSet); } - public Result implementSpark(Implementor implementor) { + @Override public Result implementSpark(Implementor implementor) { /* return Linq4j.asSpark( new Object[][] { @@ -315,7 +315,7 @@ public SparkCalc(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, return planner.getCostFactory().makeCost(dRows, dCpu, dIo); } - public RelNode copy(RelTraitSet traitSet, List inputs) { + @Override public RelNode copy(RelTraitSet traitSet, List inputs) { return new SparkCalc( getCluster(), traitSet, @@ -328,7 +328,7 @@ public int getFlags() { return 1; } - public Result implementSpark(Implementor implementor) { + @Override public Result implementSpark(Implementor implementor) { final JavaTypeFactory typeFactory = implementor.getTypeFactory(); final BlockBuilder builder = new BlockBuilder(); final SparkRel child = (SparkRel) getInput(); 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 4883bcaf539..57345f9affa 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 @@ -66,7 +66,7 @@ protected SparkToEnumerableConverter(RelOptCluster cluster, return super.computeSelfCost(planner, mq).multiplyBy(.01); } - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { // Generate: // RDD rdd = ...; // return SparkRuntime.asEnumerable(rdd); @@ -101,23 +101,23 @@ private static class SparkImplementorImpl extends SparkRel.Implementor { this.implementor = implementor; } - public SparkRel.Result result(PhysType physType, + @Override public SparkRel.Result result(PhysType physType, BlockStatement blockStatement) { return new SparkRel.Result(physType, blockStatement); } - SparkRel.Result visitInput(SparkRel parent, int ordinal, SparkRel input) { + @Override SparkRel.Result visitInput(SparkRel parent, int ordinal, SparkRel input) { if (parent != null) { assert input == parent.getInputs().get(ordinal); } return input.implementSpark(this); } - public JavaTypeFactory getTypeFactory() { + @Override public JavaTypeFactory getTypeFactory() { return implementor.getTypeFactory(); } - public SqlConformance getConformance() { + @Override public SqlConformance getConformance() { return implementor.getConformance(); } } 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 874713c3ec0..77f76d27ad6 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 @@ -45,11 +45,11 @@ protected SplunkDriver() { new SplunkDriver().register(); } - protected String getConnectStringPrefix() { + @Override protected String getConnectStringPrefix() { return "jdbc:splunk:"; } - protected DriverVersion createDriverVersion() { + @Override protected DriverVersion createDriverVersion() { return new SplunkDriverVersion(); } @@ -91,12 +91,12 @@ protected DriverVersion createDriverVersion() { /** Connection that looks up responses from a static map. */ private static class MockSplunkConnection implements SplunkConnection { - public Enumerator getSearchResultEnumerator(String search, + @Override public Enumerator getSearchResultEnumerator(String search, Map otherArgs, List fieldList) { throw null; } - public void getSearchResults(String search, Map otherArgs, + @Override public void getSearchResults(String search, Map otherArgs, List fieldList, SearchResultListener srl) { throw new UnsupportedOperationException(); } @@ -110,14 +110,14 @@ private static class WrappingSplunkConnection implements SplunkConnection { this.connection = connection; } - public void getSearchResults(String search, Map otherArgs, + @Override public void getSearchResults(String search, Map otherArgs, List fieldList, SearchResultListener srl) { System.out.println("search='" + search + "', otherArgs=" + otherArgs + ", fieldList='" + fieldList); } - public Enumerator getSearchResultEnumerator(String search, + @Override public Enumerator getSearchResultEnumerator(String search, Map otherArgs, List fieldList) { throw new UnsupportedOperationException(); } diff --git a/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkQuery.java b/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkQuery.java index 445aece6b5f..4603f5b9002 100644 --- a/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkQuery.java +++ b/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkQuery.java @@ -53,11 +53,11 @@ public SplunkQuery( assert search != null; } - public String toString() { + @Override public String toString() { return "SplunkQuery {" + search + "}"; } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { //noinspection unchecked return (Enumerator) splunkConnection.getSearchResultEnumerator( search, getArgs(), fieldList); diff --git a/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkTable.java b/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkTable.java index 79e277d6de9..a3a82612d04 100644 --- a/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkTable.java +++ b/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkTable.java @@ -41,11 +41,11 @@ private SplunkTable() { super(Object[].class); } - public String toString() { + @Override public String toString() { return "SplunkTable"; } - public RelDataType getRowType(RelDataTypeFactory typeFactory) { + @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) { RelDataType stringType = ((JavaTypeFactory) typeFactory).createType(String.class); return typeFactory.builder() @@ -55,12 +55,12 @@ public RelDataType getRowType(RelDataTypeFactory typeFactory) { .build(); } - public Queryable asQueryable(QueryProvider queryProvider, + @Override public Queryable asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName) { return new SplunkTableQueryable<>(queryProvider, schema, this, tableName); } - public RelNode toRel( + @Override public RelNode toRel( RelOptTable.ToRelContext context, RelOptTable relOptTable) { return new SplunkTableScan( @@ -85,7 +85,7 @@ public static class SplunkTableQueryable super(queryProvider, schema, table, tableName); } - public Enumerator enumerator() { + @Override public Enumerator enumerator() { final SplunkQuery query = createQuery("search", null, null, null); return query.enumerator(); } 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 031c1ad43c5..8a4012a07f5 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 @@ -120,7 +120,7 @@ protected SplunkTableScan( String.class, List.class); - public Result implement(EnumerableRelImplementor implementor, Prefer pref) { + @Override public Result implement(EnumerableRelImplementor implementor, Prefer pref) { Map map = ImmutableMap.builder() .put("search", search) .put("earliest", Util.first(earliest, "")) 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 916eb70fe10..af6a951b265 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 @@ -122,14 +122,14 @@ private void connect() { } } - public void getSearchResults(String search, Map otherArgs, + @Override public void getSearchResults(String search, Map otherArgs, List fieldList, SearchResultListener srl) { assert srl != null; Enumerator x = getSearchResults_(search, otherArgs, fieldList, srl); assert x == null; } - public Enumerator getSearchResultEnumerator(String search, + @Override public Enumerator getSearchResultEnumerator(String search, Map otherArgs, List fieldList) { return getSearchResults_(search, otherArgs, fieldList, null); } @@ -302,11 +302,11 @@ public CountingSearchResultListener(boolean print) { this.print = print; } - public void setFieldNames(String[] fieldNames) { + @Override public void setFieldNames(String[] fieldNames) { this.fieldNames = fieldNames; } - public boolean processSearchResult(String[] values) { + @Override public boolean processSearchResult(String[] values) { resultCount++; if (print) { for (int i = 0; i < this.fieldNames.length; ++i) { @@ -383,11 +383,11 @@ public SplunkResultEnumerator(InputStream in, List wantedFields) { } } - public Object current() { + @Override public Object current() { return current; } - public boolean moveNext() { + @Override public boolean moveNext() { try { String[] line; while ((line = csvReader.readNext()) != null) { @@ -425,11 +425,11 @@ public boolean moveNext() { return false; } - public void reset() { + @Override public void reset() { throw new UnsupportedOperationException(); } - public void close() { + @Override public void close() { try { csvReader.close(); } catch (IOException e) { diff --git a/ubenchmark/src/jmh/java/org/apache/calcite/benchmarks/StatementTest.java b/ubenchmark/src/jmh/java/org/apache/calcite/benchmarks/StatementTest.java index ad794cbc514..0c9bbc50361 100644 --- a/ubenchmark/src/jmh/java/org/apache/calcite/benchmarks/StatementTest.java +++ b/ubenchmark/src/jmh/java/org/apache/calcite/benchmarks/StatementTest.java @@ -241,7 +241,7 @@ public Employee(int empid, int deptno, String name, float salary, this.commission = commission; } - public String toString() { + @Override public String toString() { return "Employee [empid: " + empid + ", deptno: " + deptno + ", name: " + name + "]"; } @@ -261,7 +261,7 @@ public Department( } - public String toString() { + @Override public String toString() { return "Department [deptno: " + deptno + ", name: " + name + ", employees: " + employees + "]"; }