Apache-Phoenix | 4.16 | HBase 1.6 | Build #75 FAILURE
4.16 branch HBase 1.6 build #75 status FAILURE Build #75 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/75/
Apache-Phoenix | master | HBase 2.2 | Build #323 FAILURE
master branch HBase 2.2 build #323 status FAILURE Build #323 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/323/
Apache-Phoenix | 5.1 | HBase 2.4 | Build #81 FAILURE
5.1 branch HBase 2.4 build #81 status FAILURE Build #81 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/81/
Apache-Phoenix | 4.16 | HBase 1.4 | Build #74 FAILURE
4.16 branch HBase 1.4 build #74 status FAILURE Build #74 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/74/
Apache-Phoenix | 5.1 | HBase 2.2 | Build #81 FAILURE
5.1 branch HBase 2.2 build #81 status FAILURE Build #81 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/81/
Apache-Phoenix | 5.1 | HBase 2.1 | Build #81 SUCCESS
5.1 branch HBase 2.1 build #81 status SUCCESS Build #81 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/81/
Apache-Phoenix | 4.16 | HBase 1.4 | Build #75 FAILURE
4.16 branch HBase 1.4 build #75 status FAILURE Build #75 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/75/
Apache-Phoenix | master | HBase 2.4 | Build #323 FAILURE
master branch HBase 2.4 build #323 status FAILURE Build #323 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/323/
Apache-Phoenix | 5.1 | HBase 2.3 | Build #81 SUCCESS
5.1 branch HBase 2.3 build #81 status SUCCESS Build #81 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/5.1/81/
Apache-Phoenix | 4.16 | HBase 1.6 | Build #74 FAILURE
4.16 branch HBase 1.6 build #74 status FAILURE Build #74 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/74/
Apache-Phoenix | master | HBase 2.3 | Build #323 FAILURE
master branch HBase 2.3 build #323 status FAILURE Build #323 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/323/
[phoenix-queryserver] annotated tag 6.0.0 updated (7088fc6 -> 1c0c85c)
This is an automated email from the ASF dual-hosted git repository. stoty pushed a change to annotated tag 6.0.0 in repository https://gitbox.apache.org/repos/asf/phoenix-queryserver.git. *** WARNING: tag 6.0.0 was modified! *** from 7088fc6 (commit) to 1c0c85c (tag) tagging 7088fc687b2c315ddd1c3bba8f1555e890d8c384 (commit) replaces python-phoenixdb-1.0.1 by Istvan Toth on Tue Aug 3 07:28:44 2021 +0200 - Log - Phoenix Query Server 6.0.0 release --- No new revisions were added by this update. Summary of changes:
svn commit: r49140 - /dev/phoenix/phoenix-queryserver-6.0.0RC5/ /release/phoenix/phoenix-queryserver-6.0.0/
Author: stoty Date: Tue Aug 3 05:27:34 2021 New Revision: 49140 Log: releasing PQS 6.0.0RC5 as final Added: release/phoenix/phoenix-queryserver-6.0.0/ - copied from r49139, dev/phoenix/phoenix-queryserver-6.0.0RC5/ Removed: dev/phoenix/phoenix-queryserver-6.0.0RC5/
[phoenix-queryserver] branch master updated: bump version to 6.0.1-SNAPSHOT
This is an automated email from the ASF dual-hosted git repository. stoty pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/phoenix-queryserver.git The following commit(s) were added to refs/heads/master by this push: new 19e05cc bump version to 6.0.1-SNAPSHOT 19e05cc is described below commit 19e05cc2a53ada094e1b94b9f1697865ffcff0db Author: Istvan Toth AuthorDate: Tue Aug 3 07:33:28 2021 +0200 bump version to 6.0.1-SNAPSHOT --- phoenix-queryserver-assembly/pom.xml | 2 +- phoenix-queryserver-client/pom.xml| 2 +- phoenix-queryserver-it/pom.xml| 2 +- phoenix-queryserver-load-balancer/pom.xml | 2 +- phoenix-queryserver-orchestrator/pom.xml | 2 +- phoenix-queryserver/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/phoenix-queryserver-assembly/pom.xml b/phoenix-queryserver-assembly/pom.xml index 4391b83..5386dd0 100644 --- a/phoenix-queryserver-assembly/pom.xml +++ b/phoenix-queryserver-assembly/pom.xml @@ -25,7 +25,7 @@ org.apache.phoenix phoenix-queryserver-parent -6.0.0 +6.0.1-SNAPSHOT phoenix-queryserver-assembly diff --git a/phoenix-queryserver-client/pom.xml b/phoenix-queryserver-client/pom.xml index e9de2fb..d501977 100644 --- a/phoenix-queryserver-client/pom.xml +++ b/phoenix-queryserver-client/pom.xml @@ -29,7 +29,7 @@ org.apache.phoenix phoenix-queryserver-parent -6.0.0 +6.0.1-SNAPSHOT phoenix-queryserver-client diff --git a/phoenix-queryserver-it/pom.xml b/phoenix-queryserver-it/pom.xml index 4d53649..1930ee5 100644 --- a/phoenix-queryserver-it/pom.xml +++ b/phoenix-queryserver-it/pom.xml @@ -28,7 +28,7 @@ org.apache.phoenix phoenix-queryserver-parent -6.0.0 +6.0.1-SNAPSHOT phoenix-queryserver-it diff --git a/phoenix-queryserver-load-balancer/pom.xml b/phoenix-queryserver-load-balancer/pom.xml index 52b12d9..44e6ebe 100644 --- a/phoenix-queryserver-load-balancer/pom.xml +++ b/phoenix-queryserver-load-balancer/pom.xml @@ -27,7 +27,7 @@ org.apache.phoenix phoenix-queryserver-parent -6.0.0 +6.0.1-SNAPSHOT phoenix-queryserver-load-balancer Phoenix Query Server Load Balancer diff --git a/phoenix-queryserver-orchestrator/pom.xml b/phoenix-queryserver-orchestrator/pom.xml index 4ad455f..a383550 100644 --- a/phoenix-queryserver-orchestrator/pom.xml +++ b/phoenix-queryserver-orchestrator/pom.xml @@ -28,7 +28,7 @@ phoenix-queryserver-parent org.apache.phoenix -6.0.0 +6.0.1-SNAPSHOT phoenix-queryserver-orchestrator diff --git a/phoenix-queryserver/pom.xml b/phoenix-queryserver/pom.xml index 1ca7807..2fe5455 100644 --- a/phoenix-queryserver/pom.xml +++ b/phoenix-queryserver/pom.xml @@ -28,7 +28,7 @@ org.apache.phoenix phoenix-queryserver-parent -6.0.0 +6.0.1-SNAPSHOT phoenix-queryserver diff --git a/pom.xml b/pom.xml index b577741..7a9d2a4 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ org.apache.phoenix phoenix-queryserver-parent -6.0.0 +6.0.1-SNAPSHOT pom Phoenix Query Server Maven Parent Project
Apache-Phoenix | master | HBase 2.1 | Build #323 FAILURE
master branch HBase 2.1 build #323 status FAILURE Build #323 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/master/323/
Apache-Phoenix | 4.16 | HBase 1.3 | Build #75 FAILURE
4.16 branch HBase 1.3 build #75 status FAILURE Build #75 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/75/
[phoenix] branch 5.1 updated: PHOENIX-6480 Move phoenix-tool and add support with generating default properties (#1245)
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 11d329e PHOENIX-6480 Move phoenix-tool and add support with generating default properties (#1245) 11d329e is described below commit 11d329e9ff13e0570134d101d090ba8dbcd8e61c Author: Gokcen Iskender <47044859+gokc...@users.noreply.github.com> AuthorDate: Tue Jun 15 11:41:07 2021 -0700 PHOENIX-6480 Move phoenix-tool and add support with generating default properties (#1245) Change-Id: I17241f3f93dbdab08be3c151404d19dd6bd78626 --- phoenix-assembly/pom.xml | 24 - .../schema/tool}/SchemaToolExtractionIT.java | 34 ++- .../schema/tool}/SchemaToolSynthesisIT.java| 8 +- .../it/resources/synthesis/alter_add_property.sql | 0 .../resources/synthesis/alter_change_property.sql | 0 .../synthesis/alter_index_add_property.sql | 0 .../synthesis/alter_index_change_property.sql | 0 .../src/it/resources/synthesis/alter_table_add.sql | 0 .../it/resources/synthesis/alter_table_add_pk.sql | 0 .../it/resources/synthesis/alter_table_drop.sql| 0 .../resources/synthesis/alter_table_multiple.sql | 0 .../src/it/resources/synthesis/alter_view_add.sql | 0 .../src/it/resources/synthesis/alter_view_drop.sql | 0 .../src/it/resources/synthesis/create_function.sql | 0 .../it/resources/synthesis/drop_create_table.sql | 0 .../src/it/resources/synthesis/drop_index.sql | 0 .../src/it/resources/synthesis/drop_table.sql | 0 .../resources/synthesis/mismatched_entity_name.sql | 0 .../tool}/SchemaExtractionProcessor.java | 30 -- .../tool}/SchemaProcessor.java | 2 +- .../{schematool => schema/tool}/SchemaSQLUtil.java | 6 +- .../tool}/SchemaSynthesisProcessor.java| 12 +-- .../apache/phoenix/schema/tool}/SchemaTool.java| 5 +- .../java/org/apache/phoenix/util/QueryUtil.java| 4 +- phoenix-tools/pom.xml | 108 - pom.xml| 6 -- 26 files changed, 74 insertions(+), 165 deletions(-) diff --git a/phoenix-assembly/pom.xml b/phoenix-assembly/pom.xml index 0d1123d..4de74a3 100644 --- a/phoenix-assembly/pom.xml +++ b/phoenix-assembly/pom.xml @@ -123,26 +123,6 @@ - -tools without version -compile - - exec - - - ln - ${project.basedir}/../phoenix-tools/target - --fnsv - - phoenix-tools-${project.version}.jar - - - phoenix-tools.jar - - - - @@ -204,10 +184,6 @@ org.apache.phoenix phoenix-tracing-webapp - - org.apache.phoenix - phoenix-tools - com.fasterxml.woodstox diff --git a/phoenix-tools/src/it/java/org/apache/phoenix/schema/SchemaToolExtractionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/schema/tool/SchemaToolExtractionIT.java similarity index 93% rename from phoenix-tools/src/it/java/org/apache/phoenix/schema/SchemaToolExtractionIT.java rename to phoenix-core/src/it/java/org/apache/phoenix/schema/tool/SchemaToolExtractionIT.java index 782352f..0fd1603 100644 --- a/phoenix-tools/src/it/java/org/apache/phoenix/schema/SchemaToolExtractionIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/schema/tool/SchemaToolExtractionIT.java @@ -15,12 +15,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.phoenix.schema; +package org.apache.phoenix.schema.tool; import org.apache.phoenix.end2end.ParallelStatsEnabledIT; import org.apache.phoenix.jdbc.PhoenixConnection; import org.apache.phoenix.parse.ParseException; import org.apache.phoenix.parse.SQLParser; +import org.apache.phoenix.schema.PTable; import org.apache.phoenix.util.PhoenixRuntime; import org.apache.phoenix.util.PropertiesUtil; import org.apache.phoenix.util.ReadOnlyProps; @@ -43,6 +44,8 @@ import java.util.HashSet; import java.util.Arrays; import java.util.Properties; +import static junit.framework.TestCase.assertEquals; +import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES; @@ -105,6 +108,35 @@ public class SchemaToolExtractionIT extends ParallelStatsEnabledIT { } @Test +public void testDDLsWithDefaults() throws Exception { +Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); +String tableName =
[phoenix] branch 4.16 updated: PHOENIX-5543: Implement SHOW TABLES/SCHEMAS sql commands
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 152c157 PHOENIX-5543: Implement SHOW TABLES/SCHEMAS sql commands 152c157 is described below commit 152c157e1bce85dccface13f95586f7e4f51eb6f Author: Bharath Vissapragada AuthorDate: Tue Oct 22 14:14:10 2019 -0700 PHOENIX-5543: Implement SHOW TABLES/SCHEMAS sql commands This patch adds new SQL grammar like following - SHOW SCHEMAS [like ''] - SHOW TABLES [IN ] [like ' schemas = new HashSet<>(); +while (rs.next()) { +schemas.add(rs.getString("TABLE_SCHEM")); +assertEquals(null, rs.getString("TABLE_CATALOG")); +} +assertEquals(2, schemas.size()); +assertTrue(schemas.contains("SYSTEM")); +assertTrue(schemas.contains(schema.toUpperCase())); +// show schemas like 'SYST%' and only SYSTEM should show up. +rs = conn.prepareStatement("show schemas like 'SYST%'").executeQuery(); +assertTrue(rs.next()); +assertEquals("SYSTEM", rs.getString("TABLE_SCHEM")); +assertEquals(null, rs.getString("TABLE_CATALOG")); +assertFalse(rs.next()); +} +} + +@Test +public void testShowTables() throws SQLException { +try (Connection conn = DriverManager.getConnection(getUrl())) { +// List all the tables in a particular schema. +ResultSet rs = conn.prepareStatement("show tables in SYSTEM").executeQuery(); +Set tables = new HashSet<>(); +while (rs.next()) { +tables.add(rs.getString("TABLE_NAME")); +assertEquals("SYSTEM", rs.getString("TABLE_SCHEM")); +} +assertEquals(8, tables.size()); +assertTrue(tables.contains("CATALOG")); +assertTrue(tables.contains("FUNCTION")); + +tables.clear(); +// Add a filter on the table name. +rs = conn.prepareStatement("show tables in SYSTEM like 'FUNC%'").executeQuery(); +while (rs.next()) tables.add(rs.getString("TABLE_NAME")); +assertEquals(1, tables.size()); +assertTrue(tables.contains("FUNCTION")); +} +} + +@Test public void testSchemaMetadataScan() throws SQLException { String table1 = generateUniqueName(); String schema1 = "Z_" + generateUniqueName(); diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java index e147225..86727bd 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TenantSpecificTablesDDLIT.java @@ -35,6 +35,7 @@ import static org.junit.Assert.fail; import java.sql.Connection; import java.sql.DatabaseMetaData; +import java.sql.Driver; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; @@ -432,14 +433,51 @@ public class TenantSpecificTablesDDLIT extends BaseTenantSpecificTablesIT { //Expected } } - + + @Test +public void testShowTablesMultiTenant() throws Exception { +// Each tenant should only be able list tables corresponding to their TENANT_ID +String tenantId2 = "T_" + generateUniqueName(); +String secondTenantConnectionURL = +PHOENIX_JDBC_TENANT_SPECIFIC_URL.replace(TENANT_ID, tenantId2); +String tenantTable2 = "V_" + generateUniqueName(); +createTestTable( +secondTenantConnectionURL, TENANT_TABLE_DDL.replace(TENANT_TABLE_NAME, tenantTable2)); + +Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); +// Non-tenant connections should list all the tables. +try (Connection conn = DriverManager.getConnection(getUrl(), props)) { +Set tables = new HashSet<>(); +ResultSet rs = conn.prepareStatement("show tables").executeQuery(); +while (rs.next()) { + tables.add(rs.getString("TABLE_NAME")); +} +assertTrue(tables.contains(PARENT_TABLE_NAME)); +assertTrue(tables.contains(TENANT_TABLE_NAME)); +assertTrue(tables.contains(tenantTable2)); +} +// Tenant specific connections should not list tables from other tenants. +try (Connection conn = DriverManager.getConnection(secondTenantConnectionURL, props)) { +Set tables = new HashSet<>(); +ResultSet rs = conn.prepareStatement("show tables").executeQuery(); +while (rs.next()) { + tables.add(rs.getString("TABLE_NAME")); +} +
Apache-Phoenix | 4.16 | HBase 1.3 | Build #74 FAILURE
4.16 branch HBase 1.3 build #74 status FAILURE Build #74 https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-mulitbranch/job/4.16/74/
[phoenix] branch 4.16 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 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 59466c7 PHOENIX-6519 Make SchemaTool work with lower case table and column names 59466c7 is described below commit 59466c7d15c96de35b0577f9b8482fe19f3a90f3 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 - .../schema/tool/SchemaToolExtractionIT.java| 72 + .../schema/tool/SchemaExtractionProcessor.java | 62 +++--- .../java/org/apache/phoenix/util/SchemaUtil.java | 73 ++ 4 files changed, 183 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/it/java/org/apache/phoenix/schema/tool/SchemaToolExtractionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/schema/tool/SchemaToolExtractionIT.java index 89bd53a..0fd1603 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/schema/tool/SchemaToolExtractionIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/schema/tool/SchemaToolExtractionIT.java @@ -71,6 +71,19 @@ public class SchemaToolExtractionIT extends ParallelStatsEnabledIT { } @Test +public void testCreateTableStatementLowerCase() throws Exception { +String tableName = "lowecasetbl1"; +String schemaName = "lowecaseschemaname1"; +String pTableFullName = SchemaUtil.getEscapedTableName(schemaName, tableName); +String createTableStmt = "CREATE TABLE "+ pTableFullName + "(\"smallK\" VARCHAR NOT NULL PRIMARY KEY, " ++ "\"asd\".V1 VARCHAR, \"foo\".\"bar\" VARCHAR) TTL=2592000, IMMUTABLE_ROWS=true, DISABLE_WAL=true"; +List queries = new ArrayList(){}; +queries.add(createTableStmt); +String result = runSchemaExtractionTool("\"" + schemaName + "\"", "\"" + tableName + "\"", null, queries); +Assert.assertEquals(createTableStmt, result); +} + +@Test public void testCreateIndexStatement() throws Exception { String tableName = generateUniqueName(); String schemaName = generateUniqueName(); @@ -124,6 +137,42 @@ public class SchemaToolExtractionIT extends ParallelStatsEnabledIT { } @Test +public void testCreateLocalIndexStatement() throws Exception { +String tableName = generateUniqueName(); +String schemaName = generateUniqueName(); +String indexName = generateUniqueName(); +String properties = "TTL=2592000,IMMUTABLE_ROWS=true,DISABLE_WAL=true"; +String pTableFullName = SchemaUtil.getQualifiedTableName(schemaName, tableName); +String createTableStatement = "CREATE TABLE "+pTableFullName + "(k VARCHAR NOT NULL PRIMARY KEY, v1 VARCHAR, v2 VARCHAR)" ++ properties; +String createIndexStatement = "CREATE LOCAL INDEX "+indexName + " ON "+pTableFullName+"(v1 DESC, k) INCLUDE (v2)"; +List queries = new ArrayList(){}; +queries.add(createTableStatement); +queries.add(createIndexStatement); + +String result = runSchemaExtractionTool(schemaName, indexName, null, queries); +Assert.assertEquals(createIndexStatement.toUpperCase(), result.toUpperCase()); +} + +@Test +public void testCreateIndexStatementLowerCase() throws Exception { +String tableName = "lowercase" + generateUniqueName(); +String schemaName = "lowercase" + generateUniqueName(); +String indexName = "\"lowercaseIND" + generateUniqueName() + "\""; +String properties = "TTL=2592000,IMMUTABLE_ROWS=true,DISABLE_WAL=true"; +String pTableFullName = SchemaUtil.getEscapedTableName(schemaName, tableName); +String createTableStatement = "CREATE TABLE " + pTableFullName + "(\"k\" VARCHAR NOT NULL PRIMARY KEY, \"a\".V1 VARCHAR, \"v2\" VARCHAR)" ++ properties; +String createIndexStatement = "CREATE INDEX " + indexName + " ON "+ pTableFullName + "(\"a\".V1 DESC, \"k\") INCLUDE (\"v2\")"; +List queries = new ArrayList(){}; +
[phoenix] branch 4.16 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 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 968d91d PHOENIX-6518 Implement SHOW CREATE TABLE SQL command 968d91d is described below commit 968d91dcbeb03e0255a57245f5835d3c0b53375f 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 | 38 +++ .../phoenix/parse/ShowCreateTableStatement.java| 68 + .../java/org/apache/phoenix/util/QueryUtil.java| 29 ++ .../org/apache/phoenix/parse/QueryParserTest.java | 16 +++ 8 files changed, 297 insertions(+) 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 = conn.createStatement().executeQuery("SHOW CREATE TABLE " + tableFullName); +assertTrue(rs.next()); +assertTrue("Expected: :" + ddl + "\nResult: " + rs.getString(1), +rs.getString(1).contains(ddl)); +} + +@Test +public void testShowCreateTableView() throws Exception { +Properties props = new Properties(); +Connection conn = DriverManager.getConnection(getUrl(), props); +
[phoenix] branch master updated (a4f0304 -> 025a4af)
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 a4f0304 PHOENIX-6506 : Tenant Connection is not able to access/validate Global Sequences (#1261) add 025a4af PHOENIX-6480 Move phoenix-tool and add support with generating default properties (#1245) No new revisions were added by this update. Summary of changes: phoenix-assembly/pom.xml | 24 - .../schema/tool}/SchemaToolExtractionIT.java | 34 ++- .../schema/tool}/SchemaToolSynthesisIT.java| 8 +- .../it/resources/synthesis/alter_add_property.sql | 0 .../resources/synthesis/alter_change_property.sql | 0 .../synthesis/alter_index_add_property.sql | 0 .../synthesis/alter_index_change_property.sql | 0 .../src/it/resources/synthesis/alter_table_add.sql | 0 .../it/resources/synthesis/alter_table_add_pk.sql | 0 .../it/resources/synthesis/alter_table_drop.sql| 0 .../resources/synthesis/alter_table_multiple.sql | 0 .../src/it/resources/synthesis/alter_view_add.sql | 0 .../src/it/resources/synthesis/alter_view_drop.sql | 0 .../src/it/resources/synthesis/create_function.sql | 0 .../it/resources/synthesis/drop_create_table.sql | 0 .../src/it/resources/synthesis/drop_index.sql | 0 .../src/it/resources/synthesis/drop_table.sql | 0 .../resources/synthesis/mismatched_entity_name.sql | 0 .../tool}/SchemaExtractionProcessor.java | 30 -- .../tool}/SchemaProcessor.java | 2 +- .../{schematool => schema/tool}/SchemaSQLUtil.java | 6 +- .../tool}/SchemaSynthesisProcessor.java| 12 +-- .../apache/phoenix/schema/tool}/SchemaTool.java| 5 +- .../java/org/apache/phoenix/util/QueryUtil.java| 4 +- phoenix-tools/pom.xml | 108 - pom.xml| 6 -- 26 files changed, 74 insertions(+), 165 deletions(-) rename {phoenix-tools/src/it/java/org/apache/phoenix/schema => phoenix-core/src/it/java/org/apache/phoenix/schema/tool}/SchemaToolExtractionIT.java (93%) rename {phoenix-tools/src/it/java/org/apache/phoenix/schema => phoenix-core/src/it/java/org/apache/phoenix/schema/tool}/SchemaToolSynthesisIT.java (96%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/alter_add_property.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/alter_change_property.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/alter_index_add_property.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/alter_index_change_property.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/alter_table_add.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/alter_table_add_pk.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/alter_table_drop.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/alter_table_multiple.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/alter_view_add.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/alter_view_drop.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/create_function.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/drop_create_table.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/drop_index.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/drop_table.sql (100%) rename {phoenix-tools => phoenix-core}/src/it/resources/synthesis/mismatched_entity_name.sql (100%) rename phoenix-core/src/main/java/org/apache/phoenix/{schematool => schema/tool}/SchemaExtractionProcessor.java (95%) rename phoenix-core/src/main/java/org/apache/phoenix/{schematool => schema/tool}/SchemaProcessor.java (95%) rename phoenix-core/src/main/java/org/apache/phoenix/{schematool => schema/tool}/SchemaSQLUtil.java (99%) rename phoenix-core/src/main/java/org/apache/phoenix/{schematool => schema/tool}/SchemaSynthesisProcessor.java (98%) rename {phoenix-tools/src/main/java/org/apache/phoenix/schema => phoenix-core/src/main/java/org/apache/phoenix/schema/tool}/SchemaTool.java (96%) delete mode 100644 phoenix-tools/pom.xml