Apache-Phoenix | master | HBase 2.3 | Build #315 FAILURE
master branch HBase 2.3 build #315 status FAILURE Build #315 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/315/
[phoenix] branch master updated (9b76bd5 -> d04b3d8)
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/phoenix.git. from 9b76bd5 PHOENIX-6498 Fix incorrect Correlated Exists Subquery rewrite when Subquery is aggregate add d04b3d8 PHOENIX-6518 Implement SHOW CREATE TABLE SQL command No new revisions were added by this update. Summary of changes: .../apache/phoenix/end2end/ShowCreateTableIT.java | 113 + phoenix-core/src/main/antlr3/PhoenixSQL.g | 6 ++ .../org/apache/phoenix/jdbc/PhoenixStatement.java | 23 + .../org/apache/phoenix/parse/ParseNodeFactory.java | 4 + .../{ShowStatement.java => ShowCreateTable.java} | 6 +- ...tatement.java => ShowCreateTableStatement.java} | 40 .../schematool}/SchemaExtractionProcessor.java | 6 +- .../phoenix/schematool}/SchemaProcessor.java | 2 +- .../apache/phoenix/schematool}/SchemaSQLUtil.java | 4 +- .../schematool}/SchemaSynthesisProcessor.java | 9 +- .../java/org/apache/phoenix/util/QueryUtil.java| 29 ++ .../org/apache/phoenix/parse/QueryParserTest.java | 16 +++ phoenix-tools/pom.xml | 10 -- .../phoenix/schema/SchemaToolSynthesisIT.java | 4 +- .../java/org/apache/phoenix/schema/SchemaTool.java | 3 + 15 files changed, 231 insertions(+), 44 deletions(-) create mode 100644 phoenix-core/src/it/java/org/apache/phoenix/end2end/ShowCreateTableIT.java copy phoenix-core/src/main/java/org/apache/phoenix/parse/{ShowStatement.java => ShowCreateTable.java} (87%) copy phoenix-core/src/main/java/org/apache/phoenix/parse/{ShowSchemasStatement.java => ShowCreateTableStatement.java} (63%) rename {phoenix-tools/src/main/java/org/apache/phoenix/schema => phoenix-core/src/main/java/org/apache/phoenix/schematool}/SchemaExtractionProcessor.java (99%) rename {phoenix-tools/src/main/java/org/apache/phoenix/schema => phoenix-core/src/main/java/org/apache/phoenix/schematool}/SchemaProcessor.java (95%) rename {phoenix-tools/src/main/java/org/apache/phoenix/schema => phoenix-core/src/main/java/org/apache/phoenix/schematool}/SchemaSQLUtil.java (98%) rename {phoenix-tools/src/main/java/org/apache/phoenix/schema => phoenix-core/src/main/java/org/apache/phoenix/schematool}/SchemaSynthesisProcessor.java (97%)
Apache-Phoenix | master | HBase 2.4 | Build #315 FAILURE
master branch HBase 2.4 build #315 status FAILURE Build #315 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/315/
Apache-Phoenix | master | HBase 2.1 | Build #315 FAILURE
master branch HBase 2.1 build #315 status FAILURE Build #315 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/315/
Apache-Phoenix | master | HBase 2.2 | Build #315 FAILURE
master branch HBase 2.2 build #315 status FAILURE Build #315 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/315/
Apache-Phoenix | master | HBase 2.1 | Build #316 FAILURE
master branch HBase 2.1 build #316 status FAILURE Build #316 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/316/
Apache-Phoenix | master | HBase 2.4 | Build #316 FAILURE
master branch HBase 2.4 build #316 status FAILURE Build #316 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/316/
Apache-Phoenix | master | HBase 2.2 | Build #316 FAILURE
master branch HBase 2.2 build #316 status FAILURE Build #316 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/316/
Apache-Phoenix | master | HBase 2.3 | Build #316 FAILURE
master branch HBase 2.3 build #316 status FAILURE Build #316 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/316/
[phoenix] branch master updated (d04b3d8 -> 693cc1c)
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/phoenix.git. from d04b3d8 PHOENIX-6518 Implement SHOW CREATE TABLE SQL command add 693cc1c PHOENIX-6450 Checkstyle creating warnings for line length > 80 but < 100 No new revisions were added by this update. Summary of changes: phoenix-assembly/pom.xml | 1 - phoenix-client-parent/pom.xml | 1 - phoenix-core/pom.xml | 4 phoenix-pherf/pom.xml | 1 - phoenix-server/pom.xml | 1 - phoenix-tracing-webapp/pom.xml | 2 -- pom.xml| 16 +--- 7 files changed, 9 insertions(+), 17 deletions(-)
[phoenix] branch 5.1 updated: PHOENIX-6450 Checkstyle creating warnings for line length > 80 but < 100
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a commit to branch 5.1 in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/5.1 by this push: new 978d6af PHOENIX-6450 Checkstyle creating warnings for line length > 80 but < 100 978d6af is described below commit 978d6afe9ae9cfa0660badff00974d4b3641b744 Author: Richard Antal AuthorDate: Tue Jul 27 17:38:37 2021 +0200 PHOENIX-6450 Checkstyle creating warnings for line length > 80 but < 100 Change-Id: I24ae68bb3c237e1327b2c93774727f328b11aa50 --- phoenix-assembly/pom.xml | 1 - phoenix-client-parent/pom.xml | 1 - phoenix-core/pom.xml | 4 phoenix-pherf/pom.xml | 1 - phoenix-server/pom.xml | 1 - phoenix-tracing-webapp/pom.xml | 2 -- pom.xml| 16 +--- 7 files changed, 9 insertions(+), 17 deletions(-) diff --git a/phoenix-assembly/pom.xml b/phoenix-assembly/pom.xml index 93858b1..0d1123d 100644 --- a/phoenix-assembly/pom.xml +++ b/phoenix-assembly/pom.xml @@ -30,7 +30,6 @@ pom -${project.basedir}/.. true true diff --git a/phoenix-client-parent/pom.xml b/phoenix-client-parent/pom.xml index efcf0ac..ac363cf 100644 --- a/phoenix-client-parent/pom.xml +++ b/phoenix-client-parent/pom.xml @@ -34,7 +34,6 @@ true true -${project.basedir}/.. org.apache.phoenix.shaded diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml index 4e6c52d..96b8ade 100644 --- a/phoenix-core/pom.xml +++ b/phoenix-core/pom.xml @@ -27,10 +27,6 @@ Phoenix Core Core Phoenix codebase - -${project.basedir}/.. - - diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml index b42032f..04b8714 100644 --- a/phoenix-pherf/pom.xml +++ b/phoenix-pherf/pom.xml @@ -30,7 +30,6 @@ Phoenix - Pherf -${project.basedir}/.. org.apache.phoenix.shaded diff --git a/phoenix-server/pom.xml b/phoenix-server/pom.xml index 6e5b16c..12f6dc2 100644 --- a/phoenix-server/pom.xml +++ b/phoenix-server/pom.xml @@ -36,7 +36,6 @@ true true -${project.basedir}/.. org.apache.phoenix.shaded diff --git a/phoenix-tracing-webapp/pom.xml b/phoenix-tracing-webapp/pom.xml index 725883a..30e18b9 100755 --- a/phoenix-tracing-webapp/pom.xml +++ b/phoenix-tracing-webapp/pom.xml @@ -30,8 +30,6 @@ Tracing web application will visualize the phoenix traces - ${project.basedir}/.. - 3.1.0 9.3.27.v20190418 diff --git a/pom.xml b/pom.xml index 60cf962..25db2a6 100644 --- a/pom.xml +++ b/pom.xml @@ -99,7 +99,7 @@ src/main/antlr3 target/generated-sources/antlr3 true -${project.basedir} +${project.basedir}/.. 2.10.3 @@ -495,18 +495,20 @@ org.apache.maven.plugins maven-checkstyle-plugin 3.1.0 + + ${top.dir}/src/main/config/checkstyle/checker.xml + ${top.dir}/src/main/config/checkstyle/suppressions.xml + true + ${top.dir}/src/main/config/checkstyle/header.txt + false + false + validate validate true - ${top.dir}/src/main/config/checkstyle/checker.xml - ${top.dir}/src/main/config/checkstyle/suppressions.xml - true - ${top.dir}/src/main/config/checkstyle/header.txt - false - false check
[phoenix] branch 4.x updated: PHOENIX-6450 Checkstyle creating warnings for line length > 80 but < 100
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a commit to branch 4.x in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/4.x by this push: new 0c58979 PHOENIX-6450 Checkstyle creating warnings for line length > 80 but < 100 0c58979 is described below commit 0c589796f807bfd4870aacdfefb59f6fc5d9ff6a Author: Richard Antal AuthorDate: Tue Jul 27 17:38:37 2021 +0200 PHOENIX-6450 Checkstyle creating warnings for line length > 80 but < 100 Change-Id: I24ae68bb3c237e1327b2c93774727f328b11aa50 --- phoenix-assembly/pom.xml | 1 - phoenix-client-parent/pom.xml | 1 - phoenix-core/pom.xml | 4 phoenix-pherf/pom.xml | 1 - phoenix-server/pom.xml | 1 - phoenix-tracing-webapp/pom.xml | 2 -- pom.xml| 16 +--- 7 files changed, 9 insertions(+), 17 deletions(-) diff --git a/phoenix-assembly/pom.xml b/phoenix-assembly/pom.xml index b7e07d2..2f46087 100644 --- a/phoenix-assembly/pom.xml +++ b/phoenix-assembly/pom.xml @@ -30,7 +30,6 @@ pom -${project.basedir}/.. true true diff --git a/phoenix-client-parent/pom.xml b/phoenix-client-parent/pom.xml index 8a6104d..90df4c0 100644 --- a/phoenix-client-parent/pom.xml +++ b/phoenix-client-parent/pom.xml @@ -34,7 +34,6 @@ true true -${project.basedir}/.. org.apache.phoenix.shaded diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml index 143be81..7fdc7a8 100644 --- a/phoenix-core/pom.xml +++ b/phoenix-core/pom.xml @@ -27,10 +27,6 @@ Phoenix Core Core Phoenix codebase - -${project.basedir}/.. - - diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml index 520394e..6f24361 100644 --- a/phoenix-pherf/pom.xml +++ b/phoenix-pherf/pom.xml @@ -29,7 +29,6 @@ Phoenix - Pherf - ${project.basedir}/.. org.apache.phoenix.shaded 0.650 diff --git a/phoenix-server/pom.xml b/phoenix-server/pom.xml index 1795d45..922470c 100644 --- a/phoenix-server/pom.xml +++ b/phoenix-server/pom.xml @@ -38,7 +38,6 @@ true true -${project.basedir}/.. diff --git a/phoenix-tracing-webapp/pom.xml b/phoenix-tracing-webapp/pom.xml index b9561cc..4ee691d 100755 --- a/phoenix-tracing-webapp/pom.xml +++ b/phoenix-tracing-webapp/pom.xml @@ -30,8 +30,6 @@ Tracing web application will visualize the phoenix traces - ${project.basedir}/.. - 3.1.0 9.3.27.v20190418 diff --git a/pom.xml b/pom.xml index ffea7f2..1913b2c 100644 --- a/pom.xml +++ b/pom.xml @@ -95,7 +95,7 @@ src/main/antlr3 target/generated-sources/antlr3 true -${project.basedir} +${project.basedir}/.. 1.2.1 @@ -440,18 +440,20 @@ org.apache.maven.plugins maven-checkstyle-plugin 3.1.0 + + ${top.dir}/src/main/config/checkstyle/checker.xml + ${top.dir}/src/main/config/checkstyle/suppressions.xml + true + ${top.dir}/src/main/config/checkstyle/header.txt + false + false + validate validate true - ${top.dir}/src/main/config/checkstyle/checker.xml - ${top.dir}/src/main/config/checkstyle/suppressions.xml - true - ${top.dir}/src/main/config/checkstyle/header.txt - false - false check
[phoenix] branch 4.16 updated: PHOENIX-6450 Checkstyle creating warnings for line length > 80 but < 100
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a commit to branch 4.16 in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/4.16 by this push: new 6f61ce3 PHOENIX-6450 Checkstyle creating warnings for line length > 80 but < 100 6f61ce3 is described below commit 6f61ce3bbdb43f0c93cb35776ec71050214c6cf8 Author: Richard Antal AuthorDate: Tue Jul 27 17:38:37 2021 +0200 PHOENIX-6450 Checkstyle creating warnings for line length > 80 but < 100 Change-Id: I24ae68bb3c237e1327b2c93774727f328b11aa50 --- phoenix-assembly/pom.xml | 1 - phoenix-client-parent/pom.xml | 1 - phoenix-core/pom.xml | 4 phoenix-pherf/pom.xml | 1 - phoenix-server/pom.xml | 1 - phoenix-tracing-webapp/pom.xml | 2 -- pom.xml| 16 +--- 7 files changed, 9 insertions(+), 17 deletions(-) diff --git a/phoenix-assembly/pom.xml b/phoenix-assembly/pom.xml index bda29c6..97ecfb6 100644 --- a/phoenix-assembly/pom.xml +++ b/phoenix-assembly/pom.xml @@ -30,7 +30,6 @@ pom -${project.basedir}/.. true true diff --git a/phoenix-client-parent/pom.xml b/phoenix-client-parent/pom.xml index f77e2e7..96ae160 100644 --- a/phoenix-client-parent/pom.xml +++ b/phoenix-client-parent/pom.xml @@ -34,7 +34,6 @@ true true -${project.basedir}/.. org.apache.phoenix.shaded diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml index 8c7a4dc..70cfb76 100644 --- a/phoenix-core/pom.xml +++ b/phoenix-core/pom.xml @@ -27,10 +27,6 @@ Phoenix Core Core Phoenix codebase - -${project.basedir}/.. - - diff --git a/phoenix-pherf/pom.xml b/phoenix-pherf/pom.xml index 71832c8..2b5d781 100644 --- a/phoenix-pherf/pom.xml +++ b/phoenix-pherf/pom.xml @@ -29,7 +29,6 @@ Phoenix - Pherf - ${project.basedir}/.. org.apache.phoenix.shaded 0.650 diff --git a/phoenix-server/pom.xml b/phoenix-server/pom.xml index 59fce22..fb29ea0 100644 --- a/phoenix-server/pom.xml +++ b/phoenix-server/pom.xml @@ -38,7 +38,6 @@ true true -${project.basedir}/.. diff --git a/phoenix-tracing-webapp/pom.xml b/phoenix-tracing-webapp/pom.xml index bed170b..eae053f 100755 --- a/phoenix-tracing-webapp/pom.xml +++ b/phoenix-tracing-webapp/pom.xml @@ -30,8 +30,6 @@ Tracing web application will visualize the phoenix traces - ${project.basedir}/.. - 3.1.0 9.3.27.v20190418 diff --git a/pom.xml b/pom.xml index 023b326..b2cd483 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ src/main/antlr3 target/generated-sources/antlr3 true -${project.basedir} +${project.basedir}/.. 1.2.1 @@ -440,18 +440,20 @@ org.apache.maven.plugins maven-checkstyle-plugin 3.1.0 + + ${top.dir}/src/main/config/checkstyle/checker.xml + ${top.dir}/src/main/config/checkstyle/suppressions.xml + true + ${top.dir}/src/main/config/checkstyle/header.txt + false + false + validate validate true - ${top.dir}/src/main/config/checkstyle/checker.xml - ${top.dir}/src/main/config/checkstyle/suppressions.xml - true - ${top.dir}/src/main/config/checkstyle/header.txt - false - false check
[phoenix] branch master updated (693cc1c -> fa7e8c9)
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/phoenix.git. from 693cc1c PHOENIX-6450 Checkstyle creating warnings for line length > 80 but < 100 add fa7e8c9 PHOENIX-6519 Make SchemaTool work with lower case table and column names No new revisions were added by this update. Summary of changes: .../apache/phoenix/end2end/ShowCreateTableIT.java | 1 - .../schematool/SchemaExtractionProcessor.java | 62 +++ .../java/org/apache/phoenix/util/SchemaUtil.java | 72 ++ .../phoenix/schema/SchemaToolExtractionIT.java | 72 ++ 4 files changed, 182 insertions(+), 25 deletions(-)
Apache-Phoenix | 4.x | HBase 1.3 | Build #306 FAILURE
4.x branch HBase 1.3 build #306 status FAILURE Build #306 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/306/
Apache-Phoenix | 4.16 | HBase 1.3 | Build #70 FAILURE
4.16 branch HBase 1.3 build #70 status FAILURE Build #70 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/70/
Apache-Phoenix | master | HBase 2.1 | Build #317 FAILURE
master branch HBase 2.1 build #317 status FAILURE Build #317 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/317/
[phoenix] branch 5.1 updated (978d6af -> a094666)
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a change to branch 5.1 in repository https://gitbox.apache.org/repos/asf/phoenix.git. from 978d6af PHOENIX-6450 Checkstyle creating warnings for line length > 80 but < 100 new cae91b8 PHOENIX-6454: Add feature to SchemaTool to get the DDL in specification mode (#1229) new a094666 PHOENIX-6454: Add feature to SchemaTool to get the DDL in specification (Addendum) (#1233) The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../phoenix/compile/CreateTableCompiler.java | 2 +- .../apache/phoenix/parse/CreateIndexStatement.java | 13 ++ .../apache/phoenix/parse/CreateTableStatement.java | 33 ++- .../apache/phoenix/parse/IndexKeyConstraint.java | 16 ++ .../apache/phoenix/parse/PrimaryKeyConstraint.java | 18 +- phoenix-tools/pom.xml | 5 + ...tionToolIT.java => SchemaToolExtractionIT.java} | 18 +- .../phoenix/schema/SchemaToolSynthesisIT.java | 227 .../it/resources/synthesis/alter_add_property.sql | 18 +- .../resources/synthesis/alter_change_property.sql | 18 +- .../synthesis/alter_index_add_property.sql | 10 +- .../synthesis/alter_index_change_property.sql | 10 +- .../src/it/resources/synthesis/alter_table_add.sql | 18 +- .../it/resources/synthesis/alter_table_add_pk.sql | 11 +- .../it/resources/synthesis/alter_table_drop.sql| 18 +- .../resources/synthesis/alter_table_multiple.sql | 18 +- .../src/it/resources/synthesis/alter_view_add.sql | 31 +-- .../src/it/resources/synthesis/alter_view_drop.sql | 31 +-- .../src/it/resources/synthesis/create_function.sql | 6 +- .../it/resources/synthesis/drop_create_table.sql | 43 ++-- .../src/it/resources/synthesis/drop_index.sql | 9 +- .../src/it/resources/synthesis/drop_table.sql | 17 +- .../resources/synthesis/mismatched_entity_name.sql | 18 +- .../phoenix/schema/SchemaExtractionProcessor.java | 3 +- .../org/apache/phoenix/schema/SchemaProcessor.java | 4 +- .../org/apache/phoenix/schema/SchemaSQLUtil.java | 172 +++ .../phoenix/schema/SchemaSynthesisProcessor.java | 235 + .../{SchemaExtractionTool.java => SchemaTool.java} | 57 +++-- 28 files changed, 936 insertions(+), 143 deletions(-) rename phoenix-tools/src/it/java/org/apache/phoenix/schema/{SchemaExtractionToolIT.java => SchemaToolExtractionIT.java} (97%) create mode 100644 phoenix-tools/src/it/java/org/apache/phoenix/schema/SchemaToolSynthesisIT.java copy phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/AbstractBaseSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_add_property.sql (63%) copy phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/AbstractBaseSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_change_property.sql (64%) copy phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_index_add_property.sql (77%) copy phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_index_change_property.sql (78%) copy phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/AbstractBaseSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_table_add.sql (62%) copy phoenix-core/src/it/resources/sql_files/create_tmp_table.sql => phoenix-tools/src/it/resources/synthesis/alter_table_add_pk.sql (80%) copy phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/AbstractBaseSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_table_drop.sql (64%) copy phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/AbstractBaseSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_table_multiple.sql (60%) copy phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexSplitForwardScanIT.java => phoenix-tools/src/it/resources/synthesis/alter_view_add.sql (62%) copy phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexSplitForwardScanIT.java => phoenix-tools/src/it/resources/synthesis/alter_view_drop.sql (63%) copy phoenix-core/src/it/resources/gold_files/gold_query_delete_for_splitable_syscat.txt => phoenix-tools/src/it/resources/synthesis/create_function.sql (89%) copy phoenix-core/src/main/java/org/apache/phoenix/parse/AndBooleanParseNodeVisitor.java => phoenix-tools/src/it/resources/synthesis/drop_create_table.sql (53%) copy phoenix-core/src/main/java/org/apache/phoenix/expression/BaseDecimalAddSubtractExpression.java => phoenix-tools/src/it/resources/synthesis/drop_index.sql (73%) copy
[phoenix] 01/02: PHOENIX-6454: Add feature to SchemaTool to get the DDL in specification mode (#1229)
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a commit to branch 5.1 in repository https://gitbox.apache.org/repos/asf/phoenix.git commit cae91b89cab8f80893d89deeca86f6c14e3565ef Author: Swaroopa Kadam AuthorDate: Fri May 14 09:47:35 2021 -0700 PHOENIX-6454: Add feature to SchemaTool to get the DDL in specification mode (#1229) Co-authored-by: Swaroopa Kadam --- .../phoenix/compile/CreateTableCompiler.java | 2 +- .../apache/phoenix/parse/CreateIndexStatement.java | 13 ++ .../apache/phoenix/parse/CreateTableStatement.java | 33 ++- .../apache/phoenix/parse/IndexKeyConstraint.java | 16 ++ .../apache/phoenix/parse/PrimaryKeyConstraint.java | 18 +- phoenix-tools/pom.xml | 5 + ...tionToolIT.java => SchemaToolExtractionIT.java} | 18 +- .../phoenix/schema/SchemaToolSynthesisIT.java | 205 ++ .../it/resources/synthesis/alter_add_property.sql | 34 +-- .../resources/synthesis/alter_change_property.sql | 34 +-- .../synthesis/alter_index_add_property.sql | 27 +-- .../synthesis/alter_index_change_property.sql | 27 +-- .../src/it/resources/synthesis/alter_table_add.sql | 34 +-- .../it/resources/synthesis/alter_table_add_pk.sql | 8 + .../it/resources/synthesis/alter_table_drop.sql| 34 +-- .../resources/synthesis/alter_table_multiple.sql | 34 ++- .../src/it/resources/synthesis/alter_view_add.sql | 39 ++-- .../src/it/resources/synthesis/alter_view_drop.sql | 39 ++-- .../src/it/resources/synthesis/create_function.sql | 25 +-- .../src/it/resources/synthesis/drop_index.sql | 27 +-- .../src/it/resources/synthesis/drop_table.sql | 34 ++- .../resources/synthesis/mismatched_entity_name.sql | 34 +-- .../phoenix/schema/SchemaExtractionProcessor.java | 3 +- .../org/apache/phoenix/schema/SchemaProcessor.java | 27 +-- .../org/apache/phoenix/schema/SchemaSQLUtil.java | 168 +++ .../phoenix/schema/SchemaSynthesisProcessor.java | 235 + .../{SchemaExtractionTool.java => SchemaTool.java} | 57 +++-- 27 files changed, 884 insertions(+), 346 deletions(-) diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/CreateTableCompiler.java b/phoenix-core/src/main/java/org/apache/phoenix/compile/CreateTableCompiler.java index ec31a52..c8933f3 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/compile/CreateTableCompiler.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/CreateTableCompiler.java @@ -117,7 +117,7 @@ public class CreateTableCompiler { } } if (overideColumnDefs != null) { -create = new CreateTableStatement (create,overideColumnDefs); +create = new CreateTableStatement(create,overideColumnDefs); } final CreateTableStatement finalCreate = create; diff --git a/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateIndexStatement.java b/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateIndexStatement.java index 33f05e9..172b95e 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateIndexStatement.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateIndexStatement.java @@ -54,6 +54,19 @@ public class CreateIndexStatement extends SingleTableStatement { this.udfParseNodes = udfParseNodes; } +public CreateIndexStatement(CreateIndexStatement createStmt, ListMultimap> finalProps) { +super(createStmt.getTable(), createStmt.getBindCount()); +this.indexTableName = createStmt.getIndexTableName(); +this.indexKeyConstraint = createStmt.getIndexConstraint(); +this.includeColumns = createStmt.getIncludeColumns(); +this.splitNodes = createStmt.getSplitNodes(); +this.props = finalProps; +this.ifNotExists = createStmt.ifNotExists(); +this.indexType = createStmt.getIndexType(); +this.async = createStmt.isAsync(); +this.udfParseNodes = createStmt.getUdfParseNodes(); +} + public IndexKeyConstraint getIndexConstraint() { return indexKeyConstraint; } diff --git a/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateTableStatement.java b/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateTableStatement.java index ebd0a07..fcde8f1 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateTableStatement.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateTableStatement.java @@ -55,7 +55,36 @@ public class CreateTableStatement extends MutableStatement { this.whereClause = createTable.whereClause; this.immutableRows = createTable.immutableRows; } - + +public CreateTableStatement(CreateTableStatement createTable, PrimaryKeyConstraint pkConstraint, +List columns) { +this.tableName = createTable.tableName; +this.tableType = createTable.tabl
[phoenix] 02/02: PHOENIX-6454: Add feature to SchemaTool to get the DDL in specification (Addendum) (#1233)
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a commit to branch 5.1 in repository https://gitbox.apache.org/repos/asf/phoenix.git commit a094666b7866a3fd3b7e82604cae0cc9de58cbf3 Author: Swaroopa Kadam AuthorDate: Fri Jun 11 10:15:58 2021 -0700 PHOENIX-6454: Add feature to SchemaTool to get the DDL in specification (Addendum) (#1233) --- .../apache/phoenix/parse/PrimaryKeyConstraint.java | 8 ++-- .../phoenix/schema/SchemaToolSynthesisIT.java | 48 -- .../it/resources/synthesis/alter_add_property.sql | 3 +- .../resources/synthesis/alter_change_property.sql | 3 +- .../src/it/resources/synthesis/alter_table_add.sql | 5 ++- .../it/resources/synthesis/alter_table_add_pk.sql | 18 .../it/resources/synthesis/alter_table_drop.sql| 3 +- .../resources/synthesis/alter_table_multiple.sql | 3 +- .../{alter_table_add.sql => drop_create_table.sql} | 15 ++- .../resources/synthesis/mismatched_entity_name.sql | 3 +- .../org/apache/phoenix/schema/SchemaSQLUtil.java | 4 ++ .../phoenix/schema/SchemaSynthesisProcessor.java | 10 ++--- 12 files changed, 93 insertions(+), 30 deletions(-) diff --git a/phoenix-core/src/main/java/org/apache/phoenix/parse/PrimaryKeyConstraint.java b/phoenix-core/src/main/java/org/apache/phoenix/parse/PrimaryKeyConstraint.java index e6a65a5..802a87f 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/parse/PrimaryKeyConstraint.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/parse/PrimaryKeyConstraint.java @@ -95,13 +95,13 @@ public class PrimaryKeyConstraint extends NamedNode { @Override public String toString() { StringBuffer sb = new StringBuffer(); -for(Map.Entry> entry : columnNameToSortOrder.entrySet()) { +for (Pair entry : columns) { if(sb.length()!=0) { sb.append(", "); } -sb.append(entry.getKey()); -if(entry.getValue().getSecond() != SortOrder.getDefault()) { -sb.append(" "+entry.getValue().getSecond()); +sb.append(entry.getFirst()); +if(entry.getSecond() != SortOrder.getDefault()) { +sb.append(" "+entry.getSecond()); } } return sb.toString(); diff --git a/phoenix-tools/src/it/java/org/apache/phoenix/schema/SchemaToolSynthesisIT.java b/phoenix-tools/src/it/java/org/apache/phoenix/schema/SchemaToolSynthesisIT.java index 8ac0774..48b4c00 100644 --- a/phoenix-tools/src/it/java/org/apache/phoenix/schema/SchemaToolSynthesisIT.java +++ b/phoenix-tools/src/it/java/org/apache/phoenix/schema/SchemaToolSynthesisIT.java @@ -39,11 +39,11 @@ public class SchemaToolSynthesisIT { // Adding new column RELATED_COMMAND public void testCreateTableStatement_addColumn() throws Exception { String expected = "CREATE TABLE IF NOT EXISTS TEST.SAMPLE_TABLE\n" -+ "(ORG_ID CHAR(15) NOT NULL,\n" + "SOME_ANOTHER_ID BIGINT NOT NULL,\n" ++ "(ORG_ID CHAR(15) NOT NULL,\n" + "SOME_ANOTHER_ID BIGINT NOT NULL,\n" + "SECOND_ID BIGINT NOT NULL,\n" + "TYPE VARCHAR,\n" + "STATUS VARCHAR,\n" + "START_TIMESTAMP BIGINT,\n" + "END_TIMESTAMP BIGINT,\n" + "PARAMS VARCHAR,\n" + "RESULT VARCHAR,\n" -+ "RELATED_COMMAND BIGINT\n" -+ "CONSTRAINT PK PRIMARY KEY (ORG_ID, SOME_ANOTHER_ID))\n" ++ "RELATED_COMMAND BIGINT DEFAULT 100\n" ++ "CONSTRAINT PK PRIMARY KEY (ORG_ID, SOME_ANOTHER_ID, SECOND_ID))\n" + "VERSIONS=1,MULTI_TENANT=false,REPLICATION_SCOPE=1,TTL=31536000"; String baseDDL = filePath+"/alter_table_add.sql"; runAndVerify(expected, baseDDL); @@ -53,10 +53,10 @@ public class SchemaToolSynthesisIT { // Dropping TYPE column public void testCreateTableStatement_dropColumn() throws Exception { String expected = "CREATE TABLE IF NOT EXISTS TEST.SAMPLE_TABLE\n" -+ "(ORG_ID CHAR(15) NOT NULL,\n" + "SOME_ANOTHER_ID BIGINT NOT NULL,\n" ++ "(ORG_ID CHAR(15) NOT NULL,\n" + "SOME_ANOTHER_ID BIGINT NOT NULL,\n" + "SECOND_ID BIGINT NOT NULL,\n" + "STATUS VARCHAR,\n" + "START_TIMESTAMP BIGINT,\n" + "END_TIMESTAMP BIGINT,\n" + "PARAMS VARCHAR,\n" + "RESULT VARCHAR\n" -+ "CONSTRAINT PK PRIMARY KEY (ORG_ID, SOME_ANOTHER_ID))\n" ++ "CONSTRAINT PK PRIMARY KEY (ORG_ID, SOME_ANOTHER_ID, SECOND_ID))\n" + "VERSIONS=1,MULTI_TENANT=false,REPLICATION_SCOPE=1,TTL=31536000"; String baseDDL = filePath+"/alter_table_drop.sql"; runAndVerify(expected, baseDDL); @@ -66,10 +66,10 @@ public class SchemaToolSynthesisIT { // Changing REPLICATION SCOPE from 1 to 0 public void testCreateTableStatement_changeProperty() throws Exception { String expected = "CREATE TABLE IF NOT EXISTS TEST.SA
[phoenix] branch 4.16 updated (6f61ce3 -> d1549a0)
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a change to branch 4.16 in repository https://gitbox.apache.org/repos/asf/phoenix.git. from 6f61ce3 PHOENIX-6450 Checkstyle creating warnings for line length > 80 but < 100 new 5f3ce4f PHOENIX-6454: Add feature to SchemaTool to get the DDL in specification mode (#1217) new d1549a0 PHOENIX-6454: Add feature to SchemaTool to get the DDL in specification (Addendum) (#1233) The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../apache/phoenix/parse/CreateIndexStatement.java | 14 ++ .../apache/phoenix/parse/CreateTableStatement.java | 33 ++- .../apache/phoenix/parse/IndexKeyConstraint.java | 16 ++ .../apache/phoenix/parse/PrimaryKeyConstraint.java | 18 +- ...tionToolIT.java => SchemaToolExtractionIT.java} | 18 +- .../phoenix/schema/SchemaToolSynthesisIT.java | 218 +++ .../it/resources/synthesis/alter_add_property.sql | 18 +- .../resources/synthesis/alter_change_property.sql | 18 +- .../synthesis/alter_index_add_property.sql | 10 +- .../synthesis/alter_index_change_property.sql | 10 +- .../src/it/resources/synthesis/alter_table_add.sql | 18 +- .../it/resources/synthesis/alter_table_add_pk.sql | 12 +- .../it/resources/synthesis/alter_table_drop.sql| 18 +- .../resources/synthesis/alter_table_multiple.sql | 18 +- .../src/it/resources/synthesis/alter_view_add.sql | 31 +-- .../src/it/resources/synthesis/alter_view_drop.sql | 31 +-- .../src/it/resources/synthesis/create_function.sql | 6 +- .../it/resources/synthesis/drop_create_table.sql | 43 ++-- .../src/it/resources/synthesis/drop_index.sql | 18 +- .../src/it/resources/synthesis/drop_table.sql | 17 +- .../resources/synthesis/mismatched_entity_name.sql | 18 +- .../phoenix/schema/SchemaExtractionProcessor.java | 3 +- .../org/apache/phoenix/schema/SchemaProcessor.java | 4 +- .../org/apache/phoenix/schema/SchemaSQLUtil.java | 172 +++ .../phoenix/schema/SchemaSynthesisProcessor.java | 233 + .../{SchemaExtractionTool.java => SchemaTool.java} | 57 +++-- 26 files changed, 920 insertions(+), 152 deletions(-) rename phoenix-tools/src/it/java/org/apache/phoenix/schema/{SchemaExtractionToolIT.java => SchemaToolExtractionIT.java} (97%) create mode 100644 phoenix-tools/src/it/java/org/apache/phoenix/schema/SchemaToolSynthesisIT.java copy phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/AbstractBaseSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_add_property.sql (63%) copy phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/AbstractBaseSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_change_property.sql (64%) copy phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_index_add_property.sql (77%) copy phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_index_change_property.sql (78%) copy phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/AbstractBaseSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_table_add.sql (62%) copy phoenix-core/src/it/resources/sql_files/query_create_diverged_view.sql => phoenix-tools/src/it/resources/synthesis/alter_table_add_pk.sql (80%) copy phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/AbstractBaseSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_table_drop.sql (64%) copy phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/AbstractBaseSplitter.java => phoenix-tools/src/it/resources/synthesis/alter_table_multiple.sql (60%) copy phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexSplitForwardScanIT.java => phoenix-tools/src/it/resources/synthesis/alter_view_add.sql (62%) copy phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexSplitForwardScanIT.java => phoenix-tools/src/it/resources/synthesis/alter_view_drop.sql (63%) copy phoenix-core/src/it/resources/gold_files/gold_query_add_delete.txt => phoenix-tools/src/it/resources/synthesis/create_function.sql (89%) copy phoenix-core/src/main/java/org/apache/phoenix/parse/AndBooleanParseNodeVisitor.java => phoenix-tools/src/it/resources/synthesis/drop_create_table.sql (53%) copy phoenix-core/src/main/java/org/apache/hadoop/hbase/ipc/RpcUtil.java => phoenix-tools/src/it/resources/synthesis/drop_index.sql (73%) copy phoenix-core/src/main/java/org/apache/phoenix/expression/util/regex/AbstractBaseSplitter.java => phoenix-tools/src/it/resources/synthesis/drop_table.sql (63
[phoenix] 01/02: PHOENIX-6454: Add feature to SchemaTool to get the DDL in specification mode (#1217)
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a commit to branch 4.16 in repository https://gitbox.apache.org/repos/asf/phoenix.git commit 5f3ce4f6ae4107715b1e2756b9f8e0772283f860 Author: Swaroopa Kadam AuthorDate: Wed May 12 15:03:39 2021 -0700 PHOENIX-6454: Add feature to SchemaTool to get the DDL in specification mode (#1217) Co-authored-by: Swaroopa Kadam --- .../apache/phoenix/parse/CreateIndexStatement.java | 14 ++ .../apache/phoenix/parse/CreateTableStatement.java | 18 +- .../apache/phoenix/parse/IndexKeyConstraint.java | 16 ++ .../apache/phoenix/parse/PrimaryKeyConstraint.java | 16 +- ...tionToolIT.java => SchemaToolExtractionIT.java} | 18 +- .../phoenix/schema/SchemaToolSynthesisIT.java | 196 +++ .../it/resources/synthesis/alter_add_property.sql | 34 ++-- .../resources/synthesis/alter_change_property.sql | 34 ++-- .../synthesis/alter_index_add_property.sql | 27 +-- .../synthesis/alter_index_change_property.sql | 27 +-- .../src/it/resources/synthesis/alter_table_add.sql | 34 ++-- .../it/resources/synthesis/alter_table_drop.sql| 34 ++-- .../resources/synthesis/alter_table_multiple.sql | 34 ++-- .../src/it/resources/synthesis/alter_view_add.sql | 39 ++-- .../src/it/resources/synthesis/alter_view_drop.sql | 39 ++-- .../src/it/resources/synthesis/create_function.sql | 25 +-- .../src/it/resources/synthesis/drop_index.sql | 27 +-- .../src/it/resources/synthesis/drop_table.sql | 34 ++-- .../resources/synthesis/mismatched_entity_name.sql | 34 ++-- .../phoenix/schema/SchemaExtractionProcessor.java | 3 +- .../org/apache/phoenix/schema/SchemaProcessor.java | 27 +-- .../org/apache/phoenix/schema/SchemaSQLUtil.java | 168 .../phoenix/schema/SchemaSynthesisProcessor.java | 216 + .../{SchemaExtractionTool.java => SchemaTool.java} | 57 -- 24 files changed, 827 insertions(+), 344 deletions(-) diff --git a/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateIndexStatement.java b/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateIndexStatement.java index 6da0ff3..392ba9a 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateIndexStatement.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateIndexStatement.java @@ -21,6 +21,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import com.google.common.collect.ImmutableList; import org.apache.hadoop.hbase.util.Pair; import org.apache.phoenix.schema.PTable.IndexType; @@ -54,6 +55,19 @@ public class CreateIndexStatement extends SingleTableStatement { this.udfParseNodes = udfParseNodes; } +public CreateIndexStatement(CreateIndexStatement createStmt, ListMultimap> finalProps) { +super(createStmt.getTable(), createStmt.getBindCount()); +this.indexTableName = createStmt.getIndexTableName(); +this.indexKeyConstraint = createStmt.getIndexConstraint(); +this.includeColumns = createStmt.getIncludeColumns(); +this.splitNodes = createStmt.getSplitNodes(); +this.props = finalProps; +this.ifNotExists = createStmt.ifNotExists(); +this.indexType = createStmt.getIndexType(); +this.async = createStmt.isAsync(); +this.udfParseNodes = createStmt.getUdfParseNodes(); +} + public IndexKeyConstraint getIndexConstraint() { return indexKeyConstraint; } diff --git a/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateTableStatement.java b/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateTableStatement.java index 73b7a11..62c68a0 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateTableStatement.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateTableStatement.java @@ -59,7 +59,21 @@ public class CreateTableStatement extends MutableStatement { this.whereClause = createTable.whereClause; this.immutableRows = createTable.immutableRows; } - + +public CreateTableStatement(CreateTableStatement createTable, ListMultimap> props, List columns) { +this.tableName = createTable.tableName; +this.tableType = createTable.tableType; +this.columns = ImmutableList.copyOf(columns); +this.pkConstraint = createTable.pkConstraint; +this.splitNodes = createTable.splitNodes; +this.bindCount = createTable.bindCount; +this.props = props; +this.ifNotExists = createTable.ifNotExists; +this.baseTableName = createTable.baseTableName; +this.whereClause = createTable.whereClause; +this.immutableRows = createTable.immutableRows; +} + protected CreateTableStatement(TableName tableName, ListMultimap> props, List columns, PrimaryKeyConstraint pkConstraint, List splitNodes, PTableType tableType, boolean ifNotExists,
[phoenix] 02/02: PHOENIX-6454: Add feature to SchemaTool to get the DDL in specification (Addendum) (#1233)
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a commit to branch 4.16 in repository https://gitbox.apache.org/repos/asf/phoenix.git commit d1549a075ae2df4d243a318d505be2a09563226c Author: Swaroopa Kadam AuthorDate: Fri Jun 11 10:15:58 2021 -0700 PHOENIX-6454: Add feature to SchemaTool to get the DDL in specification (Addendum) (#1233) --- .../apache/phoenix/parse/CreateTableStatement.java | 15 +++ .../apache/phoenix/parse/PrimaryKeyConstraint.java | 10 ++--- .../phoenix/schema/SchemaToolSynthesisIT.java | 48 -- .../it/resources/synthesis/alter_add_property.sql | 3 +- .../resources/synthesis/alter_change_property.sql | 3 +- .../src/it/resources/synthesis/alter_table_add.sql | 5 ++- ...alter_table_drop.sql => alter_table_add_pk.sql} | 19 - .../it/resources/synthesis/alter_table_drop.sql| 3 +- .../resources/synthesis/alter_table_multiple.sql | 3 +- .../{alter_table_add.sql => drop_create_table.sql} | 15 ++- .../resources/synthesis/mismatched_entity_name.sql | 3 +- .../org/apache/phoenix/schema/SchemaSQLUtil.java | 6 ++- .../phoenix/schema/SchemaSynthesisProcessor.java | 19 - 13 files changed, 113 insertions(+), 39 deletions(-) diff --git a/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateTableStatement.java b/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateTableStatement.java index 62c68a0..fb7186a 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateTableStatement.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/parse/CreateTableStatement.java @@ -60,6 +60,21 @@ public class CreateTableStatement extends MutableStatement { this.immutableRows = createTable.immutableRows; } +public CreateTableStatement(CreateTableStatement createTable, PrimaryKeyConstraint pkConstraint, +List columns) { +this.tableName = createTable.tableName; +this.tableType = createTable.tableType; +this.columns = ImmutableList.copyOf(columns); +this.pkConstraint = pkConstraint; +this.splitNodes = createTable.splitNodes; +this.bindCount = createTable.bindCount; +this.props = createTable.props; +this.ifNotExists = createTable.ifNotExists; +this.baseTableName = createTable.baseTableName; +this.whereClause = createTable.whereClause; +this.immutableRows = createTable.immutableRows; +} + public CreateTableStatement(CreateTableStatement createTable, ListMultimap> props, List columns) { this.tableName = createTable.tableName; this.tableType = createTable.tableType; diff --git a/phoenix-core/src/main/java/org/apache/phoenix/parse/PrimaryKeyConstraint.java b/phoenix-core/src/main/java/org/apache/phoenix/parse/PrimaryKeyConstraint.java index eac9996..00d632d 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/parse/PrimaryKeyConstraint.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/parse/PrimaryKeyConstraint.java @@ -36,7 +36,7 @@ public class PrimaryKeyConstraint extends NamedNode { private final Map> columnNameToRowTimestamp; private final int numColumnsWithRowTimestamp; -PrimaryKeyConstraint(String name, List columnDefs) { +public PrimaryKeyConstraint(String name, List columnDefs) { super(name); if (columnDefs == null) { this.columns = Collections.>emptyList(); @@ -95,13 +95,13 @@ public class PrimaryKeyConstraint extends NamedNode { @Override public String toString() { StringBuffer sb = new StringBuffer(); -for(Map.Entry> entry : columnNameToSortOrder.entrySet()) { +for (Pair entry : columns) { if(sb.length()!=0) { sb.append(", "); } -sb.append(entry.getKey()); -if(entry.getValue().getSecond() != SortOrder.getDefault()) { -sb.append(" "+entry.getValue().getSecond()); +sb.append(entry.getFirst()); +if(entry.getSecond() != SortOrder.getDefault()) { +sb.append(" "+entry.getSecond()); } } return sb.toString(); diff --git a/phoenix-tools/src/it/java/org/apache/phoenix/schema/SchemaToolSynthesisIT.java b/phoenix-tools/src/it/java/org/apache/phoenix/schema/SchemaToolSynthesisIT.java index d41e0ea..b44db32 100644 --- a/phoenix-tools/src/it/java/org/apache/phoenix/schema/SchemaToolSynthesisIT.java +++ b/phoenix-tools/src/it/java/org/apache/phoenix/schema/SchemaToolSynthesisIT.java @@ -39,11 +39,11 @@ public class SchemaToolSynthesisIT { // Adding new column RELATED_COMMAND public void testCreateTableStatement_addColumn() throws Exception { String expected = "CREATE TABLE IF NOT EXISTS TEST.SAMPLE_TABLE\n" -+ "(ORG_ID CHAR(15) NOT NULL,\n" + "SOME_ANOTHER_ID BIGINT NOT NULL,\n" ++ "(ORG_ID CHAR(15) NOT NULL,\n"
[phoenix] branch master updated (fa7e8c9 -> a4f0304)
This is an automated email from the ASF dual-hosted git repository. vjasani pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/phoenix.git. from fa7e8c9 PHOENIX-6519 Make SchemaTool work with lower case table and column names add a4f0304 PHOENIX-6506 : Tenant Connection is not able to access/validate Global Sequences (#1261) No new revisions were added by this update. Summary of changes: .../org/apache/phoenix/end2end/UpsertValuesIT.java | 147 - .../phoenix/query/ConnectionQueryServicesImpl.java | 39 +- 2 files changed, 184 insertions(+), 2 deletions(-)
[phoenix] branch 5.1 updated: PHOENIX-6506 : Tenant Connection is not able to access/validate Global Sequences (#1261)
This is an automated email from the ASF dual-hosted git repository. vjasani pushed a commit to branch 5.1 in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/5.1 by this push: new 6c2a802 PHOENIX-6506 : Tenant Connection is not able to access/validate Global Sequences (#1261) 6c2a802 is described below commit 6c2a802b167b10a5fdae9f55548e9080cc641304 Author: Lokesh Khurana AuthorDate: Thu Jul 29 21:17:12 2021 +0530 PHOENIX-6506 : Tenant Connection is not able to access/validate Global Sequences (#1261) Signed-off-by: Viraj Jasani --- .../org/apache/phoenix/end2end/UpsertValuesIT.java | 147 - .../phoenix/query/ConnectionQueryServicesImpl.java | 39 +- 2 files changed, 184 insertions(+), 2 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java index 8365ca0..1d53b16 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java @@ -17,6 +17,7 @@ */ package org.apache.phoenix.end2end; +import static org.apache.phoenix.util.PhoenixRuntime.TENANT_ID_ATTRIB; import static org.apache.phoenix.util.TestUtil.closeStatement; import static org.apache.phoenix.util.TestUtil.closeStmtAndConn; import static org.junit.Assert.assertEquals; @@ -44,11 +45,14 @@ import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.util.Bytes; import org.apache.phoenix.exception.SQLExceptionCode; import org.apache.phoenix.jdbc.PhoenixConnection; +import org.apache.phoenix.schema.SequenceNotFoundException; import org.apache.phoenix.schema.types.PInteger; import org.apache.phoenix.util.DateUtil; import org.apache.phoenix.util.EnvironmentEdgeManager; import org.apache.phoenix.util.SchemaUtil; import org.apache.phoenix.util.TestUtil; +import org.apache.phoenix.util.PropertiesUtil; +import org.junit.Assert; import org.junit.Test; @@ -670,5 +674,146 @@ public class UpsertValuesIT extends ParallelStatsDisabledIT { assertTrue(next.containsColumn(Bytes.toBytes("CF2"), PInteger.INSTANCE.toBytes(3))); } } - + +@Test +public void testUpsertValueWithDiffSequenceAndConnections() throws Exception { +String tableName = generateUniqueName(); +try (Connection conn = DriverManager.getConnection(getUrl())) { +conn.setAutoCommit(true); +PreparedStatement createTableStatement = conn.prepareStatement(String.format("CREATE TABLE IF NOT EXISTS " + +"%s (SERVICE VARCHAR NOT NULL, SEQUENCE_NUMBER BIGINT NOT NULL , " + +"CONSTRAINT PK PRIMARY KEY (SERVICE, SEQUENCE_NUMBER)) MULTI_TENANT = TRUE", tableName)); +createTableStatement.execute(); +} + +testGlobalSequenceUpsertWithTenantConnection(tableName); +testGlobalSequenceUpsertWithGlobalConnection(tableName); +testTenantSequenceUpsertWithSameTenantConnection(tableName); +testTenantSequenceUpsertWithDifferentTenantConnection(tableName); +testTenantSequenceUpsertWithGlobalConnection(tableName); + +} + +private void testTenantSequenceUpsertWithGlobalConnection(String tableName) throws Exception { +String sequenceName = generateUniqueSequenceName(); + +try (Connection conn = getTenantConnection("PHOENIX")) { +conn.setAutoCommit(true); +PreparedStatement createSequenceStatement = conn.prepareStatement(String.format("CREATE SEQUENCE " + +"IF NOT EXISTS %s", sequenceName)); +createSequenceStatement.execute(); +} + +try (Connection tenantConn = DriverManager.getConnection(getUrl())) { +tenantConn.setAutoCommit(true); +Statement executeUpdateStatement = tenantConn.createStatement(); +try { +executeUpdateStatement.execute(String.format("UPSERT INTO %s ( SERVICE, SEQUENCE_NUMBER) VALUES " + +"( 'PHOENIX', NEXT VALUE FOR %s)", tableName, sequenceName)); +Assert.fail(); +} catch (SequenceNotFoundException e) { +assertTrue(true); +} catch (Exception e) { +Assert.fail(); +} +} +} + +private void testTenantSequenceUpsertWithDifferentTenantConnection(String tableName) throws Exception { +String sequenceName = generateUniqueSequenceName(); + +try (Connection conn = getTenantConnection("PHOENIX")) { +conn.setAutoCommit(true); +PreparedStatement createSequenceStatement = conn.prepareStatement(String.format("CREATE SEQUENCE " + +"IF NOT EXISTS %s", sequenceName)); +createSequenceStatement.execute(); +} + +try (Connection tenantConn
[phoenix] branch 4.x updated: PHOENIX-6506 : Tenant Connection is not able to access/validate Global Sequences (#1270) (#1261)
This is an automated email from the ASF dual-hosted git repository. vjasani pushed a commit to branch 4.x in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/4.x by this push: new 2bdd4a2 PHOENIX-6506 : Tenant Connection is not able to access/validate Global Sequences (#1270) (#1261) 2bdd4a2 is described below commit 2bdd4a2bb4c58e91a1293bd4afc09f6f33ee8542 Author: Lokesh Khurana AuthorDate: Thu Jul 29 21:20:33 2021 +0530 PHOENIX-6506 : Tenant Connection is not able to access/validate Global Sequences (#1270) (#1261) Signed-off-by: Viraj Jasani --- .../org/apache/phoenix/end2end/UpsertValuesIT.java | 148 - .../phoenix/query/ConnectionQueryServicesImpl.java | 40 +- 2 files changed, 186 insertions(+), 2 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java index e89cc58..32662ec 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java @@ -44,11 +44,15 @@ import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.util.Bytes; import org.apache.phoenix.exception.SQLExceptionCode; import org.apache.phoenix.jdbc.PhoenixConnection; +import org.apache.phoenix.schema.SequenceNotFoundException; import org.apache.phoenix.schema.types.PInteger; import org.apache.phoenix.util.DateUtil; import org.apache.phoenix.util.EnvironmentEdgeManager; import org.apache.phoenix.util.SchemaUtil; import org.apache.phoenix.util.TestUtil; +import org.apache.phoenix.util.PropertiesUtil; +import org.apache.phoenix.util.PhoenixRuntime; +import org.junit.Assert; import org.junit.Test; @@ -670,5 +674,147 @@ public class UpsertValuesIT extends ParallelStatsDisabledIT { assertTrue(next.containsColumn(Bytes.toBytes("CF2"), PInteger.INSTANCE.toBytes(3))); } } - + + +@Test +public void testUpsertValueWithDiffSequenceAndConnections() throws Exception { +String tableName = generateUniqueName(); +try (Connection conn = DriverManager.getConnection(getUrl())) { +conn.setAutoCommit(true); +PreparedStatement createTableStatement = conn.prepareStatement(String.format("CREATE TABLE IF NOT EXISTS " + +"%s (SERVICE VARCHAR NOT NULL, SEQUENCE_NUMBER BIGINT NOT NULL , " + +"CONSTRAINT PK PRIMARY KEY (SERVICE, SEQUENCE_NUMBER)) MULTI_TENANT = TRUE", tableName)); +createTableStatement.execute(); +} + +testGlobalSequenceUpsertWithTenantConnection(tableName); +testGlobalSequenceUpsertWithGlobalConnection(tableName); +testTenantSequenceUpsertWithSameTenantConnection(tableName); +testTenantSequenceUpsertWithDifferentTenantConnection(tableName); +testTenantSequenceUpsertWithGlobalConnection(tableName); + +} + +private void testTenantSequenceUpsertWithGlobalConnection(String tableName) throws Exception { +String sequenceName = generateUniqueSequenceName(); + +try (Connection conn = getTenantConnection("PHOENIX")) { +conn.setAutoCommit(true); +PreparedStatement createSequenceStatement = conn.prepareStatement(String.format("CREATE SEQUENCE " + +"IF NOT EXISTS %s", sequenceName)); +createSequenceStatement.execute(); +} + +try (Connection tenantConn = DriverManager.getConnection(getUrl())) { +tenantConn.setAutoCommit(true); +Statement executeUpdateStatement = tenantConn.createStatement(); +try { +executeUpdateStatement.execute(String.format("UPSERT INTO %s ( SERVICE, SEQUENCE_NUMBER) VALUES " + +"( 'PHOENIX', NEXT VALUE FOR %s)", tableName, sequenceName)); +Assert.fail(); +} catch (SequenceNotFoundException e) { +assertTrue(true); +} catch (Exception e) { +Assert.fail(); +} +} +} + +private void testTenantSequenceUpsertWithDifferentTenantConnection(String tableName) throws Exception { +String sequenceName = generateUniqueSequenceName(); + +try (Connection conn = getTenantConnection("PHOENIX")) { +conn.setAutoCommit(true); +PreparedStatement createSequenceStatement = conn.prepareStatement(String.format("CREATE SEQUENCE " + +"IF NOT EXISTS %s", sequenceName)); +createSequenceStatement.execute(); +} + +try (Connection tenantConn = getTenantConnection("HBASE")) { +tenantConn.setAutoCommit(true); + +Statement executeUpdateStatement = tenantConn.createStatement(); +try { +executeUpdateStatement.execute(String.format("UPSE
[phoenix] branch 4.16 updated: PHOENIX-6506 : Tenant Connection is not able to access/validate Global Sequences (#1270) (#1261)
This is an automated email from the ASF dual-hosted git repository. vjasani pushed a commit to branch 4.16 in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/4.16 by this push: new 2605cc2 PHOENIX-6506 : Tenant Connection is not able to access/validate Global Sequences (#1270) (#1261) 2605cc2 is described below commit 2605cc233e206678a72e02322a76b4b0bbf180f7 Author: Lokesh Khurana AuthorDate: Thu Jul 29 21:20:33 2021 +0530 PHOENIX-6506 : Tenant Connection is not able to access/validate Global Sequences (#1270) (#1261) Signed-off-by: Viraj Jasani --- .../org/apache/phoenix/end2end/UpsertValuesIT.java | 148 - .../phoenix/query/ConnectionQueryServicesImpl.java | 40 +- 2 files changed, 186 insertions(+), 2 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java index e89cc58..32662ec 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UpsertValuesIT.java @@ -44,11 +44,15 @@ import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.util.Bytes; import org.apache.phoenix.exception.SQLExceptionCode; import org.apache.phoenix.jdbc.PhoenixConnection; +import org.apache.phoenix.schema.SequenceNotFoundException; import org.apache.phoenix.schema.types.PInteger; import org.apache.phoenix.util.DateUtil; import org.apache.phoenix.util.EnvironmentEdgeManager; import org.apache.phoenix.util.SchemaUtil; import org.apache.phoenix.util.TestUtil; +import org.apache.phoenix.util.PropertiesUtil; +import org.apache.phoenix.util.PhoenixRuntime; +import org.junit.Assert; import org.junit.Test; @@ -670,5 +674,147 @@ public class UpsertValuesIT extends ParallelStatsDisabledIT { assertTrue(next.containsColumn(Bytes.toBytes("CF2"), PInteger.INSTANCE.toBytes(3))); } } - + + +@Test +public void testUpsertValueWithDiffSequenceAndConnections() throws Exception { +String tableName = generateUniqueName(); +try (Connection conn = DriverManager.getConnection(getUrl())) { +conn.setAutoCommit(true); +PreparedStatement createTableStatement = conn.prepareStatement(String.format("CREATE TABLE IF NOT EXISTS " + +"%s (SERVICE VARCHAR NOT NULL, SEQUENCE_NUMBER BIGINT NOT NULL , " + +"CONSTRAINT PK PRIMARY KEY (SERVICE, SEQUENCE_NUMBER)) MULTI_TENANT = TRUE", tableName)); +createTableStatement.execute(); +} + +testGlobalSequenceUpsertWithTenantConnection(tableName); +testGlobalSequenceUpsertWithGlobalConnection(tableName); +testTenantSequenceUpsertWithSameTenantConnection(tableName); +testTenantSequenceUpsertWithDifferentTenantConnection(tableName); +testTenantSequenceUpsertWithGlobalConnection(tableName); + +} + +private void testTenantSequenceUpsertWithGlobalConnection(String tableName) throws Exception { +String sequenceName = generateUniqueSequenceName(); + +try (Connection conn = getTenantConnection("PHOENIX")) { +conn.setAutoCommit(true); +PreparedStatement createSequenceStatement = conn.prepareStatement(String.format("CREATE SEQUENCE " + +"IF NOT EXISTS %s", sequenceName)); +createSequenceStatement.execute(); +} + +try (Connection tenantConn = DriverManager.getConnection(getUrl())) { +tenantConn.setAutoCommit(true); +Statement executeUpdateStatement = tenantConn.createStatement(); +try { +executeUpdateStatement.execute(String.format("UPSERT INTO %s ( SERVICE, SEQUENCE_NUMBER) VALUES " + +"( 'PHOENIX', NEXT VALUE FOR %s)", tableName, sequenceName)); +Assert.fail(); +} catch (SequenceNotFoundException e) { +assertTrue(true); +} catch (Exception e) { +Assert.fail(); +} +} +} + +private void testTenantSequenceUpsertWithDifferentTenantConnection(String tableName) throws Exception { +String sequenceName = generateUniqueSequenceName(); + +try (Connection conn = getTenantConnection("PHOENIX")) { +conn.setAutoCommit(true); +PreparedStatement createSequenceStatement = conn.prepareStatement(String.format("CREATE SEQUENCE " + +"IF NOT EXISTS %s", sequenceName)); +createSequenceStatement.execute(); +} + +try (Connection tenantConn = getTenantConnection("HBASE")) { +tenantConn.setAutoCommit(true); + +Statement executeUpdateStatement = tenantConn.createStatement(); +try { +executeUpdateStatement.execute(String.format("UP
[phoenix] branch 5.1 updated: PHOENIX-6518 Implement SHOW CREATE TABLE SQL command
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a commit to branch 5.1 in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/5.1 by this push: new efe9e85 PHOENIX-6518 Implement SHOW CREATE TABLE SQL command efe9e85 is described below commit efe9e851e6dc8d0c701dba65d6899c9469d93e4e Author: Richard Antal AuthorDate: Thu Jul 29 11:03:53 2021 +0200 PHOENIX-6518 Implement SHOW CREATE TABLE SQL command Change-Id: I2b8f693a94e1b9fee1e54ef09d2a28569de7a669 --- .../apache/phoenix/end2end/ShowCreateTableIT.java | 113 + phoenix-core/src/main/antlr3/PhoenixSQL.g | 6 ++ .../org/apache/phoenix/jdbc/PhoenixStatement.java | 23 + .../org/apache/phoenix/parse/ParseNodeFactory.java | 4 + .../org/apache/phoenix/parse/ShowCreateTable.java | 22 +++- .../phoenix/parse/ShowCreateTableStatement.java| 68 + .../schematool}/SchemaExtractionProcessor.java | 6 +- .../phoenix/schematool}/SchemaProcessor.java | 2 +- .../apache/phoenix/schematool}/SchemaSQLUtil.java | 4 +- .../schematool}/SchemaSynthesisProcessor.java | 9 +- .../java/org/apache/phoenix/util/QueryUtil.java| 29 ++ .../org/apache/phoenix/parse/QueryParserTest.java | 16 +++ phoenix-tools/pom.xml | 10 -- .../phoenix/schema/SchemaToolSynthesisIT.java | 4 +- .../java/org/apache/phoenix/schema/SchemaTool.java | 3 + 15 files changed, 296 insertions(+), 23 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ShowCreateTableIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ShowCreateTableIT.java new file mode 100644 index 000..f4502d0 --- /dev/null +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ShowCreateTableIT.java @@ -0,0 +1,113 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.phoenix.end2end; + +import org.apache.phoenix.util.SchemaUtil; +import org.junit.Ignore; +import org.junit.Test; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.util.Properties; + +import static org.junit.Assert.assertTrue; + +public class ShowCreateTableIT extends ParallelStatsDisabledIT { +@Test +public void testShowCreateTableBasic() throws Exception { +Properties props = new Properties(); +Connection conn = DriverManager.getConnection(getUrl(), props); +String tableName = generateUniqueName(); +String ddl = "CREATE TABLE " + tableName + "(K VARCHAR NOT NULL PRIMARY KEY, INT INTEGER)"; +conn.createStatement().execute(ddl); + +ResultSet rs = conn.createStatement().executeQuery("SHOW CREATE TABLE " + tableName ); +assertTrue(rs.next()); +assertTrue("Expected: :" + ddl + "\nResult: " + rs.getString(1), +rs.getString(1).contains(ddl)); +} + +@Ignore +@Test +public void testShowCreateTableLowerCase() throws Exception { +Properties props = new Properties(); +Connection conn = DriverManager.getConnection(getUrl(), props); +String tableName = "lowercasetbl1"; +String ddl = "CREATE TABLE \"" + tableName + "\"(K VARCHAR NOT NULL PRIMARY KEY, INT INTEGER)"; +conn.createStatement().execute(ddl); + +ResultSet rs = conn.createStatement().executeQuery("SHOW CREATE TABLE \"" + tableName + "\""); +assertTrue(rs.next()); +assertTrue("Expected: :" + ddl + "\nResult: " + rs.getString(1), +rs.getString(1).contains(ddl)); +} + +@Test +public void testShowCreateTableUpperCase() throws Exception { +Properties props = new Properties(); +Connection conn = DriverManager.getConnection(getUrl(), props); +String tableName = generateUniqueName(); +String schemaName = generateUniqueName(); +String tableFullName = SchemaUtil.getQualifiedTableName(schemaName, tableName); +String ddl = "CREATE TABLE " + tableFullName + "(K VARCHAR NOT NULL PRIMARY KEY, INT INTEGER)"; +conn.createStatement().execute(ddl); + +ResultSet rs = co
[phoenix] branch 5.1 updated: PHOENIX-6519 Make SchemaTool work with lower case table and column names
This is an automated email from the ASF dual-hosted git repository. richardantal pushed a commit to branch 5.1 in repository https://gitbox.apache.org/repos/asf/phoenix.git The following commit(s) were added to refs/heads/5.1 by this push: new 1e5c225 PHOENIX-6519 Make SchemaTool work with lower case table and column names 1e5c225 is described below commit 1e5c225af2664aef603892b3adf357121d674c3e Author: Richard Antal AuthorDate: Mon Jul 26 16:34:44 2021 +0200 PHOENIX-6519 Make SchemaTool work with lower case table and column names Change-Id: I643ed8c3db1ec7ebd0a68b13412a22ff7249f037 --- .../apache/phoenix/end2end/ShowCreateTableIT.java | 1 - .../schematool/SchemaExtractionProcessor.java | 62 +++ .../java/org/apache/phoenix/util/SchemaUtil.java | 72 ++ .../phoenix/schema/SchemaToolExtractionIT.java | 72 ++ 4 files changed, 182 insertions(+), 25 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ShowCreateTableIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ShowCreateTableIT.java index f4502d0..4895a84 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ShowCreateTableIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ShowCreateTableIT.java @@ -43,7 +43,6 @@ public class ShowCreateTableIT extends ParallelStatsDisabledIT { rs.getString(1).contains(ddl)); } -@Ignore @Test public void testShowCreateTableLowerCase() throws Exception { Properties props = new Properties(); diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schematool/SchemaExtractionProcessor.java b/phoenix-core/src/main/java/org/apache/phoenix/schematool/SchemaExtractionProcessor.java index 7528bc3..765068a 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/schematool/SchemaExtractionProcessor.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/schematool/SchemaExtractionProcessor.java @@ -88,19 +88,22 @@ public class SchemaExtractionProcessor implements SchemaProcessor { protected String extractCreateIndexDDL(PTable indexPTable) throws SQLException { -String pTableName = indexPTable.getTableName().getString(); +String quotedIndexTableName = SchemaUtil +.getFullTableNameWithQuotes(null, indexPTable.getTableName().getString()); String baseTableName = indexPTable.getParentTableName().getString(); -String baseTableFullName = SchemaUtil - .getQualifiedTableName(indexPTable.getSchemaName().getString(), baseTableName); +String baseTableFullName = indexPTable.getSchemaName().getString() + "." + baseTableName; PTable dataPTable = getPTable(baseTableFullName); +String quotedBaseTableFullName = SchemaUtil + .getFullTableNameWithQuotes(indexPTable.getSchemaName().getString(), baseTableName); + String defaultCF = SchemaUtil.getEmptyColumnFamilyAsString(indexPTable); String indexedColumnsString = getIndexedColumnsString(indexPTable, dataPTable, defaultCF); String coveredColumnsString = getCoveredColumnsString(indexPTable, defaultCF); -return generateIndexDDLString(baseTableFullName, indexedColumnsString, coveredColumnsString, -indexPTable.getIndexType().equals(PTable.IndexType.LOCAL), pTableName); +return generateIndexDDLString(quotedBaseTableFullName, indexedColumnsString, coveredColumnsString, +indexPTable.getIndexType().equals(PTable.IndexType.LOCAL), quotedIndexTableName); } //TODO: Indexed on an expression @@ -165,11 +168,17 @@ public class SchemaExtractionProcessor implements SchemaProcessor { private String extractIndexColumn(String columnName, String defaultCF) { String [] columnNameSplit = columnName.split(":"); -if(columnNameSplit[0].equals("") || columnNameSplit[0].equalsIgnoreCase(defaultCF)) { -return columnNameSplit[1]; +if(columnNameSplit[0].equals("") || columnNameSplit[0].equalsIgnoreCase(defaultCF) || +(defaultCF.startsWith("L#") && columnNameSplit[0].equalsIgnoreCase(defaultCF.substring(2 { +return SchemaUtil.formatColumnName(columnNameSplit[1]); } else { -return columnNameSplit.length > 1 ? -String.format("\"%s\".\"%s\"", columnNameSplit[0], columnNameSplit[1]) : columnNameSplit[0]; +if (columnNameSplit.length > 1) { +String schema = SchemaUtil.formatSchemaName(columnNameSplit[0]); +String name = SchemaUtil.formatColumnName(columnNameSplit[1]); +return String.format("%s.%s", schema, name); +} else { +return SchemaUtil.formatColumnName(columnNameSplit[0]); +} } } @@ -188,10 +197,10 @@ public class SchemaExtractionProcessor implements Sch
Apache-Phoenix | master | HBase 2.2 | Build #317 FAILURE
master branch HBase 2.2 build #317 status FAILURE Build #317 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/317/
Apache-Phoenix | master | HBase 2.3 | Build #317 FAILURE
master branch HBase 2.3 build #317 status FAILURE Build #317 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/317/
Apache-Phoenix | master | HBase 2.4 | Build #317 FAILURE
master branch HBase 2.4 build #317 status FAILURE Build #317 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/317/
Apache-Phoenix | 4.16 | HBase 1.3 | Build #71 FAILURE
4.16 branch HBase 1.3 build #71 status FAILURE Build #71 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/71/
Apache-Phoenix | 5.1 | HBase 2.3 | Build #78 FAILURE
5.1 branch HBase 2.3 build #78 status FAILURE Build #78 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/78/
Apache-Phoenix | 5.1 | HBase 2.1 | Build #78 FAILURE
5.1 branch HBase 2.1 build #78 status FAILURE Build #78 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/78/
Apache-Phoenix | 5.1 | HBase 2.4 | Build #78 SUCCESS
5.1 branch HBase 2.4 build #78 status SUCCESS Build #78 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/78/
Apache-Phoenix | 4.16 | HBase 1.3 | Build #72 FAILURE
4.16 branch HBase 1.3 build #72 status FAILURE Build #72 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/72/
Apache-Phoenix | 4.x | HBase 1.6 | Build #306 FAILURE
4.x branch HBase 1.6 build #306 status FAILURE Build #306 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/306/
Apache-Phoenix | 4.16 | HBase 1.6 | Build #70 FAILURE
4.16 branch HBase 1.6 build #70 status FAILURE Build #70 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/70/
Apache-Phoenix | 4.x | HBase 1.3 | Build #307 FAILURE
4.x branch HBase 1.3 build #307 status FAILURE Build #307 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/307/
Apache-Phoenix | master | HBase 2.4 | Build #318 FAILURE
master branch HBase 2.4 build #318 status FAILURE Build #318 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/318/
Apache-Phoenix | master | HBase 2.3 | Build #318 FAILURE
master branch HBase 2.3 build #318 status FAILURE Build #318 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/318/
Apache-Phoenix | master | HBase 2.2 | Build #318 FAILURE
master branch HBase 2.2 build #318 status FAILURE Build #318 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/318/
Apache-Phoenix | 5.1 | HBase 2.3 | Build #79 FAILURE
5.1 branch HBase 2.3 build #79 status FAILURE Build #79 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/79/
Apache-Phoenix | 5.1 | HBase 2.4 | Build #79 FAILURE
5.1 branch HBase 2.4 build #79 status FAILURE Build #79 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/79/
Apache-Phoenix | master | HBase 2.4 | Build #319 ABORTED
master branch HBase 2.4 build #319 status ABORTED Build #319 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/319/
Apache-Phoenix | master | HBase 2.3 | Build #319 ABORTED
master branch HBase 2.3 build #319 status ABORTED Build #319 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/319/
Apache-Phoenix | master | HBase 2.2 | Build #319 ABORTED
master branch HBase 2.2 build #319 status ABORTED Build #319 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/319/
Apache-Phoenix | master | HBase 2.1 | Build #319 ABORTED
master branch HBase 2.1 build #319 status ABORTED Build #319 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/319/
Apache-Phoenix | 4.x | HBase 1.4 | Build #306 SUCCESS
4.x branch HBase 1.4 build #306 status SUCCESS Build #306 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/306/
Apache-Phoenix | 5.1 | HBase 2.2 | Build #78 ABORTED
5.1 branch HBase 2.2 build #78 status ABORTED Build #78 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/78/
Apache-Phoenix | 4.16 | HBase 1.4 | Build #70 FAILURE
4.16 branch HBase 1.4 build #70 status FAILURE Build #70 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/70/
Apache-Phoenix | 5.1 | HBase 2.1 | Build #80 FAILURE
5.1 branch HBase 2.1 build #80 status FAILURE Build #80 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/80/
Apache-Phoenix | 4.16 | HBase 1.4 | Build #72 FAILURE
4.16 branch HBase 1.4 build #72 status FAILURE Build #72 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/72/
Apache-Phoenix | master | HBase 2.1 | Build #318 ABORTED
master branch HBase 2.1 build #318 status ABORTED Build #318 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/318/
Apache-Phoenix | 4.16 | HBase 1.6 | Build #72 FAILURE
4.16 branch HBase 1.6 build #72 status FAILURE Build #72 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/72/
Apache-Phoenix | 5.1 | HBase 2.2 | Build #80 FAILURE
5.1 branch HBase 2.2 build #80 status FAILURE Build #80 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/80/
Apache-Phoenix | 4.x | HBase 1.4 | Build #307 FAILURE
4.x branch HBase 1.4 build #307 status FAILURE Build #307 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/307/
Apache-Phoenix | 4.x | HBase 1.6 | Build #307 SUCCESS
4.x branch HBase 1.6 build #307 status SUCCESS Build #307 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.x/307/
Apache-Phoenix | 4.16 | HBase 1.4 | Build #71 FAILURE
4.16 branch HBase 1.4 build #71 status FAILURE Build #71 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/71/
Apache-Phoenix | master | HBase 2.3 | Build #320 FAILURE
master branch HBase 2.3 build #320 status FAILURE Build #320 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/320/
Apache-Phoenix | 5.1 | HBase 2.3 | Build #80 FAILURE
5.1 branch HBase 2.3 build #80 status FAILURE Build #80 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/80/
Apache-Phoenix | 4.16 | HBase 1.6 | Build #71 FAILURE
4.16 branch HBase 1.6 build #71 status FAILURE Build #71 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/71/
Apache-Phoenix | master | HBase 2.2 | Build #320 FAILURE
master branch HBase 2.2 build #320 status FAILURE Build #320 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/320/
Apache-Phoenix | master | HBase 2.4 | Build #320 FAILURE
master branch HBase 2.4 build #320 status FAILURE Build #320 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/320/
Apache-Phoenix | master | HBase 2.4 | Build #321 FAILURE
master branch HBase 2.4 build #321 status FAILURE Build #321 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/321/
Apache-Phoenix | master | HBase 2.1 | Build #321 FAILURE
master branch HBase 2.1 build #321 status FAILURE Build #321 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/321/
Apache-Phoenix | master | HBase 2.3 | Build #321 FAILURE
master branch HBase 2.3 build #321 status FAILURE Build #321 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/321/
Apache-Phoenix | master | HBase 2.2 | Build #321 FAILURE
master branch HBase 2.2 build #321 status FAILURE Build #321 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/321/