You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jh...@apache.org on 2015/09/03 00:16:24 UTC

[36/50] incubator-calcite git commit: [CALCITE-821] Frameworks gives NPE when FrameworkConfig has no default schema

[CALCITE-821] Frameworks gives NPE when FrameworkConfig has no default schema


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

Branch: refs/heads/branch-release
Commit: 1580bd0fec62d836c9870edc339b0ab99d909cad
Parents: 2376ae4
Author: Julian Hyde <jh...@apache.org>
Authored: Wed Jul 29 12:55:57 2015 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Wed Jul 29 12:56:47 2015 -0700

----------------------------------------------------------------------
 core/src/main/java/org/apache/calcite/tools/Frameworks.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/1580bd0f/core/src/main/java/org/apache/calcite/tools/Frameworks.java
----------------------------------------------------------------------
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 c73a1e2..f3ebe12 100644
--- a/core/src/main/java/org/apache/calcite/tools/Frameworks.java
+++ b/core/src/main/java/org/apache/calcite/tools/Frameworks.java
@@ -33,6 +33,7 @@ import org.apache.calcite.sql.fun.SqlStdOperatorTable;
 import org.apache.calcite.sql.parser.SqlParser;
 import org.apache.calcite.sql2rel.SqlRexConvertletTable;
 import org.apache.calcite.sql2rel.StandardConvertletTable;
+import org.apache.calcite.util.Util;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
@@ -107,7 +108,8 @@ public class Frameworks {
           public R apply(RelOptCluster cluster, RelOptSchema relOptSchema,
               SchemaPlus rootSchema, CalciteServerStatement statement) {
             final CalciteSchema schema =
-                CalciteSchema.from(config.getDefaultSchema());
+                CalciteSchema.from(
+                    Util.first(config.getDefaultSchema(), rootSchema));
             return action.apply(cluster, relOptSchema, schema.root().plus());
           }
         });