Repository: calcite
Updated Branches:
  refs/heads/master 84b49a9c1 -> 01c544613


[CALCITE-1929] Deprecate class RelDataTypeFactory.FieldInfoBuilder

Replace uses of FieldInfoBuilder with new base class
RelDataTypeFactory.Builder that does not implement deprecated class
FieldInfo.


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/a98b21ea
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/a98b21ea
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/a98b21ea

Branch: refs/heads/master
Commit: a98b21ea33e80d801dd77cd215d23bd0debd8b67
Parents: 84b49a9
Author: Julian Hyde <jh...@apache.org>
Authored: Sun Aug 6 00:29:03 2017 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Mon Aug 7 09:14:46 2017 -0700

----------------------------------------------------------------------
 .../adapter/cassandra/CassandraSchema.java      |  2 +-
 .../adapter/cassandra/CassandraTable.java       |  2 +-
 .../adapter/enumerable/EnumerableWindow.java    |  3 +-
 .../adapter/enumerable/PhysTypeImpl.java        |  4 +-
 .../apache/calcite/adapter/jdbc/JdbcSchema.java |  2 +-
 .../calcite/interpreter/AggregateNode.java      |  2 +-
 .../apache/calcite/interpreter/Bindables.java   |  2 +-
 .../apache/calcite/interpreter/Interpreter.java |  2 +-
 .../calcite/interpreter/TableScanNode.java      |  2 +-
 .../org/apache/calcite/rel/core/Aggregate.java  |  2 +-
 .../org/apache/calcite/rel/core/Uncollect.java  |  2 +-
 .../apache/calcite/rel/externalize/RelJson.java |  2 +-
 .../rel/rules/ProjectWindowTransposeRule.java   |  4 +-
 .../calcite/rel/type/RelDataTypeFactory.java    | 65 ++++++++++++++------
 .../rel/type/RelDataTypeFactoryImpl.java        |  3 +-
 .../java/org/apache/calcite/rex/RexUtil.java    |  3 +-
 .../schema/impl/ModifiableViewTable.java        |  2 +-
 .../apache/calcite/sql/SqlUnnestOperator.java   |  2 +-
 .../calcite/sql/validate/SchemaNamespace.java   |  2 +-
 .../calcite/sql/validate/TableNamespace.java    |  2 +-
 .../calcite/sql/validate/WithItemNamespace.java |  2 +-
 .../apache/calcite/sql2rel/RelFieldTrimmer.java |  2 +-
 .../calcite/sql2rel/SqlToRelConverter.java      |  3 +-
 .../org/apache/calcite/tools/RelBuilder.java    | 10 +--
 .../parserextensiontesting/SqlCreateTable.java  |  2 +-
 .../org/apache/calcite/test/RexProgramTest.java |  2 +-
 .../java/org/apache/calcite/util/Smalls.java    |  3 +-
 .../calcite/adapter/druid/DruidRules.java       | 56 +++++++++--------
 .../calcite/adapter/druid/DruidTable.java       |  2 +-
 .../calcite/adapter/csv/CsvTableScan.java       |  2 +-
 .../calcite/adapter/file/FileTableScan.java     |  2 +-
 .../apache/calcite/adapter/pig/PigTable.java    |  2 +-
 .../java/org/apache/calcite/piglet/Handler.java |  4 +-
 .../calcite/adapter/os/VmstatTableFunction.java |  3 +-
 .../calcite/adapter/tpcds/TpcdsSchema.java      |  2 +-
 .../apache/calcite/adapter/tpch/TpchSchema.java |  2 +-
 .../calcite/adapter/splunk/SplunkTableScan.java |  2 +-
 37 files changed, 118 insertions(+), 93 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraSchema.java
----------------------------------------------------------------------
diff --git 
a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraSchema.java
 
