calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject [03/13] calcite git commit: Remove all calls to deprecated methods
Date Fri, 22 Apr 2016 08:07:32 GMT
Remove all calls to deprecated methods

(Other than calls to deprecated methods to implement methods that we have
deprecated but have not removed yet.)
Includes calls to Guava, Mongo, Janino and Calcite.

Add "cons" method.


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

Branch: refs/heads/master
Commit: e91c8dcf25e31fccd9299db8123d642ca1e63f0a
Parents: 80f8922
Author: Julian Hyde <jhyde@apache.org>
Authored: Tue Mar 22 13:01:25 2016 -0700
Committer: Julian Hyde <jhyde@apache.org>
Committed: Tue Apr 19 11:11:36 2016 -0700

----------------------------------------------------------------------
 .../apache/calcite/adapter/jdbc/JdbcUtils.java  | 18 ++++++------
 .../calcite/rel/metadata/RelMdPredicates.java   |  4 +--
 .../calcite/rel/rules/FilterCorrelateRule.java  | 11 ++++----
 .../apache/calcite/rel/rules/LoptMultiJoin.java |  3 +-
 .../calcite/rel/rules/LoptOptimizeJoinRule.java |  4 ++-
 .../rel/rules/MultiJoinOptimizeBushyRule.java   | 12 ++++----
 .../org/apache/calcite/rex/RexExecutable.java   | 29 ++++++++++++--------
 .../sql/fun/SqlAbstractTimeFunction.java        |  2 +-
 .../apache/calcite/sql2rel/RelFieldTrimmer.java |  5 ++--
 .../calcite/sql2rel/SqlToRelConverter.java      |  3 +-
 .../main/java/org/apache/calcite/util/Pair.java |  7 ++---
 .../apache/calcite/test/InterpreterTest.java    | 16 +++++------
 .../org/apache/calcite/tools/PlannerTest.java   |  2 +-
 .../calcite/util/ImmutableBitSetTest.java       |  3 +-
 .../calcite/adapter/mongodb/MongoTable.java     |  8 +++---
 15 files changed, 67 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcUtils.java
----------------------------------------------------------------------
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 0bbd023..a23ff78 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
@@ -45,6 +45,7 @@ import java.util.IdentityHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.TimeZone;
+import javax.annotation.Nonnull;
 import javax.sql.DataSource;
 
 /**
@@ -56,10 +57,9 @@ final class JdbcUtils {
   }
 
   /** Pool of dialects. */
