phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maryann...@apache.org
Subject phoenix git commit: PHOENIX-2229 Support CREATE VIEW in Phoenix-Calcite Integration
Date Wed, 20 Jul 2016 17:23:09 GMT
Repository: phoenix
Updated Branches:
  refs/heads/calcite 6a6ea2a22 -> b1cb17d9c


PHOENIX-2229 Support CREATE VIEW in Phoenix-Calcite Integration


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

Branch: refs/heads/calcite
Commit: b1cb17d9cbc35ae5f1d28eb009863ff8f9ab443a
Parents: 6a6ea2a
Author: maryannxue <maryann.xue@gmail.com>
Authored: Wed Jul 20 13:22:58 2016 -0400
Committer: maryannxue <maryann.xue@gmail.com>
Committed: Wed Jul 20 13:22:58 2016 -0400

----------------------------------------------------------------------
 .../java/org/apache/phoenix/calcite/CalciteDDLIT.java   |  6 +++---
 .../calcite/sql/SqlColumnDefInPkConstraintNode.java     |  4 ++--
 .../java/org/apache/calcite/sql/SqlColumnDefNode.java   |  4 ++--
 .../apache/phoenix/calcite/jdbc/PhoenixPrepareImpl.java | 12 ++++++------
 4 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b1cb17d9/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteDDLIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteDDLIT.java b/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteDDLIT.java
index 7f0d80e..22b7474 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteDDLIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteDDLIT.java
@@ -8,9 +8,9 @@ public class CalciteDDLIT extends BaseCalciteIT {
     private static final Properties PROPS = new Properties();
     
     @Test public void testCreateView() throws Exception {
-        start(PROPS).sql("create table t0(a varchar(20) not null primary key, b integer)").execute();
-        start(PROPS).sql("create view v1 as select * from t0").execute();
-        start(PROPS).sql("create view v2 as select * from t0 where a = 'x'").execute();
+        start(PROPS).sql("create table \"t0\"(\"a\" varchar(20) not null primary key, b integer)").execute();
+        start(PROPS).sql("create view v1 as select * from \"t0\"").execute();
+        start(PROPS).sql("create view v2 as select * from \"t0\" where \"a\" = 'x'").execute();
     }
 
     @Test public void testCreateTable() throws Exception {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b1cb17d9/phoenix-core/src/main/java/org/apache/calcite/sql/SqlColumnDefInPkConstraintNode.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/calcite/sql/SqlColumnDefInPkConstraintNode.java
b/phoenix-core/src/main/java/org/apache/calcite/sql/SqlColumnDefInPkConstraintNode.java
index b36a0f6..e17487a 100644
--- a/phoenix-core/src/main/java/org/apache/calcite/sql/SqlColumnDefInPkConstraintNode.java
+++ b/phoenix-core/src/main/java/org/apache/calcite/sql/SqlColumnDefInPkConstraintNode.java
@@ -39,9 +39,9 @@ public class SqlColumnDefInPkConstraintNode extends SqlNode{
         super(pos);
         final ColumnName name;
         if (columnName.isSimple()) {
-            name = new ColumnName(columnName.getSimple());
+            name = ColumnName.caseSensitiveColumnName(columnName.getSimple());
         } else {
-            name = new ColumnName(columnName.names.get(0), columnName.names.get(1));
+            name = ColumnName.caseSensitiveColumnName(columnName.names.get(0), columnName.names.get(1));
         }
         this.pkConstraint = new ColumnDefInPkConstraint(name, sortOrder, isRowTimestamp);
     }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b1cb17d9/phoenix-core/src/main/java/org/apache/calcite/sql/SqlColumnDefNode.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/calcite/sql/SqlColumnDefNode.java b/phoenix-core/src/main/java/org/apache/calcite/sql/SqlColumnDefNode.java
index f0c607c..88e1b3d 100644
--- a/phoenix-core/src/main/java/org/apache/calcite/sql/SqlColumnDefNode.java
+++ b/phoenix-core/src/main/java/org/apache/calcite/sql/SqlColumnDefNode.java
@@ -43,9 +43,9 @@ public class SqlColumnDefNode extends SqlNode{
         super(pos);
         final ColumnName name;
         if (columnName.isSimple()) {
-            name = new ColumnName(columnName.getSimple());
+            name = ColumnName.caseSensitiveColumnName(columnName.getSimple());
         } else {
-            name = new ColumnName(columnName.names.get(0), columnName.names.get(1));
+            name = ColumnName.caseSensitiveColumnName(columnName.names.get(0), columnName.names.get(1));
         }
         this.columnDef = new ColumnDef(name, dataType.typeName,
                 dataType.isArray, dataType.arraySize, isNullable,

http://git-wip-us.apache.org/repos/asf/phoenix/blob/b1cb17d9/phoenix-core/src/main/java/org/apache/phoenix/calcite/jdbc/PhoenixPrepareImpl.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/calcite/jdbc/PhoenixPrepareImpl.java
b/phoenix-core/src/main/java/org/apache/phoenix/calcite/jdbc/PhoenixPrepareImpl.java
index 2454ba5..f250ae6 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/calcite/jdbc/PhoenixPrepareImpl.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/calcite/jdbc/PhoenixPrepareImpl.java
@@ -182,9 +182,9 @@ public class PhoenixPrepareImpl extends CalcitePrepareImpl {
                 final PTableType tableType = table.getKind() == SqlKind.CREATE_TABLE ? PTableType.TABLE
: PTableType.VIEW;
                 final TableName name;
                 if (table.tableName.isSimple()) {
-                    name = nodeFactory.table(null, table.tableName.getSimple());
+                    name = TableName.create(null, table.tableName.getSimple());
                 } else {
-                    name = nodeFactory.table(table.tableName.names.get(0), table.tableName.names.get(1));
+                    name = TableName.create(table.tableName.names.get(0), table.tableName.names.get(1));
                 }
                 final ListMultimap<String, org.apache.hadoop.hbase.util.Pair<String,
Object>> props;
                 if (SqlNodeList.isEmptyList(table.tableOptions)) {
@@ -217,9 +217,9 @@ public class PhoenixPrepareImpl extends CalcitePrepareImpl {
                     where = null;
                 } else {
                     if (table.baseTableName.isSimple()) {
-                        baseTableName = nodeFactory.table(null, table.baseTableName.getSimple());
+                        baseTableName = TableName.create(null, table.baseTableName.getSimple());
                     } else {
-                        baseTableName = nodeFactory.table(table.baseTableName.names.get(0),
table.baseTableName.names.get(1));
+                        baseTableName = TableName.create(table.baseTableName.names.get(0),
table.baseTableName.names.get(1));
                     }
                     if (table.whereNode == null) {
                         where = null;
@@ -259,9 +259,9 @@ public class PhoenixPrepareImpl extends CalcitePrepareImpl {
                 final PTableType tableType = table.getKind() == SqlKind.DROP_TABLE ? PTableType.TABLE
: PTableType.VIEW;
                 final TableName name;
                 if (table.tableName.isSimple()) {
-                    name = nodeFactory.table(null, table.tableName.getSimple());
+                    name = TableName.create(null, table.tableName.getSimple());
                 } else {
-                    name = nodeFactory.table(table.tableName.names.get(0), table.tableName.names.get(1));
+                    name = TableName.create(table.tableName.names.get(0), table.tableName.names.get(1));
                 }
                 final DropTableStatement drop = nodeFactory.dropTable(
                         name, tableType, table.ifExists.booleanValue(), table.cascade.booleanValue());


Mime
View raw message