b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraSchema.java
index b2f5a4e..00a7a40 100644
--- 
a/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraSchema.java
+++ 
b/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraSchema.java
@@ -134,7 +134,7 @@ public class CassandraSchema extends AbstractSchema {
     // proto-type will be copied into a real type factory.
     final RelDataTypeFactory typeFactory =
         new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
-    final RelDataTypeFactory.FieldInfoBuilder fieldInfo = 
typeFactory.builder();
+    final RelDataTypeFactory.Builder fieldInfo = typeFactory.builder();
     for (ColumnMetadata column : columns) {
       final String columnName = column.getName();
       final DataType type = column.getType();

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/cassandra/src/main/java/org/apache/calcite/adapter/cassandra/CassandraTable.java
----------------------------------------------------------------------
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 25786fb..26ea303 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
@@ -115,7 +115,7 @@ public class CassandraTable extends AbstractQueryableTable
     // Build the type of the resulting row based on the provided fields
     final RelDataTypeFactory typeFactory =
         new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
-    final RelDataTypeFactory.FieldInfoBuilder fieldInfo = 
typeFactory.builder();
+    final RelDataTypeFactory.Builder fieldInfo = typeFactory.builder();
     final RelDataType rowType = getRowType(typeFactory);
 
     Function1<String, Void> addField = new Function1<String, Void>() {

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableWindow.java
----------------------------------------------------------------------
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 5b5c418..59a8564 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
@@ -212,8 +212,7 @@ public class EnumerableWindow extends Window implements 
EnumerableRel {
       }
 
       // The output from this stage is the input plus the aggregate functions.
-      final RelDataTypeFactory.FieldInfoBuilder typeBuilder =
-          typeFactory.builder();
+      final RelDataTypeFactory.Builder typeBuilder = typeFactory.builder();
       typeBuilder.addAll(inputPhysType.getRowType().getFieldList());
       for (AggImpState agg : aggs) {
         typeBuilder.add(agg.call.name, agg.call.type);

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysTypeImpl.java
----------------------------------------------------------------------
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 a1977f5..487ddee 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
@@ -98,7 +98,7 @@ public class PhysTypeImpl implements PhysType {
   static PhysType of(
       final JavaTypeFactory typeFactory,
       Type javaRowClass) {
-    final RelDataTypeFactory.FieldInfoBuilder builder = typeFactory.builder();
+    final RelDataTypeFactory.Builder builder = typeFactory.builder();
     if (javaRowClass instanceof Types.RecordType) {
       final Types.RecordType recordType = (Types.RecordType) javaRowClass;
       for (Types.RecordField field : recordType.getRecordFields()) {
@@ -121,7 +121,7 @@ public class PhysTypeImpl implements PhysType {
 
   public PhysType project(List<Integer> integers, boolean indicator,
       JavaRowFormat format) {
-    final RelDataTypeFactory.FieldInfoBuilder builder = typeFactory.builder();
+    final RelDataTypeFactory.Builder builder = typeFactory.builder();
     for (int index : integers) {
       builder.add(rowType.getFieldList().get(index));
     }

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java
----------------------------------------------------------------------
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 5cd4b0b..69a411c 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
@@ -277,7 +277,7 @@ public class JdbcSchema implements Schema {
     // proto-type will be copied into a real type factory.
     final RelDataTypeFactory typeFactory =
         new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
-    final RelDataTypeFactory.FieldInfoBuilder fieldInfo = 
typeFactory.builder();
+    final RelDataTypeFactory.Builder fieldInfo = typeFactory.builder();
     while (resultSet.next()) {
       final String columnName = resultSet.getString(4);
       final int dataType = resultSet.getInt(5);

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java
----------------------------------------------------------------------
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 bc488e3..b25a268 100644
--- a/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java
+++ b/core/src/main/java/org/apache/calcite/interpreter/AggregateNode.java
@@ -153,7 +153,7 @@ public class AggregateNode extends 
AbstractSingleNode<Aggregate> {
       final PhysType inputPhysType =
           PhysTypeImpl.of(typeFactory, rel.getInput().getRowType(),
               JavaRowFormat.ARRAY);
-      final RelDataTypeFactory.FieldInfoBuilder builder = 
typeFactory.builder();
+      final RelDataTypeFactory.Builder builder = typeFactory.builder();
       for (Expression expression : agg.state) {
         builder.add("a",
             typeFactory.createJavaType((Class) expression.getType()));

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/interpreter/Bindables.java
----------------------------------------------------------------------
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 167181c..e009cd1 100644
--- a/core/src/main/java/org/apache/calcite/interpreter/Bindables.java
+++ b/core/src/main/java/org/apache/calcite/interpreter/Bindables.java
@@ -198,7 +198,7 @@ public class Bindables {
     }
 
     @Override public RelDataType deriveRowType() {
-      final RelDataTypeFactory.FieldInfoBuilder builder =
+      final RelDataTypeFactory.Builder builder =
           getCluster().getTypeFactory().builder();
       final List<RelDataTypeField> fieldList =
           table.getRowType().getFieldList();

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/interpreter/Interpreter.java
----------------------------------------------------------------------
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 16b70de..59c5dca 100644
--- a/core/src/main/java/org/apache/calcite/interpreter/Interpreter.java
+++ b/core/src/main/java/org/apache/calcite/interpreter/Interpreter.java
@@ -133,7 +133,7 @@ public class Interpreter extends 
AbstractEnumerable<Object[]>
   }
 
   RelDataType combinedRowType(List<RelNode> inputs) {
-    final RelDataTypeFactory.FieldInfoBuilder builder =
+    final RelDataTypeFactory.Builder builder =
         dataContext.getTypeFactory().builder();
     for (RelNode input : inputs) {
       builder.addAll(input.getRowType().getFieldList());

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/interpreter/TableScanNode.java
----------------------------------------------------------------------
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 dd75d57..9cec9e6 100644
--- a/core/src/main/java/org/apache/calcite/interpreter/TableScanNode.java
+++ b/core/src/main/java/org/apache/calcite/interpreter/TableScanNode.java
@@ -257,7 +257,7 @@ public class TableScanNode implements Node {
         final Mapping mapping = Mappings.target(acceptedProjects,
             rel.getTable().getRowType().getFieldCount());
         filter2 = RexUtil.apply(mapping, filter);
-        final RelDataTypeFactory.FieldInfoBuilder builder =
+        final RelDataTypeFactory.Builder builder =
             rel.getCluster().getTypeFactory().builder();
         final List<RelDataTypeField> fieldList =
             rel.getTable().getRowType().getFieldList();

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/rel/core/Aggregate.java
----------------------------------------------------------------------
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 f22b405..7388713 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
@@ -339,7 +339,7 @@ public abstract class Aggregate extends SingleRel {
       final List<AggregateCall> aggCalls) {
     final List<Integer> groupList = groupSet.asList();
     assert groupList.size() == groupSet.cardinality();
-    final RelDataTypeFactory.FieldInfoBuilder builder = typeFactory.builder();
+    final RelDataTypeFactory.Builder builder = typeFactory.builder();
     final List<RelDataTypeField> fieldList = inputRowType.getFieldList();
     final Set<String> containedNames = Sets.newHashSet();
     for (int groupKey : groupList) {

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/rel/core/Uncollect.java
----------------------------------------------------------------------
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 d391f93..0f9e0b9 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
@@ -123,7 +123,7 @@ public class Uncollect extends SingleRel {
     RelDataType inputType = rel.getRowType();
     assert inputType.isStruct() : inputType + " is not a struct";
     final List<RelDataTypeField> fields = inputType.getFieldList();
-    final RelDataTypeFactory.FieldInfoBuilder builder =
+    final RelDataTypeFactory.Builder builder =
         rel.getCluster().getTypeFactory().builder();
     for (RelDataTypeField field : fields) {
       if (field.getType() instanceof MapSqlType) {

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java 
b/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java
index f4a1f21..d8db9c3 100644
--- a/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java
+++ b/core/src/main/java/org/apache/calcite/rel/externalize/RelJson.java
@@ -192,7 +192,7 @@ public class RelJson {
     if (o instanceof List) {
       @SuppressWarnings("unchecked")
       final List<Map<String, Object>> jsonList = (List<Map<String, Object>>) o;
-      final RelDataTypeFactory.FieldInfoBuilder builder = 
typeFactory.builder();
+      final RelDataTypeFactory.Builder builder = typeFactory.builder();
       for (Map<String, Object> jsonMap : jsonList) {
         builder.add((String) jsonMap.get("name"), toType(typeFactory, 
jsonMap));
       }

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/rel/rules/ProjectWindowTransposeRule.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/calcite/rel/rules/ProjectWindowTransposeRule.java
 
b/core/src/main/java/org/apache/calcite/rel/rules/ProjectWindowTransposeRule.java
index 0cf2949..152a3d2 100644
--- 
a/core/src/main/java/org/apache/calcite/rel/rules/ProjectWindowTransposeRule.java
+++ 
b/core/src/main/java/org/apache/calcite/rel/rules/ProjectWindowTransposeRule.java
@@ -75,7 +75,7 @@ public class ProjectWindowTransposeRule extends RelOptRule {
 
     // Put a DrillProjectRel below LogicalWindow
     final List<RexNode> exps = new ArrayList<>();
-    final RelDataTypeFactory.FieldInfoBuilder builder =
+    final RelDataTypeFactory.Builder builder =
         cluster.getTypeFactory().builder();
 
     // Keep only the fields which are referred
@@ -123,7 +123,7 @@ public class ProjectWindowTransposeRule extends RelOptRule {
     };
 
     int aggCallIndex = windowInputColumn;
-    final RelDataTypeFactory.FieldInfoBuilder outputBuilder =
+    final RelDataTypeFactory.Builder outputBuilder =
         cluster.getTypeFactory().builder();
     outputBuilder.addAll(projectBelowWindow.getRowType().getFieldList());
     for (Window.Group group : window.groups) {

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java 
b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java
index f5e1b44..67e19b9 100644
--- a/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java
+++ b/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java
@@ -23,6 +23,8 @@ import org.apache.calcite.sql.parser.SqlParserPos;
 import org.apache.calcite.sql.type.SqlTypeName;
 import org.apache.calcite.sql.validate.SqlValidatorUtil;
 
+import com.google.common.base.Preconditions;
+
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.List;
@@ -301,7 +303,10 @@ public interface RelDataTypeFactory {
   /**
    * Creates a
    * {@link org.apache.calcite.rel.type.RelDataTypeFactory.FieldInfoBuilder}.
+   * But since {@code FieldInfoBuilder} is deprecated, we recommend that you 
use
+   * its base class {@link Builder}, which is not deprecated.
    */
+  @SuppressWarnings("deprecation")
   FieldInfoBuilder builder();
 
   //~ Inner Interfaces -------------------------------------------------------
@@ -339,29 +344,53 @@ public interface RelDataTypeFactory {
    * Implementation of {@link FieldInfo} that provides a fluid API to build
    * a list of fields.
    */
+  @Deprecated
   @SuppressWarnings("deprecation")
-  class FieldInfoBuilder implements FieldInfo {
+  class FieldInfoBuilder extends Builder implements FieldInfo {
+    public FieldInfoBuilder(RelDataTypeFactory typeFactory) {
+      super(typeFactory);
+    }
+  }
+
+  /** Fluid API to build a list of fields. */
+  class Builder {
     private final List<String> names = new ArrayList<>();
     private final List<RelDataType> types = new ArrayList<>();
     private StructKind kind = StructKind.FULLY_QUALIFIED;
     private final RelDataTypeFactory typeFactory;
 
     /**
-     * Creates a FieldInfoBuilder with the given type factory.
+     * Creates a Builder with the given type factory.
      */
-    public FieldInfoBuilder(RelDataTypeFactory typeFactory) {
-      this.typeFactory = typeFactory;
-      assert typeFactory != null;
+    public Builder(RelDataTypeFactory typeFactory) {
+      this.typeFactory = Preconditions.checkNotNull(typeFactory);
     }
 
+    /**
+     * Returns the number of fields.
+     *
+     * @return number of fields
+     */
     public int getFieldCount() {
       return names.size();
     }
 
+    /**
+     * Returns the name of a given field.
+     *
+     * @param index Ordinal of field
+     * @return Name of given field
+     */
     public String getFieldName(int index) {
       return names.get(index);
     }
 
+    /**
+     * Returns the type of a given field.
+     *
+     * @param index Ordinal of field
+     * @return Type of given field
+     */
     public RelDataType getFieldType(int index) {
       return types.get(index);
     }
@@ -369,7 +398,7 @@ public interface RelDataTypeFactory {
     /**
      * Adds a field with given name and type.
      */
-    public FieldInfoBuilder add(String name, RelDataType type) {
+    public Builder add(String name, RelDataType type) {
       names.add(name);
       types.add(type);
       return this;
@@ -379,7 +408,7 @@ public interface RelDataTypeFactory {
      * Adds a field with a type created using
      * {@link 
org.apache.calcite.rel.type.RelDataTypeFactory#createSqlType(org.apache.calcite.sql.type.SqlTypeName)}.
      */
-    public FieldInfoBuilder add(String name, SqlTypeName typeName) {
+    public Builder add(String name, SqlTypeName typeName) {
       add(name, typeFactory.createSqlType(typeName));
       return this;
     }
@@ -388,8 +417,7 @@ public interface RelDataTypeFactory {
      * Adds a field with a type created using
      * {@link 
org.apache.calcite.rel.type.RelDataTypeFactory#createSqlType(org.apache.calcite.sql.type.SqlTypeName,
 int)}.
      */
-    public FieldInfoBuilder add(
-        String name, SqlTypeName typeName, int precision) {
+    public Builder add(String name, SqlTypeName typeName, int precision) {
       add(name, typeFactory.createSqlType(typeName, precision));
       return this;
     }
@@ -398,8 +426,8 @@ public interface RelDataTypeFactory {
      * Adds a field with a type created using
      * {@link 
org.apache.calcite.rel.type.RelDataTypeFactory#createSqlType(org.apache.calcite.sql.type.SqlTypeName,
 int, int)}.
      */
-    public FieldInfoBuilder add(
-        String name, SqlTypeName typeName, int precision, int scale) {
+    public Builder add(String name, SqlTypeName typeName, int precision,
+        int scale) {
       add(name, typeFactory.createSqlType(typeName, precision, scale));
       return this;
     }
@@ -407,9 +435,8 @@ public interface RelDataTypeFactory {
     /**
      * Adds a field with an interval type.
      */
-    public FieldInfoBuilder add(String name, TimeUnit startUnit,
-        int startPrecision, TimeUnit endUnit,
-        int fractionalSecondPrecision) {
+    public Builder add(String name, TimeUnit startUnit, int startPrecision,
+        TimeUnit endUnit, int fractionalSecondPrecision) {
       final SqlIntervalQualifier q =
           new SqlIntervalQualifier(startUnit, startPrecision, endUnit,
               fractionalSecondPrecision, SqlParserPos.ZERO);
@@ -423,7 +450,7 @@ public interface RelDataTypeFactory {
      * @throws java.lang.IndexOutOfBoundsException if no fields have been
      *                                             added
      */
-    public FieldInfoBuilder nullable(boolean nullable) {
+    public Builder nullable(boolean nullable) {
       RelDataType lastType = types.get(types.size() - 1);
       if (lastType.isNullable() != nullable) {
         final RelDataType type =
@@ -436,7 +463,7 @@ public interface RelDataTypeFactory {
     /**
      * Adds a field. Field's ordinal is ignored.
      */
-    public FieldInfoBuilder add(RelDataTypeField field) {
+    public Builder add(RelDataTypeField field) {
       add(field.getName(), field.getType());
       return this;
     }
@@ -444,7 +471,7 @@ public interface RelDataTypeFactory {
     /**
      * Adds all fields in a collection.
      */
-    public FieldInfoBuilder addAll(
+    public Builder addAll(
         Iterable<? extends Map.Entry<String, RelDataType>> fields) {
       for (Map.Entry<String, RelDataType> field : fields) {
         add(field.getKey(), field.getValue());
@@ -452,7 +479,7 @@ public interface RelDataTypeFactory {
       return this;
     }
 
-    public FieldInfoBuilder kind(StructKind kind) {
+    public Builder kind(StructKind kind) {
       this.kind = kind;
       return this;
     }
@@ -460,7 +487,7 @@ public interface RelDataTypeFactory {
     /**
      * Makes sure that field names are unique.
      */
-    public FieldInfoBuilder uniquify() {
+    public Builder uniquify() {
       final List<String> uniqueNames = SqlValidatorUtil.uniquify(names,
           typeFactory.getTypeSystem().isSchemaCaseSensitive());
       if (uniqueNames != names) {

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactoryImpl.java
----------------------------------------------------------------------
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 cc6f982..4c1f474 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
@@ -221,7 +221,7 @@ public abstract class RelDataTypeFactoryImpl implements 
RelDataTypeFactory {
     }
 
     // recursively compute column-wise least restrictive
-    final FieldInfoBuilder builder = builder();
+    final Builder builder = builder();
     for (int j = 0; j < fieldCount; ++j) {
       // REVIEW jvs 22-Jan-2004:  Always use the field name from the
       // first type?
@@ -567,6 +567,7 @@ public abstract class RelDataTypeFactoryImpl implements 
RelDataTypeFactory {
     return Util.getDefaultCharset();
   }
 
+  @SuppressWarnings("deprecation")
   public FieldInfoBuilder builder() {
     return new FieldInfoBuilder(this);
   }

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/rex/RexUtil.java
----------------------------------------------------------------------
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 33644ce..03d6051 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexUtil.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexUtil.java
@@ -926,8 +926,7 @@ public class RexUtil {
       names = SqlValidatorUtil.uniquify(names, suggester,
           typeFactory.getTypeSystem().isSchemaCaseSensitive());
     }
-    final RelDataTypeFactory.FieldInfoBuilder builder =
-        typeFactory.builder();
+    final RelDataTypeFactory.Builder builder = typeFactory.builder();
     for (int i = 0; i < exprs.size(); i++) {
       String name;
       if (names == null || (name = names.get(i)) == null) {

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/schema/impl/ModifiableViewTable.java
----------------------------------------------------------------------
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 5c36959..241927b 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
@@ -113,7 +113,7 @@ public class ModifiableViewTable extends ViewTable
     final ExtensibleTable underlying = unwrap(ExtensibleTable.class);
     assert underlying != null;
 
-    final RelDataTypeFactory.FieldInfoBuilder builder = typeFactory.builder();
+    final RelDataTypeFactory.Builder builder = typeFactory.builder();
     final RelDataType rowType = getRowType(typeFactory);
     for (RelDataTypeField column : rowType.getFieldList()) {
       builder.add(column);

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/sql/SqlUnnestOperator.java
----------------------------------------------------------------------
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 7d32fe6..fb01b19 100644
--- a/core/src/main/java/org/apache/calcite/sql/SqlUnnestOperator.java
+++ b/core/src/main/java/org/apache/calcite/sql/SqlUnnestOperator.java
@@ -61,7 +61,7 @@ public class SqlUnnestOperator extends SqlFunctionalOperator {
   //~ Methods ----------------------------------------------------------------
 
   @Override public RelDataType inferReturnType(SqlOperatorBinding opBinding) {
-    final RelDataTypeFactory.FieldInfoBuilder builder =
+    final RelDataTypeFactory.Builder builder =
         opBinding.getTypeFactory().builder();
     for (Integer operand : Util.range(opBinding.getOperandCount())) {
       RelDataType type = opBinding.getOperandType(operand);

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/sql/validate/SchemaNamespace.java
----------------------------------------------------------------------
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 49e21f3..ab0c4a3 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
@@ -41,7 +41,7 @@ class SchemaNamespace extends AbstractNamespace {
   }
 
   protected RelDataType validateImpl(RelDataType targetRowType) {
-    final RelDataTypeFactory.FieldInfoBuilder builder =
+    final RelDataTypeFactory.Builder builder =
         validator.getTypeFactory().builder();
     for (SqlMoniker moniker
         : validator.catalogReader.getAllSchemaObjectNames(names)) {

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/sql/validate/TableNamespace.java
----------------------------------------------------------------------
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 77af9e8..2e3773c 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
@@ -60,7 +60,7 @@ class TableNamespace extends AbstractNamespace {
     if (extendedFields.isEmpty()) {
       return table.getRowType();
     }
-    final RelDataTypeFactory.FieldInfoBuilder builder =
+    final RelDataTypeFactory.Builder builder =
         validator.getTypeFactory().builder();
     builder.addAll(table.getRowType().getFieldList());
     builder.addAll(extendedFields);

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/sql/validate/WithItemNamespace.java
----------------------------------------------------------------------
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 8173349..33e714e 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
@@ -41,7 +41,7 @@ class WithItemNamespace extends AbstractNamespace {
     if (withItem.columnList == null) {
       return rowType;
     }
-    final RelDataTypeFactory.FieldInfoBuilder builder =
+    final RelDataTypeFactory.Builder builder =
         validator.getTypeFactory().builder();
     for (Pair<SqlNode, RelDataTypeField> pair
         : Pair.zip(withItem.columnList, rowType.getFieldList())) {

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java
----------------------------------------------------------------------
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 ba43ff2..ff0529d 100644
--- a/core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java
+++ b/core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java
@@ -302,7 +302,7 @@ public class RelFieldTrimmer implements ReflectiveVisitor {
                   && v.getType().getFieldCount() == mapping.getSourceCount()) {
                 final int old = fieldAccess.getField().getIndex();
                 final int new_ = mapping.getTarget(old);
-                final RelDataTypeFactory.FieldInfoBuilder typeBuilder =
+                final RelDataTypeFactory.Builder typeBuilder =
                     relBuilder.getTypeFactory().builder();
                 for (int target : Util.range(mapping.getTargetCount())) {
                   typeBuilder.add(

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
----------------------------------------------------------------------
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 4ba3875..d4d6fc7 100644
--- a/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
+++ b/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
@@ -4209,8 +4209,7 @@ public class SqlToRelConverter {
         if (resolve.path.steps().get(0).i < 0) {
           return Pair.of(rexBuilder.makeCorrel(rowType, correlId), null);
         } else {
-          final RelDataTypeFactory.FieldInfoBuilder builder =
-              typeFactory.builder();
+          final RelDataTypeFactory.Builder builder = typeFactory.builder();
           final ListScope ancestorScope1 = (ListScope) resolve.scope;
           final ImmutableMap.Builder<String, Integer> fields =
               ImmutableMap.builder();

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/main/java/org/apache/calcite/tools/RelBuilder.java
----------------------------------------------------------------------
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 06d8997..2e7c034 100644
--- a/core/src/main/java/org/apache/calcite/tools/RelBuilder.java
+++ b/core/src/main/java/org/apache/calcite/tools/RelBuilder.java
@@ -1371,12 +1371,12 @@ public class RelBuilder {
     }
     final ImmutableList<ImmutableList<RexLiteral>> tupleList =
         tupleList(fieldNames.length, values);
-    final RelDataTypeFactory.FieldInfoBuilder rowTypeBuilder =
-        cluster.getTypeFactory().builder();
+    final RelDataTypeFactory typeFactory = cluster.getTypeFactory();
+    final RelDataTypeFactory.Builder builder = typeFactory.builder();
     for (final Ord<String> fieldName : Ord.zip(fieldNames)) {
       final String name =
           fieldName.e != null ? fieldName.e : "expr$" + fieldName.i;
-      final RelDataType type = cluster.getTypeFactory().leastRestrictive(
+      final RelDataType type = typeFactory.leastRestrictive(
           new AbstractList<RelDataType>() {
             public RelDataType get(int index) {
               return tupleList.get(index).get(fieldName.i).getType();
@@ -1386,9 +1386,9 @@ public class RelBuilder {
               return rowCount;
             }
           });
-      rowTypeBuilder.add(name, type);
+      builder.add(name, type);
     }
-    final RelDataType rowType = rowTypeBuilder.build();
+    final RelDataType rowType = builder.build();
     return values(tupleList, rowType);
   }
 

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/test/java/org/apache/calcite/sql/parser/parserextensiontesting/SqlCreateTable.java
----------------------------------------------------------------------
diff --git 
a/core/src/test/java/org/apache/calcite/sql/parser/parserextensiontesting/SqlCreateTable.java
 
b/core/src/test/java/org/apache/calcite/sql/parser/parserextensiontesting/SqlCreateTable.java
index 3889c12..2f57a5f 100644
--- 
a/core/src/test/java/org/apache/calcite/sql/parser/parserextensiontesting/SqlCreateTable.java
+++ 
b/core/src/test/java/org/apache/calcite/sql/parser/parserextensiontesting/SqlCreateTable.java
@@ -113,7 +113,7 @@ public class SqlCreateTable extends SqlCreate
       schema = schema.getSubSchema(p, true);
     }
     final JavaTypeFactory typeFactory = new JavaTypeFactoryImpl();
-    final RelDataTypeFactory.FieldInfoBuilder builder = typeFactory.builder();
+    final RelDataTypeFactory.Builder builder = typeFactory.builder();
     for (Pair<SqlIdentifier, SqlDataTypeSpec> pair : nameTypes()) {
       builder.add(pair.left.getSimple(),
           pair.right.deriveType(typeFactory, true));

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/test/java/org/apache/calcite/test/RexProgramTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/RexProgramTest.java 
b/core/src/test/java/org/apache/calcite/test/RexProgramTest.java
index fce0294..ca9e04f 100644
--- a/core/src/test/java/org/apache/calcite/test/RexProgramTest.java
+++ b/core/src/test/java/org/apache/calcite/test/RexProgramTest.java
@@ -942,7 +942,7 @@ public class RexProgramTest {
   private void checkExponentialCnf(int n) {
     final RelDataType booleanType =
         typeFactory.createSqlType(SqlTypeName.BOOLEAN);
-    final RelDataTypeFactory.FieldInfoBuilder builder = typeFactory.builder();
+    final RelDataTypeFactory.Builder builder = typeFactory.builder();
     for (int i = 0; i < n; i++) {
       builder.add("x" + i, booleanType)
           .add("y" + i, booleanType);

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/core/src/test/java/org/apache/calcite/util/Smalls.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/util/Smalls.java 
b/core/src/test/java/org/apache/calcite/util/Smalls.java
index 42f0de5..25542f6 100644
--- a/core/src/test/java/org/apache/calcite/util/Smalls.java
+++ b/core/src/test/java/org/apache/calcite/util/Smalls.java
@@ -187,8 +187,7 @@ public class Smalls {
     final int offs = offset == null ? 0 : offset;
     return new AbstractQueryableTable(Object[].class) {
       public RelDataType getRowType(RelDataTypeFactory typeFactory) {
-        final RelDataTypeFactory.FieldInfoBuilder builder =
-            typeFactory.builder();
+        final RelDataTypeFactory.Builder builder = typeFactory.builder();
         builder.add("row_name", typeFactory.createJavaType(String.class));
         final RelDataType int_ = typeFactory.createJavaType(int.class);
         for (int i = 1; i <= ncol; i++) {

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/druid/src/main/java/org/apache/calcite/adapter/druid/DruidRules.java
----------------------------------------------------------------------
diff --git 
a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidRules.java 
b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidRules.java
index 964d022..ec50127 100644
--- a/druid/src/main/java/org/apache/calcite/adapter/druid/DruidRules.java
+++ b/druid/src/main/java/org/apache/calcite/adapter/druid/DruidRules.java
@@ -339,7 +339,7 @@ public class DruidRules {
       }
       final List<RexNode> above = pair.left;
       final List<RexNode> below = pair.right;
-      final RelDataTypeFactory.FieldInfoBuilder builder =
+      final RelDataTypeFactory.Builder builder =
           cluster.getTypeFactory().builder();
       final RelNode input = Util.last(query.rels);
       for (RexNode e : below) {
@@ -450,14 +450,15 @@ public class DruidRules {
      * @return Triple object contains inner project, outer project and required
      *         Json Post Aggregation objects to be pushed down into Druid 
Query.
      */
-    public Pair<Project, Project> splitProject(
-            final RexBuilder rexBuilder, DruidQuery query,
-            Project project, ImmutableMap<String, String> nameMap, final 
RelOptCluster cluster) {
+    public Pair<Project, Project> splitProject(final RexBuilder rexBuilder,
+        DruidQuery query, Project project, ImmutableMap<String, String> 
nameMap,
+        final RelOptCluster cluster) {
       //Visit & Build Inner Project
       final List<RexNode> innerRex = new ArrayList<>();
-      final RelDataTypeFactory.FieldInfoBuilder typeBuilder =
-              cluster.getTypeFactory().builder();
-      final RelOptUtil.InputReferencedVisitor visitor = new 
RelOptUtil.InputReferencedVisitor();
+      final RelDataTypeFactory.Builder typeBuilder =
+          cluster.getTypeFactory().builder();
+      final RelOptUtil.InputReferencedVisitor visitor =
+          new RelOptUtil.InputReferencedVisitor();
       final List<Integer> positions = new ArrayList<>();
       final List<RelDataType> innerTypes = new ArrayList<>();
       // Similar logic to splitProject in DruidProject Rule
@@ -487,50 +488,51 @@ public class DruidRules {
         innerTypes.add(node.getType());
       }
       Project innerProject = project.copy(project.getTraitSet(), 
Util.last(query.rels), innerRex,
-              typeBuilder.build());
+          typeBuilder.build());
       // When no input get visited, it means all project can be treated as 
post-aggregation.
       // Then the whole project can be get pushed in.
       if (visitor.inputPosReferenced.size() == 0) {
         return new Pair<>(innerProject, null);
       }
-      //Build outer Project when some projects are left in outer project.
+      // Build outer Project when some projects are left in outer project.
       offset = 0;
       final List<RexNode> outerRex = new ArrayList<>();
-      List<Pair<RexNode, String>> namedProjectsList = 
project.getNamedProjects();
-      for (int idx = 0; idx < namedProjectsList.size(); idx++) {
-        Pair<RexNode, String> pair = namedProjectsList.get(idx);
+      for (Pair<RexNode, String> pair : project.getNamedProjects()) {
         RexNode rex = pair.left;
         String name = pair.right;
         if (!nameMap.containsKey(name)) {
           outerRex.add(
-            rex.accept(
-              new RexShuttle() {
-                @Override public RexNode visitInputRef(RexInputRef ref) {
-                  final int index = positions.indexOf(ref.getIndex());
-                  return rexBuilder.makeInputRef(innerTypes.get(index), index);
-                }
-              }));
+              rex.accept(
+                  new RexShuttle() {
+                    @Override public RexNode visitInputRef(RexInputRef ref) {
+                      final int j = positions.indexOf(ref.getIndex());
+                      return rexBuilder.makeInputRef(innerTypes.get(j), j);
+                    }
+                  }));
         } else {
           outerRex.add(
-                  
rexBuilder.makeInputRef(project.getRowType().getFieldList().get(idx).getType(),
-                          positions.indexOf(offset++)));
+              rexBuilder.makeInputRef(rex.getType(),
+                  positions.indexOf(offset++)));
         }
       }
-      Project outerProject = project.copy(project.getTraitSet(), innerProject, 
outerRex,
-              project.getRowType());
+      Project outerProject = project.copy(project.getTraitSet(), innerProject,
+          outerRex, project.getRowType());
       return new Pair<>(innerProject, outerProject);
     }
 
     /**
-     * scan the project takes Druid Query as input to figure out which 
expression can be pushed
-     * down. Also return a map to show the correct field name in Druid Query 
for columns get pushed
-     * in.
+     * Scans the project.
+     *
+     * <p>Takes Druid Query as input to figure out which expression can be
+     * pushed down. Also returns a map to show the correct field name in Druid
+     * Query for columns get pushed in.
+     *
      * @param query matched Druid Query
      * @param project Matched project that takes in Druid Query
      * @return Pair that shows how name map with each other.
      */
     public Pair<ImmutableMap<String, String>, Boolean> scanProject(
-            DruidQuery query, Project project) {
+        DruidQuery query, Project project) {
       List<String> aggNamesWithGroup = query.getRowType().getFieldNames();
       final ImmutableMap.Builder<String, String> mapBuilder = 
ImmutableMap.builder();
       int j = 0;

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/druid/src/main/java/org/apache/calcite/adapter/druid/DruidTable.java
----------------------------------------------------------------------
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 656f20f..47dcb14 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
@@ -136,7 +136,7 @@ public class DruidTable extends AbstractTable implements 
TranslatableTable {
     }
 
     public RelDataType apply(RelDataTypeFactory typeFactory) {
-      final RelDataTypeFactory.FieldInfoBuilder builder = 
typeFactory.builder();
+      final RelDataTypeFactory.Builder builder = typeFactory.builder();
       for (Map.Entry<String, SqlTypeName> field : fields.entrySet()) {
         builder.add(field.getKey(), field.getValue()).nullable(true);
       }

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvTableScan.java
----------------------------------------------------------------------
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 5165aab..a667a44 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
@@ -67,7 +67,7 @@ public class CsvTableScan extends TableScan implements 
EnumerableRel {
 
   @Override public RelDataType deriveRowType() {
     final List<RelDataTypeField> fieldList = table.getRowType().getFieldList();
-    final RelDataTypeFactory.FieldInfoBuilder builder =
+    final RelDataTypeFactory.Builder builder =
         getCluster().getTypeFactory().builder();
     for (int field : fields) {
       builder.add(fieldList.get(field));

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/file/src/main/java/org/apache/calcite/adapter/file/FileTableScan.java
----------------------------------------------------------------------
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 bdd1d50..f100cd4 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
@@ -68,7 +68,7 @@ class FileTableScan extends TableScan implements 
EnumerableRel {
 
   @Override public RelDataType deriveRowType() {
     final List<RelDataTypeField> fieldList = table.getRowType().getFieldList();
-    final RelDataTypeFactory.FieldInfoBuilder builder =
+    final RelDataTypeFactory.Builder builder =
         getCluster().getTypeFactory().builder();
     for (int field : fields) {
       builder.add(fieldList.get(field));

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/pig/src/main/java/org/apache/calcite/adapter/pig/PigTable.java
----------------------------------------------------------------------
diff --git a/pig/src/main/java/org/apache/calcite/adapter/pig/PigTable.java 
b/pig/src/main/java/org/apache/calcite/adapter/pig/PigTable.java
index 4cfaf10..b6f68b9 100644
--- a/pig/src/main/java/org/apache/calcite/adapter/pig/PigTable.java
+++ b/pig/src/main/java/org/apache/calcite/adapter/pig/PigTable.java
@@ -50,7 +50,7 @@ public class PigTable extends AbstractTable implements 
TranslatableTable {
   }
 
   @Override public RelDataType getRowType(RelDataTypeFactory typeFactory) {
-    final RelDataTypeFactory.FieldInfoBuilder builder = typeFactory.builder();
+    final RelDataTypeFactory.Builder builder = typeFactory.builder();
     for (String fieldName : fieldNames) {
       // only supports CHARARRAY types for now
       final RelDataType relDataType = typeFactory

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/piglet/src/main/java/org/apache/calcite/piglet/Handler.java
----------------------------------------------------------------------
diff --git a/piglet/src/main/java/org/apache/calcite/piglet/Handler.java 
b/piglet/src/main/java/org/apache/calcite/piglet/Handler.java
index 2adc0ba..5b5be39 100644
--- a/piglet/src/main/java/org/apache/calcite/piglet/Handler.java
+++ b/piglet/src/main/java/org/apache/calcite/piglet/Handler.java
@@ -232,7 +232,7 @@ public class Handler {
 
 
   private RelDataType toType(Ast.Schema schema) {
-    final RelDataTypeFactory.FieldInfoBuilder typeBuilder =
+    final RelDataTypeFactory.Builder typeBuilder =
         builder.getTypeFactory().builder();
     for (Ast.FieldSchema fieldSchema : schema.fieldSchemaList) {
       typeBuilder.add(fieldSchema.id.value, toType(fieldSchema.type));
@@ -284,7 +284,7 @@ public class Handler {
 
   private RelDataType toType(Ast.TupleType type) {
     final RelDataTypeFactory typeFactory = builder.getTypeFactory();
-    final RelDataTypeFactory.FieldInfoBuilder builder = typeFactory.builder();
+    final RelDataTypeFactory.Builder builder = typeFactory.builder();
     for (Ast.FieldSchema fieldSchema : type.fieldSchemaList) {
       builder.add(fieldSchema.id.value, toType(fieldSchema.type));
     }

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/plus/src/main/java/org/apache/calcite/adapter/os/VmstatTableFunction.java
----------------------------------------------------------------------
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 5b7de14..924a868 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
@@ -21,7 +21,6 @@ import org.apache.calcite.linq4j.Enumerable;
 import org.apache.calcite.linq4j.function.Function1;
 import org.apache.calcite.rel.type.RelDataType;
 import org.apache.calcite.rel.type.RelDataTypeFactory;
-import org.apache.calcite.rel.type.RelDataTypeFactory.FieldInfoBuilder;
 import org.apache.calcite.schema.ScannableTable;
 import org.apache.calcite.schema.Schema;
 import org.apache.calcite.schema.Statistic;
@@ -96,7 +95,7 @@ public class VmstatTableFunction {
 
       public RelDataType getRowType(RelDataTypeFactory typeFactory) {
         final String osName = System.getProperty("os.name");
-        final FieldInfoBuilder builder = typeFactory.builder();
+        final RelDataTypeFactory.Builder builder = typeFactory.builder();
         switch (osName) {
         case "Mac OS X":
           return builder

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/plus/src/main/java/org/apache/calcite/adapter/tpcds/TpcdsSchema.java
----------------------------------------------------------------------
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 9a430b2..3822380 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
@@ -165,7 +165,7 @@ public class TpcdsSchema extends AbstractSchema {
     }
 
     public RelDataType getRowType(RelDataTypeFactory typeFactory) {
-      final RelDataTypeFactory.FieldInfoBuilder builder = 
typeFactory.builder();
+      final RelDataTypeFactory.Builder builder = typeFactory.builder();
       for (TpcdsColumn<E> column : tpcdsTable.getColumns()) {
         builder.add(column.getColumnName().toUpperCase(Locale.ROOT),
             typeFactory.createJavaType(realType(column)));

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/plus/src/main/java/org/apache/calcite/adapter/tpch/TpchSchema.java
----------------------------------------------------------------------
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 451c344..d0f822d 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
@@ -138,7 +138,7 @@ public class TpchSchema extends AbstractSchema {
     }
 
     public RelDataType getRowType(RelDataTypeFactory typeFactory) {
-      final RelDataTypeFactory.FieldInfoBuilder builder = 
typeFactory.builder();
+      final RelDataTypeFactory.Builder builder = typeFactory.builder();
       String prefix = "";
       if (columnPrefix) {
         final String t = tpchTable.getTableName().toUpperCase(Locale.ROOT);

http://git-wip-us.apache.org/repos/asf/calcite/blob/a98b21ea/splunk/src/main/java/org/apache/calcite/adapter/splunk/SplunkTableScan.java
----------------------------------------------------------------------
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 f8dabe6..adb2bd5 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
@@ -100,7 +100,7 @@ public class SplunkTableScan
   }
 
   @Override public RelDataType deriveRowType() {
-    final RelDataTypeFactory.FieldInfoBuilder builder =
+    final RelDataTypeFactory.Builder builder =
         getCluster().getTypeFactory().builder();
     for (String field : fieldList) {
       // REVIEW: is case-sensitive match what we want here?

Reply via email to