Repository: phoenix
Updated Branches:
  refs/heads/calcite 0e74787b0 -> 73f2eb1d9


PHOENIX-3809 CURRENT_DATE() (with parentheses) is illegal in Calcite


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

Branch: refs/heads/calcite
Commit: 73f2eb1d9dea9458ef5f85a0311710c79e76f1a8
Parents: 0e74787
Author: Ankit Singhal <[email protected]>
Authored: Tue May 2 12:41:30 2017 +0530
Committer: Ankit Singhal <[email protected]>
Committed: Tue May 2 12:41:30 2017 +0530

----------------------------------------------------------------------
 .../org/apache/phoenix/calcite/PhoenixSqlConformance.java     | 5 +++++
 .../main/java/org/apache/phoenix/calcite/PhoenixTable.java    | 7 +++++++
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/73f2eb1d/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixSqlConformance.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixSqlConformance.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixSqlConformance.java
index 0f228cd..0a5c978 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixSqlConformance.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixSqlConformance.java
@@ -65,4 +65,9 @@ public class PhoenixSqlConformance implements SqlConformance {
     public boolean isInsertSubsetColumnsAllowed() {
         return true;
     }
+
+    @Override
+    public boolean allowNiladicParentheses() {
+        return true;
+    }
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/73f2eb1d/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixTable.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixTable.java 
b/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixTable.java
index 74d1b25..ad96a54 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixTable.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/calcite/PhoenixTable.java
@@ -13,6 +13,7 @@ import org.apache.calcite.rel.RelDistributions;
 import org.apache.calcite.rel.RelFieldCollation;
 import org.apache.calcite.rel.RelFieldCollation.Direction;
 import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.RelReferentialConstraint;
 import org.apache.calcite.rel.type.RelDataType;
 import org.apache.calcite.rel.type.RelDataTypeFactory;
 import org.apache.calcite.rel.type.RelDataTypeField;
@@ -189,6 +190,12 @@ public class PhoenixTable extends AbstractTable
             public RelDistribution getDistribution() {
                 return RelDistributions.RANDOM_DISTRIBUTED;
             }
+
+            @Override
+            public List<RelReferentialConstraint> getReferentialConstraints() {
+                // TODO: As we don't support any referential constraints in 
Phoenix
+                return ImmutableList.<RelReferentialConstraint> of();
+            }
         };
     }
 

Reply via email to