calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject [36/50] incubator-calcite git commit: [CALCITE-821] Frameworks gives NPE when FrameworkConfig has no default schema
Date Wed, 02 Sep 2015 22:16:24 GMT
[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 <jhyde@apache.org>
Authored: Wed Jul 29 12:55:57 2015 -0700
Committer: Julian Hyde <jhyde@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());
           }
         });


Mime
View raw message