-  public static class DialectPool {
-    final Map<DataSource, SqlDialect> map0 =
-        new IdentityHashMap<DataSource, SqlDialect>();
-    final Map<List, SqlDialect> map = new HashMap<List, SqlDialect>();
+  static class DialectPool {
+    final Map<DataSource, SqlDialect> map0 = new IdentityHashMap<>();
+    final Map<List, SqlDialect> map = new HashMap<>();
 
     public static final DialectPool INSTANCE = new DialectPool();
 
@@ -101,13 +101,13 @@ final class JdbcUtils {
   /** Builder that calls {@link ResultSet#getObject(int)} for every column,
    * or {@code getXxx} if the result type is a primitive {@code xxx},
    * and returns an array of objects for each row. */
-  public static class ObjectArrayRowBuilder implements Function0<Object[]> {
+  static class ObjectArrayRowBuilder implements Function0<Object[]> {
     private final ResultSet resultSet;
     private final int columnCount;
     private final ColumnMetaData.Rep[] reps;
     private final int[] types;
 
-    public ObjectArrayRowBuilder(ResultSet resultSet, ColumnMetaData.Rep[] reps,
+    ObjectArrayRowBuilder(ResultSet resultSet, ColumnMetaData.Rep[] reps,
         int[] types)
         throws SQLException {
       this.resultSet = resultSet;
@@ -199,13 +199,13 @@ final class JdbcUtils {
    * {@link org.apache.calcite.sql.SqlDialect} objects. Otherwise, each time we
    * see a new data source, we have to open a connection to find out what
    * database product and version it is. */
-  public static class DataSourcePool {
+  static class DataSourcePool {
     public static final DataSourcePool INSTANCE = new DataSourcePool();
 
     private final LoadingCache<List<String>, BasicDataSource> cache =
         CacheBuilder.newBuilder().softValues().build(
             new CacheLoader<List<String>, BasicDataSource>() {
-              @Override public BasicDataSource load(List<String> key) {
+              @Override public BasicDataSource load(@Nonnull List<String> key) {
                 BasicDataSource dataSource = new BasicDataSource();
                 dataSource.setUrl(key.get(0));
                 dataSource.setUsername(key.get(1));
@@ -221,7 +221,7 @@ final class JdbcUtils {
       // out what kind of database they are quite as often.
       final List<String> key =
           ImmutableNullableList.of(url, username, password, driverClassName);
-      return cache.apply(key);
+      return cache.getUnchecked(key);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/core/src/main/java/org/apache/calcite/rel/metadata/RelMdPredicates.java
----------------------------------------------------------------------
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 7300624..0e7183a 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
@@ -57,12 +57,12 @@ import org.apache.calcite.util.mapping.Mappings;
 import com.google.common.base.Function;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
-import com.google.common.collect.Iterators;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 
 import java.util.ArrayList;
 import java.util.BitSet;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -600,7 +600,7 @@ public class RelMdPredicates
         public Iterator<Mapping> iterator() {
           ImmutableBitSet fields = exprFields.get(predicate.toString());
           if (fields.cardinality() == 0) {
-            return Iterators.emptyIterator();
+            return Collections.emptyIterator();
           }
           return new ExprsItr(fields);
         }

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/core/src/main/java/org/apache/calcite/rel/rules/FilterCorrelateRule.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/FilterCorrelateRule.java b/core/src/main/java/org/apache/calcite/rel/rules/FilterCorrelateRule.java
index 982f6d8..7bd9c5f 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/FilterCorrelateRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/FilterCorrelateRule.java
@@ -121,13 +121,12 @@ public class FilterCorrelateRule extends RelOptRule {
     }
 
     // Create a Filter on top of the join if needed
-    RelNode newRel =
-        relBuilder.push(newCorrRel)
-        .filter(
-            RexUtil.fixUp(rexBuilder, aboveFilters, newCorrRel.getRowType()))
-        .build();
+    relBuilder.push(newCorrRel);
+    relBuilder.filter(
+        RexUtil.fixUp(rexBuilder, aboveFilters,
+            RelOptUtil.getFieldTypeList(relBuilder.peek().getRowType())));
 
-    call.transformTo(newRel);
+    call.transformTo(relBuilder.build());
   }
 }
 

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/core/src/main/java/org/apache/calcite/rel/rules/LoptMultiJoin.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/LoptMultiJoin.java b/core/src/main/java/org/apache/calcite/rel/rules/LoptMultiJoin.java
index ee4eeaa..c128a2e 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/LoptMultiJoin.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/LoptMultiJoin.java
@@ -542,7 +542,8 @@ public class LoptMultiJoin {
       // exclude the bit corresponding to the factor itself
       for (int factor : factorRefs) {
         factorsRefByFactor[factor] =
-            ImmutableBitSet.builder(factorsRefByFactor[factor])
+            factorsRefByFactor[factor]
+                .rebuild()
                 .addAll(factorRefs)
                 .clear(factor)
                 .build();

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/core/src/main/java/org/apache/calcite/rel/rules/LoptOptimizeJoinRule.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/LoptOptimizeJoinRule.java b/core/src/main/java/org/apache/calcite/rel/rules/LoptOptimizeJoinRule.java
index e522ade..baa4139 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/LoptOptimizeJoinRule.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/LoptOptimizeJoinRule.java
@@ -1263,7 +1263,9 @@ public class LoptOptimizeJoinRule extends RelOptRule {
     } else {
       childFactorBuilder.addAll(leftTree.getTreeOrder());
     }
-    multiJoin.getChildFactors(rightTree, childFactorBuilder);
+    for (int child : rightTree.getTreeOrder()) {
+      childFactorBuilder.set(child);
+    }
 
     final ImmutableBitSet childFactor = childFactorBuilder.build();
     RexNode condition = null;

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/core/src/main/java/org/apache/calcite/rel/rules/MultiJoinOptimizeBushyRule.java
----------------------------------------------------------------------
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 b0b372d..b63e3a4 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
@@ -167,7 +167,8 @@ public class MultiJoinOptimizeBushyRule extends RelOptRule {
       // the join can now be used.
       final int v = vertexes.size();
       final ImmutableBitSet newFactors =
-          ImmutableBitSet.builder(majorVertex.factors)
+          majorVertex.factors
+              .rebuild()
               .addAll(minorVertex.factors)
               .set(v)
               .build();
@@ -206,10 +207,11 @@ public class MultiJoinOptimizeBushyRule extends RelOptRule {
         final LoptMultiJoin.Edge edge = unusedEdges.get(i);
         if (edge.factors.intersects(merged)) {
           ImmutableBitSet newEdgeFactors =
-              ImmutableBitSet.builder(edge.factors)
-              .removeAll(newFactors)
-              .set(v)
-              .build();
+              edge.factors
+                  .rebuild()
+                  .removeAll(newFactors)
+                  .set(v)
+                  .build();
           assert newEdgeFactors.cardinality() == 2;
           final LoptMultiJoin.Edge newEdge =
               new LoptMultiJoin.Edge(edge.condition, newEdgeFactors,

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/core/src/main/java/org/apache/calcite/rex/RexExecutable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rex/RexExecutable.java b/core/src/main/java/org/apache/calcite/rex/RexExecutable.java
index 64c7c99..365dd1d 100644
--- a/core/src/main/java/org/apache/calcite/rex/RexExecutable.java
+++ b/core/src/main/java/org/apache/calcite/rex/RexExecutable.java
@@ -36,28 +36,33 @@ import java.util.List;
  * Result of compiling code generated from a {@link RexNode} expression.
  */
 public class RexExecutable {
-  public static final String GENERATED_CLASS_NAME = "Reducer";
+  private static final String GENERATED_CLASS_NAME = "Reducer";
 
   private final Function1<DataContext, Object[]> compiledFunction;
   private final String code;
   private DataContext dataContext;
 
   public RexExecutable(String code, Object reason) {
+    this.code = code;
+    this.compiledFunction = compile(code, reason);
+  }
+
+  private static Function1<DataContext, Object[]> compile(String code,
+      Object reason) {
     try {
+      final ClassBodyEvaluator cbe = new ClassBodyEvaluator();
+      cbe.setClassName(GENERATED_CLASS_NAME);
+      cbe.setExtendedClass(Utilities.class);
+      cbe.setImplementedInterfaces(new Class[] {Function1.class, Serializable.class});
+      cbe.setParentClassLoader(RexExecutable.class.getClassLoader());
+      cbe.cook(new Scanner(null, new StringReader(code)));
+      Class c = cbe.getClazz();
       //noinspection unchecked
-      compiledFunction =
-          (Function1) ClassBodyEvaluator.createFastClassBodyEvaluator(
-              new Scanner(null, new StringReader(code)),
-              GENERATED_CLASS_NAME,
-              Utilities.class,
-              new Class[] {Function1.class, Serializable.class},
-              getClass().getClassLoader());
-    } catch (CompileException e) {
-      throw new RuntimeException("While compiling " + reason, e);
-    } catch (IOException e) {
+      return (Function1<DataContext, Object[]>) c.newInstance();
+    } catch (CompileException | IOException | InstantiationException
+        | IllegalAccessException e) {
       throw new RuntimeException("While compiling " + reason, e);
     }
-    this.code = code;
   }
 
   public void setDataContext(DataContext dataContext) {

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/core/src/main/java/org/apache/calcite/sql/fun/SqlAbstractTimeFunction.java
----------------------------------------------------------------------
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 82c660e..3543714 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
@@ -65,7 +65,7 @@ public class SqlAbstractTimeFunction extends SqlFunction {
     if (opBinding.getOperandCount() == 1) {
       RelDataType type = opBinding.getOperandType(0);
       if (SqlTypeUtil.isNumeric(type)) {
-        precision = opBinding.getIntLiteralOperand(0);
+        precision = ((Number) opBinding.getOperandLiteralValue(0)).intValue();
       }
     }
     assert precision >= 0;

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/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 5246fa9..e01d88d 100644
--- a/core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java
+++ b/core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java
@@ -505,8 +505,7 @@ public class RelFieldTrimmer implements ReflectiveVisitor {
 
     // We use the fields used by the consumer, plus any fields used as sort
     // keys.
-    final ImmutableBitSet.Builder inputFieldsUsed =
-        ImmutableBitSet.builder(fieldsUsed);
+    final ImmutableBitSet.Builder inputFieldsUsed = fieldsUsed.rebuild();
     for (RelFieldCollation field : collation.getFieldCollations()) {
       inputFieldsUsed.set(field.getFieldIndex());
     }
@@ -784,7 +783,7 @@ public class RelFieldTrimmer implements ReflectiveVisitor {
     // Compute which input fields are used.
     // 1. group fields are always used
     final ImmutableBitSet.Builder inputFieldsUsed =
-        ImmutableBitSet.builder(aggregate.getGroupSet());
+        aggregate.getGroupSet().rebuild();
     // 2. agg functions
     for (AggregateCall aggCall : aggregate.getAggCallList()) {
       for (int i : aggCall.getArgList()) {

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/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 b271945..2dc2410 100644
--- a/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
+++ b/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
@@ -2087,8 +2087,7 @@ public class SqlToRelConverter {
       SqlCall call) {
     final SqlOperator operator = call.getOperator();
     if (operator == SqlStdOperatorTable.TABLESAMPLE) {
-      final String sampleName =
-          SqlLiteral.stringValue(call.operand(0));
+      final String sampleName = (String) SqlLiteral.value(call.operand(0));
       datasetStack.push(sampleName);
       SqlCall cursorCall = call.operand(1);
       SqlNode query = cursorCall.operand(0);

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/core/src/main/java/org/apache/calcite/util/Pair.java
----------------------------------------------------------------------
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 c2dc1fd..3705391 100644
--- a/core/src/main/java/org/apache/calcite/util/Pair.java
+++ b/core/src/main/java/org/apache/calcite/util/Pair.java
@@ -16,10 +16,9 @@
  */
 package org.apache.calcite.util;
 
-import com.google.common.collect.Iterators;
-
 import java.io.Serializable;
 import java.util.AbstractList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -375,7 +374,7 @@ public class Pair<T1, T2>
       public Iterator<Pair<T, T>> iterator() {
         final Iterator<T> iterator = iterable.iterator();
         if (!iterator.hasNext()) {
-          return Iterators.emptyIterator();
+          return Collections.emptyIterator();
         }
         final T first = iterator.next();
         return new Iterator<Pair<T, T>>() {
@@ -415,7 +414,7 @@ public class Pair<T1, T2>
       public Iterator<Pair<T, T>> iterator() {
         final Iterator<T> iterator = iterable.iterator();
         if (!iterator.hasNext()) {
-          return Iterators.emptyIterator();
+          return Collections.emptyIterator();
         }
         final T first = iterator.next();
         return new Iterator<Pair<T, T>>() {

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/core/src/test/java/org/apache/calcite/test/InterpreterTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/InterpreterTest.java b/core/src/test/java/org/apache/calcite/test/InterpreterTest.java
index eea164b..fc360e1 100644
--- a/core/src/test/java/org/apache/calcite/test/InterpreterTest.java
+++ b/core/src/test/java/org/apache/calcite/test/InterpreterTest.java
@@ -100,7 +100,7 @@ public class InterpreterTest {
             + "where x > 1");
 
     SqlNode validate = planner.validate(parse);
-    RelNode convert = planner.convert(validate);
+    RelNode convert = planner.rel(validate).rel;
 
     final Interpreter interpreter = new Interpreter(dataContext, convert);
     assertRows(interpreter, "[b, 2]", "[c, 3]");
@@ -148,7 +148,7 @@ public class InterpreterTest {
         planner.parse("select * from \"hr\".\"emps\" order by \"empid\"");
 
     SqlNode validate = planner.validate(parse);
-    RelNode convert = planner.convert(validate);
+    RelNode convert = planner.rel(validate).rel;
 
     final Interpreter interpreter = new Interpreter(dataContext, convert);
     assertRows(interpreter,
@@ -166,7 +166,7 @@ public class InterpreterTest {
         planner.parse("select * from \"beatles\" order by \"i\"");
 
     SqlNode validate = planner.validate(parse);
-    RelNode convert = planner.convert(validate);
+    RelNode convert = planner.rel(validate).rel;
 
     final Interpreter interpreter = new Interpreter(dataContext, convert);
     assertRows(interpreter,
@@ -182,7 +182,7 @@ public class InterpreterTest {
         planner.parse("select  count(*) from \"beatles\"");
 
     SqlNode validate = planner.validate(parse);
-    RelNode convert = planner.convert(validate);
+    RelNode convert = planner.rel(validate).rel;
 
     final Interpreter interpreter = new Interpreter(dataContext, convert);
     assertRows(interpreter,
@@ -195,7 +195,7 @@ public class InterpreterTest {
         planner.parse("select \"j\", count(*) from \"beatles\" group by \"j\"");
 
     SqlNode validate = planner.validate(parse);
-    RelNode convert = planner.convert(validate);
+    RelNode convert = planner.rel(validate).rel;
 
     final Interpreter interpreter = new Interpreter(dataContext, convert);
     assertRowsUnordered(interpreter,
@@ -213,7 +213,7 @@ public class InterpreterTest {
         planner.parse("select * from \"simple\" limit 2");
 
     SqlNode validate = planner.validate(parse);
-    RelNode convert = planner.convert(validate);
+    RelNode convert = planner.rel(validate).rel;
 
     final Interpreter interpreter = new Interpreter(dataContext, convert);
     assertRows(interpreter, "[0]", "[10]");
@@ -228,7 +228,7 @@ public class InterpreterTest {
             + "select * from \"simple\"\n");
 
     SqlNode validate = planner.validate(parse);
-    RelNode convert = planner.convert(validate);
+    RelNode convert = planner.rel(validate).rel;
 
     final Interpreter interpreter = new Interpreter(dataContext, convert);
     assertRows(interpreter,
@@ -244,7 +244,7 @@ public class InterpreterTest {
             + "select * from \"simple\"\n");
 
     SqlNode validate = planner.validate(parse);
-    RelNode convert = planner.convert(validate);
+    RelNode convert = planner.rel(validate).rel;
 
     final Interpreter interpreter = new Interpreter(dataContext, convert);
     assertRows(interpreter, "[0]", "[10]", "[20]", "[30]");

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/core/src/test/java/org/apache/calcite/tools/PlannerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/tools/PlannerTest.java b/core/src/test/java/org/apache/calcite/tools/PlannerTest.java
index d604938..265a504 100644
--- a/core/src/test/java/org/apache/calcite/tools/PlannerTest.java
+++ b/core/src/test/java/org/apache/calcite/tools/PlannerTest.java
@@ -251,7 +251,7 @@ public class PlannerTest {
   }
 
   /** Tests that planner throws an error if you pass to
-   * {@link Planner#convert(org.apache.calcite.sql.SqlNode)}
+   * {@link Planner#rel(org.apache.calcite.sql.SqlNode)}
    * a {@link org.apache.calcite.sql.SqlNode} that has been parsed but not
    * validated. */
   @Test public void testConvertWithoutValidateFails() throws Exception {

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/core/src/test/java/org/apache/calcite/util/ImmutableBitSetTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/util/ImmutableBitSetTest.java b/core/src/test/java/org/apache/calcite/util/ImmutableBitSetTest.java
index bd25a32..5bb1d94 100644
--- a/core/src/test/java/org/apache/calcite/util/ImmutableBitSetTest.java
+++ b/core/src/test/java/org/apache/calcite/util/ImmutableBitSetTest.java
@@ -205,7 +205,8 @@ public class ImmutableBitSetTest {
             .toString(),
         equalTo("{1, 3, 100}"));
     ImmutableBitSet x =
-        ImmutableBitSet.builder(ImmutableBitSet.of(1))
+        ImmutableBitSet.of(1)
+            .rebuild()
             .addAll(ImmutableBitSet.of(2))
             .addAll(ImmutableBitSet.of())
             .addAll(ImmutableBitSet.of(3))

http://git-wip-us.apache.org/repos/asf/calcite/blob/e91c8dcf/mongodb/src/main/java/org/apache/calcite/adapter/mongodb/MongoTable.java
----------------------------------------------------------------------
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 96ca921..a2b9d58 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
@@ -56,7 +56,7 @@ import java.util.Map;
  */
 public class MongoTable extends AbstractQueryableTable
     implements TranslatableTable {
-  protected final String collectionName;
+  private final String collectionName;
 
   /** Creates a MongoTable. */
   MongoTable(String collectionName) {
@@ -101,7 +101,7 @@ public class MongoTable extends AbstractQueryableTable
    * @param fields List of fields to project; or null to return map
    * @return Enumerator of results
    */
-  public Enumerable<Object> find(DB mongoDb, String filterJson,
+  private Enumerable<Object> find(DB mongoDb, String filterJson,
       String projectJson, List<Map.Entry<String, Class>> fields) {
     final DBCollection collection =
         mongoDb.getCollection(collectionName);
@@ -131,7 +131,7 @@ public class MongoTable extends AbstractQueryableTable
    * @param operations One or more JSON strings
    * @return Enumerator of results
    */
-  public Enumerable<Object> aggregate(final DB mongoDb,
+  private Enumerable<Object> aggregate(final DB mongoDb,
       final List<Map.Entry<String, Class>> fields,
       final List<String> operations) {
     final List<DBObject> list = new ArrayList<>();
@@ -220,7 +220,7 @@ public class MongoTable extends AbstractQueryableTable
   /** Implementation of {@link org.apache.calcite.linq4j.Queryable} based on
    * a {@link org.apache.calcite.adapter.mongodb.MongoTable}. */
   public static class MongoQueryable<T> extends AbstractTableQueryable<T> {
-    public MongoQueryable(QueryProvider queryProvider, SchemaPlus schema,
+    MongoQueryable(QueryProvider queryProvider, SchemaPlus schema,
         MongoTable table, String tableName) {
       super(queryProvider, schema, table, tableName);
     }


Mime
View raw message