Compatibility with latest Calcite 0.11.0-SNAPSHOT Fix compilation errors building with latest Calcite 0.11.0 snapshot, including: * addition of source expression list to TableModify * addition of create and drop statements to parser config
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/6f39c105 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/6f39c105 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/6f39c105 Branch: refs/heads/calcite Commit: 6f39c105587c67072b7784ddbc47e2cad23f7c8c Parents: 22b22c8 Author: Gabriel Reid <[email protected]> Authored: Fri Dec 9 09:08:55 2016 +0100 Committer: Gabriel Reid <[email protected]> Committed: Fri Dec 9 09:08:55 2016 +0100 ---------------------------------------------------------------------- phoenix-core/src/main/codegen/data/Parser.tdd | 11 ++++++++++- .../org/apache/calcite/jdbc/PhoenixCalciteFactory.java | 5 +++++ .../apache/phoenix/calcite/rel/PhoenixTableModify.java | 8 ++++++-- .../phoenix/calcite/rules/PhoenixConverterRules.java | 1 + 4 files changed, 22 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f39c105/phoenix-core/src/main/codegen/data/Parser.tdd ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/codegen/data/Parser.tdd b/phoenix-core/src/main/codegen/data/Parser.tdd index 0df9d8c..89f8bfc 100644 --- a/phoenix-core/src/main/codegen/data/Parser.tdd +++ b/phoenix-core/src/main/codegen/data/Parser.tdd @@ -47,7 +47,6 @@ "ROW_TIMESTAMP" "SPLIT" "STATISTICS" - "REPLACE" "JAR" "CONSTANT" "DEFAULTVALUE" @@ -97,6 +96,16 @@ alterStatementParserMethods: [ ] + # List of methods for parsing extensions to "CREATE [OR REPLACE]" calls. + # Each must accept arguments "(SqlParserPos pos, boolean replace)". + createStatementParserMethods: [ + ] + + # List of methods for parsing extensions to "DROP" calls. + # Each must accept arguments "(SqlParserPos pos)". + dropStatementParserMethods: [ + ] + # List of files in @includes directory that have parser method # implementations for custom SQL statements, literals or types # given as part of "statementParserMethods", "literalParserMethods" or http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f39c105/phoenix-core/src/main/java/org/apache/calcite/jdbc/PhoenixCalciteFactory.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/calcite/jdbc/PhoenixCalciteFactory.java b/phoenix-core/src/main/java/org/apache/calcite/jdbc/PhoenixCalciteFactory.java index ef42737..d094ccd 100644 --- a/phoenix-core/src/main/java/org/apache/calcite/jdbc/PhoenixCalciteFactory.java +++ b/phoenix-core/src/main/java/org/apache/calcite/jdbc/PhoenixCalciteFactory.java @@ -630,6 +630,11 @@ public class PhoenixCalciteFactory extends CalciteFactory { } @Override + public <T> T parserFactory(Class<T> parserFactoryClass, T defaultParserFactory) { + return delegate.parserFactory(parserFactoryClass, defaultParserFactory); + } + + @Override public <T> T schemaFactory(Class<T> schemaFactoryClass, T defaultSchemaFactory) { return delegate.schemaFactory(schemaFactoryClass, defaultSchemaFactory); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f39c105/phoenix-core/src/main/java/org/apache/phoenix/calcite/rel/PhoenixTableModify.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/calcite/rel/PhoenixTableModify.java b/phoenix-core/src/main/java/org/apache/phoenix/calcite/rel/PhoenixTableModify.java index 579914a..f13223f 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/calcite/rel/PhoenixTableModify.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/calcite/rel/PhoenixTableModify.java @@ -16,6 +16,7 @@ import org.apache.calcite.plan.RelTraitSet; import org.apache.calcite.prepare.Prepare.CatalogReader; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.TableModify; +import org.apache.calcite.rex.RexNode; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.phoenix.calcite.PhoenixTable; @@ -61,8 +62,10 @@ public class PhoenixTableModify extends TableModify implements PhoenixRel { public PhoenixTableModify(RelOptCluster cluster, RelTraitSet traits, RelOptTable table, CatalogReader catalogReader, RelNode child, - Operation operation, List<String> updateColumnList, boolean flattened) { - super(cluster, traits, table, catalogReader, child, operation, updateColumnList, flattened); + Operation operation, List<String> updateColumnList, List<RexNode> sourceExpressionList, + boolean flattened) { + super(cluster, traits, table, catalogReader, child, operation, + updateColumnList, sourceExpressionList, flattened); assert operation == Operation.INSERT || operation == Operation.DELETE; } @@ -75,6 +78,7 @@ public class PhoenixTableModify extends TableModify implements PhoenixRel { sole(inputs), getOperation(), getUpdateColumnList(), + getSourceExpressionList(), isFlattened()); } http://git-wip-us.apache.org/repos/asf/phoenix/blob/6f39c105/phoenix-core/src/main/java/org/apache/phoenix/calcite/rules/PhoenixConverterRules.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/calcite/rules/PhoenixConverterRules.java b/phoenix-core/src/main/java/org/apache/phoenix/calcite/rules/PhoenixConverterRules.java index 68db713..ca3e60e 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/calcite/rules/PhoenixConverterRules.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/calcite/rules/PhoenixConverterRules.java @@ -854,6 +854,7 @@ public class PhoenixConverterRules { modify.getTraitSet().replace(PhoenixConvention.GENERIC)), modify.getOperation(), modify.getUpdateColumnList(), + modify.getSourceExpressionList(), modify.isFlattened()); } }
