phoenix git commit: Update CHANGED
Repository: phoenix Updated Branches: refs/heads/4.0 2aa8a862f -> 221ff6bb9 Update CHANGED Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/221ff6bb Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/221ff6bb Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/221ff6bb Branch: refs/heads/4.0 Commit: 221ff6bb955b2ff10a5806e9144f47dc42c72e5c Parents: 2aa8a86 Author: Mujtaba Authored: Tue Feb 17 23:58:14 2015 -0800 Committer: Mujtaba Committed: Tue Feb 17 23:58:14 2015 -0800 -- CHANGES | 5 + 1 file changed, 5 insertions(+) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/221ff6bb/CHANGES -- diff --git a/CHANGES b/CHANGES index c858fb5..0476f8a 100644 --- a/CHANGES +++ b/CHANGES @@ -108,6 +108,7 @@ Release Notes - Phoenix - Version 4.3 * [PHOENIX-1576] - Refactor property-related code to reside in ConnectionQueryServicesImpl * [PHOENIX-1581] - Client cache not updated after issuing ALTER TABLE statements for setting phoenix table properties * [PHOENIX-1587] - Error deserializing empty array (which represents null) +* [PHOENIX-1588] - TableNotFoundException when optimizing "SELECT * FROM a tenant-specific table" * [PHOENIX-1591] - Return all rows instead of no rows if IN clause subquery gets optimized out from semi-join and returns empty result * [PHOENIX-1596] - Turning tracing on causes region servers to crash * [PHOENIX-1600] - Scanner is left unclosed in MetaDataEndpointImpl#doDropTable() @@ -119,6 +120,7 @@ Release Notes - Phoenix - Version 4.3 * [PHOENIX-1613] - Phoenix can't be used directly with SquirrelSQL * [PHOENIX-1616] - Creating a View with a case sensitive column name does not work * [PHOENIX-1620] - Add API for getting tenant ID from an HBase row of a Phoenix table +* [PHOENIX-1634] - LocalIndexSplitter prevents region from auto split * [PHOENIX-1641] - Make the upgrade for SYSTEM.CATALOG and SYSTEM.SEQUENCE work for 4.x to 4.3 * [PHOENIX-1643] - Ensure index usage is backward compatible for 4.2 client against 4.3 server * [PHOENIX-1644] - Check for min HBase version before creating local index and provide means of disabling usage @@ -126,6 +128,9 @@ Release Notes - Phoenix - Version 4.3 * [PHOENIX-1646] - Views and functional index expressions may lose information when stringified * [PHOENIX-1649] - Remove System.out/System.err debugging messages * [PHOENIX-1650] - Possible resource leak in upsert select query +* [PHOENIX-1654] - Incorrect group-by keys from ClientAggregatePlan +* [PHOENIX-1667] - Update sqlline to 1.1.8 +* [PHOENIX-1669] - Views are not always properly updated with physical table indexes when cached ** Test * [PHOENIX-1509] - Investigate changing default encoding to PREFIX_encoding instead of FAST_DIFF
Apache-Phoenix | 3.0 | Hadoop1 | Build Successful
3.0 branch build status Successful Source repository https://git-wip-us.apache.org/repos/asf/phoenix.git Last Successful Compiled Artifacts https://builds.apache.org/job/Phoenix-3.0-hadoop1/lastSuccessfulBuild/artifact/ Last Complete Test Report https://builds.apache.org/job/Phoenix-3.0-hadoop1/lastCompletedBuild/testReport/ Changes [jtaylor] PHOENIX-1669 Views are not always properly updated with physical table indexes when cached Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout
phoenix git commit: PHOENIX-1669 Views are not always properly updated with physical table indexes when cached
Repository: phoenix Updated Branches: refs/heads/3.0 3a763e2f9 -> 7bcad4e43 PHOENIX-1669 Views are not always properly updated with physical table indexes when cached Conflicts: phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/7bcad4e4 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/7bcad4e4 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/7bcad4e4 Branch: refs/heads/3.0 Commit: 7bcad4e43086a16fbbc646e72a6304b485bd5cec Parents: 3a763e2 Author: James Taylor Authored: Tue Feb 17 19:37:02 2015 -0800 Committer: James Taylor Committed: Tue Feb 17 19:47:01 2015 -0800 -- .../apache/phoenix/schema/MetaDataClient.java | 42 .../org/apache/phoenix/schema/PTableImpl.java | 2 +- 2 files changed, 27 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/7bcad4e4/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java index 4362087..292a6a8 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java @@ -349,8 +349,7 @@ public class MetaDataClient { // Otherwise, a tenant would be required to create a VIEW first // which is not really necessary unless you want to filter or add // columns -addIndexesFromPhysicalTable(result); -connection.addTable(result.getTable()); +addTableToCache(result); return result; } else { // if (result.getMutationCode() == MutationCode.NEWER_TABLE_FOUND) { @@ -358,16 +357,20 @@ public class MetaDataClient { // Since we disallow creation or modification of a table earlier than the latest // timestamp, we can handle this such that we don't ask the // server again. -// If table was not found at the current time stamp and we have one cached, remove it. -// Otherwise, we're up to date, so there's nothing to do. if (table != null) { +// Ensures that table in result is set to table found in our cache. result.setTable(table); if (code == MutationCode.TABLE_ALREADY_EXISTS) { +// Although this table is up-to-date, the parent table may not be. +// In this case, we update the parent table which may in turn pull +// in indexes to add to this table. if (addIndexesFromPhysicalTable(result)) { connection.addTable(result.getTable()); } return result; } +// If table was not found at the current time stamp and we have one cached, remove it. +// Otherwise, we're up to date, so there's nothing to do. if (code == MutationCode.TABLE_NOT_FOUND && tryCount + 1 == maxTryCount) { connection.removeTable(tenantId, fullTableName, table.getParentName() == null ? null : table.getParentName().getString(), table.getTimeStamp()); } @@ -1449,7 +1452,7 @@ public class MetaDataClient { MutationCode code = result.getMutationCode(); switch(code) { case TABLE_ALREADY_EXISTS: -connection.addTable(result.getTable()); +addTableToCache(result); if (!statement.ifNotExists()) { throw new TableAlreadyExistsException(schemaName, tableName, result.getTable()); } @@ -1464,7 +1467,7 @@ public class MetaDataClient { throw new SQLExceptionInfo.Builder(SQLExceptionCode.CANNOT_MUTATE_TABLE) .setSchemaName(schemaName).setTableName(tableName).build().buildException(); case CONCURRENT_TABLE_MUTATION: -connection.addTable(result.getTable()); +addTableToCache(result); throw new ConcurrentTableMutationException(schemaName, tableName); default: PName newSchemaName = PNameFactory.newName(schemaName); @@
Apache-Phoenix | Master | Build Successful
Master branch build status Successful Source repository https://git-wip-us.apache.org/repos/asf/phoenix.git Last Successful Compiled Artifacts https://builds.apache.org/job/Phoenix-master/lastSuccessfulBuild/artifact/ Last Complete Test Report https://builds.apache.org/job/Phoenix-master/lastCompletedBuild/testReport/ Changes [jtaylor] PHOENIX-1669 Views are not always properly updated with physical table indexes when cached Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout
Apache-Phoenix | 4.0 | Build Successful
4.0 branch build status Successful Source repository https://git-wip-us.apache.org/repos/asf/incubator-phoenix.git Compiled Artifacts https://builds.apache.org/job/Phoenix-4.0/lastSuccessfulBuild/artifact/ Test Report https://builds.apache.org/job/Phoenix-4.0/lastCompletedBuild/testReport/ Changes [jtaylor] PHOENIX-1669 Views are not always properly updated with physical table indexes when cached Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout
phoenix git commit: PHOENIX-1669 Views are not always properly updated with physical table indexes when cached
Repository: phoenix Updated Branches: refs/heads/4.0 0accd047b -> 2aa8a862f PHOENIX-1669 Views are not always properly updated with physical table indexes when cached Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/2aa8a862 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/2aa8a862 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/2aa8a862 Branch: refs/heads/4.0 Commit: 2aa8a862f3f5a54d8c2b8cf57c24512c15b9eb90 Parents: 0accd04 Author: James Taylor Authored: Tue Feb 17 19:37:02 2015 -0800 Committer: James Taylor Committed: Tue Feb 17 19:38:23 2015 -0800 -- .../end2end/index/IndexExpressionIT.java| 3 -- .../apache/phoenix/schema/MetaDataClient.java | 39 .../org/apache/phoenix/schema/PTableImpl.java | 2 +- 3 files changed, 24 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/2aa8a862/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java index 5c51bda..1e3733b 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java @@ -1220,8 +1220,6 @@ public class IndexExpressionIT extends BaseHBaseManagedTimeIT { assertEquals(1, rs.getLong(1)); assertFalse(rs.next()); -conn.createStatement().execute("CREATE INDEX vi1 on v(k2)"); - //i2 should be used since it contains s3||'_'||s4 i String query = "SELECT s2||'_'||s3 FROM v WHERE k2=1 AND (s2||'_'||s3)='abc_cab'"; rs = conn.createStatement( ).executeQuery("EXPLAIN " + query); @@ -1235,7 +1233,6 @@ public class IndexExpressionIT extends BaseHBaseManagedTimeIT { assertFalse(rs.next()); conn.createStatement().execute("ALTER VIEW v DROP COLUMN s4"); -conn.createStatement().execute("CREATE INDEX vi2 on v(k2)"); //i2 cannot be used since s4 has been dropped from the view, so i1 will be used rs = conn.createStatement().executeQuery("EXPLAIN " + query); queryPlan = QueryUtil.getExplainPlan(rs); http://git-wip-us.apache.org/repos/asf/phoenix/blob/2aa8a862/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java index 64e62f5..831616b 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java @@ -360,8 +360,7 @@ public class MetaDataClient { // Otherwise, a tenant would be required to create a VIEW first // which is not really necessary unless you want to filter or add // columns -addIndexesFromPhysicalTable(result); -connection.addTable(result.getTable()); +addTableToCache(result); return result; } else { // if (result.getMutationCode() == MutationCode.NEWER_TABLE_FOUND) { @@ -369,16 +368,20 @@ public class MetaDataClient { // Since we disallow creation or modification of a table earlier than the latest // timestamp, we can handle this such that we don't ask the // server again. -// If table was not found at the current time stamp and we have one cached, remove it. -// Otherwise, we're up to date, so there's nothing to do. if (table != null) { +// Ensures that table in result is set to table found in our cache. result.setTable(table); if (code == MutationCode.TABLE_ALREADY_EXISTS) { +// Although this table is up-to-date, the parent table may not be. +// In this case, we update the parent table which may in turn pull +// in indexes to add to this table. if (addIndexesFromPhysicalTable(result)) { connection.addTable(result.getTable()); } return result; } +// If table was not found at the current time stamp and we have one cached, remove it. +// Otherwise, we
phoenix git commit: PHOENIX-1669 Views are not always properly updated with physical table indexes when cached
Repository: phoenix Updated Branches: refs/heads/master 2e5a63089 -> c633151da PHOENIX-1669 Views are not always properly updated with physical table indexes when cached Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/c633151d Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/c633151d Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/c633151d Branch: refs/heads/master Commit: c633151dafcaf703c8daa5f92dbaddd7eeb89891 Parents: 2e5a630 Author: James Taylor Authored: Tue Feb 17 19:37:02 2015 -0800 Committer: James Taylor Committed: Tue Feb 17 19:37:02 2015 -0800 -- .../end2end/index/IndexExpressionIT.java| 3 -- .../apache/phoenix/schema/MetaDataClient.java | 39 .../org/apache/phoenix/schema/PTableImpl.java | 2 +- 3 files changed, 24 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/c633151d/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java index 5c51bda..1e3733b 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java @@ -1220,8 +1220,6 @@ public class IndexExpressionIT extends BaseHBaseManagedTimeIT { assertEquals(1, rs.getLong(1)); assertFalse(rs.next()); -conn.createStatement().execute("CREATE INDEX vi1 on v(k2)"); - //i2 should be used since it contains s3||'_'||s4 i String query = "SELECT s2||'_'||s3 FROM v WHERE k2=1 AND (s2||'_'||s3)='abc_cab'"; rs = conn.createStatement( ).executeQuery("EXPLAIN " + query); @@ -1235,7 +1233,6 @@ public class IndexExpressionIT extends BaseHBaseManagedTimeIT { assertFalse(rs.next()); conn.createStatement().execute("ALTER VIEW v DROP COLUMN s4"); -conn.createStatement().execute("CREATE INDEX vi2 on v(k2)"); //i2 cannot be used since s4 has been dropped from the view, so i1 will be used rs = conn.createStatement().executeQuery("EXPLAIN " + query); queryPlan = QueryUtil.getExplainPlan(rs); http://git-wip-us.apache.org/repos/asf/phoenix/blob/c633151d/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java -- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java index 64e62f5..831616b 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java @@ -360,8 +360,7 @@ public class MetaDataClient { // Otherwise, a tenant would be required to create a VIEW first // which is not really necessary unless you want to filter or add // columns -addIndexesFromPhysicalTable(result); -connection.addTable(result.getTable()); +addTableToCache(result); return result; } else { // if (result.getMutationCode() == MutationCode.NEWER_TABLE_FOUND) { @@ -369,16 +368,20 @@ public class MetaDataClient { // Since we disallow creation or modification of a table earlier than the latest // timestamp, we can handle this such that we don't ask the // server again. -// If table was not found at the current time stamp and we have one cached, remove it. -// Otherwise, we're up to date, so there's nothing to do. if (table != null) { +// Ensures that table in result is set to table found in our cache. result.setTable(table); if (code == MutationCode.TABLE_ALREADY_EXISTS) { +// Although this table is up-to-date, the parent table may not be. +// In this case, we update the parent table which may in turn pull +// in indexes to add to this table. if (addIndexesFromPhysicalTable(result)) { connection.addTable(result.getTable()); } return result; } +// If table was not found at the current time stamp and we have one cached, remove it. +// Otherwi
Apache-Phoenix | 4.0 | Build Successful
4.0 branch build status Successful Source repository https://git-wip-us.apache.org/repos/asf/incubator-phoenix.git Compiled Artifacts https://builds.apache.org/job/Phoenix-4.0/lastSuccessfulBuild/artifact/ Test Report https://builds.apache.org/job/Phoenix-4.0/lastCompletedBuild/testReport/ Changes [twdsilva] PHOENIX-1639 Enhance function/_expression_ index tests Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout
Apache-Phoenix | Master | Build Successful
Master branch build status Successful Source repository https://git-wip-us.apache.org/repos/asf/phoenix.git Last Successful Compiled Artifacts https://builds.apache.org/job/Phoenix-master/lastSuccessfulBuild/artifact/ Last Complete Test Report https://builds.apache.org/job/Phoenix-master/lastCompletedBuild/testReport/ Changes [twdsilva] PHOENIX-1639 Enhance function/_expression_ index tests Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout
phoenix git commit: PHOENIX-1639 Enhance function/expression index tests
Repository: phoenix Updated Branches: refs/heads/4.0 8d3f59578 -> 0accd047b PHOENIX-1639 Enhance function/expression index tests Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/0accd047 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/0accd047 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/0accd047 Branch: refs/heads/4.0 Commit: 0accd047bebd89f115b9463a0ee9af95731e3f2a Parents: 8d3f595 Author: Thomas D'Silva Authored: Tue Feb 17 12:35:53 2015 -0800 Committer: Thomas D'Silva Committed: Tue Feb 17 12:35:53 2015 -0800 -- .../apache/phoenix/end2end/AlterTableIT.java| 58 +- .../org/apache/phoenix/end2end/BaseViewIT.java | 4 +- .../java/org/apache/phoenix/end2end/ViewIT.java | 5 + .../end2end/index/IndexExpressionIT.java| 714 +++ .../coprocessor/MetaDataEndpointImpl.java | 5 +- .../phoenix/exception/SQLExceptionCode.java | 5 +- .../apache/phoenix/index/IndexMaintainer.java | 4 +- .../apache/phoenix/schema/MetaDataClient.java | 33 +- .../phoenix/compile/QueryCompilerTest.java | 72 ++ 9 files changed, 715 insertions(+), 185 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/0accd047/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java index 7f5649b..59698d6 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java @@ -308,7 +308,6 @@ public class AlterTableIT extends BaseOwnClusterHBaseManagedTimeIT { @Test public void testDropCoveredColumn() throws Exception { -String query; ResultSet rs; PreparedStatement stmt; @@ -320,19 +319,21 @@ public class AlterTableIT extends BaseOwnClusterHBaseManagedTimeIT { conn.createStatement().execute( "CREATE TABLE " + DATA_TABLE_FULL_NAME + " (k VARCHAR NOT NULL PRIMARY KEY, v1 VARCHAR, v2 VARCHAR, v3 VARCHAR)"); -query = "SELECT * FROM " + DATA_TABLE_FULL_NAME; -rs = conn.createStatement().executeQuery(query); +String dataTableQuery = "SELECT * FROM " + DATA_TABLE_FULL_NAME; +rs = conn.createStatement().executeQuery(dataTableQuery); assertFalse(rs.next()); conn.createStatement().execute( "CREATE INDEX " + INDEX_TABLE_NAME + " ON " + DATA_TABLE_FULL_NAME + " (v1) include (v2, v3)"); conn.createStatement().execute( "CREATE LOCAL INDEX " + LOCAL_INDEX_TABLE_NAME + " ON " + DATA_TABLE_FULL_NAME + " (v1) include (v2, v3)"); -query = "SELECT * FROM " + INDEX_TABLE_FULL_NAME; -rs = conn.createStatement().executeQuery(query); +rs = conn.createStatement().executeQuery(dataTableQuery); assertFalse(rs.next()); -query = "SELECT * FROM " + LOCAL_INDEX_TABLE_FULL_NAME; -rs = conn.createStatement().executeQuery(query); +String indexTableQuery = "SELECT * FROM " + INDEX_TABLE_NAME; +rs = conn.createStatement().executeQuery(indexTableQuery); +assertFalse(rs.next()); +String localIndexTableQuery = "SELECT * FROM " + LOCAL_INDEX_TABLE_FULL_NAME; +rs = conn.createStatement().executeQuery(localIndexTableQuery); assertFalse(rs.next()); // load some data into the table @@ -346,16 +347,31 @@ public class AlterTableIT extends BaseOwnClusterHBaseManagedTimeIT { assertIndexExists(conn,true); conn.createStatement().execute("ALTER TABLE " + DATA_TABLE_FULL_NAME + " DROP COLUMN v2"); -// TODO: verify meta data that we get back to confirm our column was dropped assertIndexExists(conn,true); -query = "SELECT * FROM " + DATA_TABLE_FULL_NAME; -rs = conn.createStatement().executeQuery(query); +// verify data table rows +rs = conn.createStatement().executeQuery(dataTableQuery); assertTrue(rs.next()); assertEquals("a",rs.getString(1)); assertEquals("x",rs.getString(2)); assertEquals("j",rs.getString(3)); assertFalse(rs.next()); + +// verify index table rows +rs = conn.createStatement().executeQuery(indexTableQuery); +assertTrue(rs.next()); +assertEquals("x",rs.getString(1)); +assertEquals("a",rs.getString(2)); +assertEquals("j",rs.getString(3)); +assertFalse(rs.next()); + +// verify local index table rows +rs = conn.createStatement().executeQuery(localIndexTableQuery); +a
phoenix git commit: PHOENIX-1639 Enhance function/expression index tests
Repository: phoenix Updated Branches: refs/heads/master b8c0559c0 -> 2e5a63089 PHOENIX-1639 Enhance function/expression index tests Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/2e5a6308 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/2e5a6308 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/2e5a6308 Branch: refs/heads/master Commit: 2e5a63089f98c21e8556fae0ec80988079e3ca55 Parents: b8c0559 Author: Thomas D'Silva Authored: Tue Feb 17 12:32:55 2015 -0800 Committer: Thomas D'Silva Committed: Tue Feb 17 12:32:55 2015 -0800 -- .../apache/phoenix/end2end/AlterTableIT.java| 58 +- .../org/apache/phoenix/end2end/BaseViewIT.java | 4 +- .../java/org/apache/phoenix/end2end/ViewIT.java | 5 + .../end2end/index/IndexExpressionIT.java| 714 +++ .../coprocessor/MetaDataEndpointImpl.java | 5 +- .../phoenix/exception/SQLExceptionCode.java | 5 +- .../apache/phoenix/index/IndexMaintainer.java | 4 +- .../apache/phoenix/schema/MetaDataClient.java | 33 +- .../phoenix/compile/QueryCompilerTest.java | 72 ++ 9 files changed, 715 insertions(+), 185 deletions(-) -- http://git-wip-us.apache.org/repos/asf/phoenix/blob/2e5a6308/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java -- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java index 7f5649b..59698d6 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java @@ -308,7 +308,6 @@ public class AlterTableIT extends BaseOwnClusterHBaseManagedTimeIT { @Test public void testDropCoveredColumn() throws Exception { -String query; ResultSet rs; PreparedStatement stmt; @@ -320,19 +319,21 @@ public class AlterTableIT extends BaseOwnClusterHBaseManagedTimeIT { conn.createStatement().execute( "CREATE TABLE " + DATA_TABLE_FULL_NAME + " (k VARCHAR NOT NULL PRIMARY KEY, v1 VARCHAR, v2 VARCHAR, v3 VARCHAR)"); -query = "SELECT * FROM " + DATA_TABLE_FULL_NAME; -rs = conn.createStatement().executeQuery(query); +String dataTableQuery = "SELECT * FROM " + DATA_TABLE_FULL_NAME; +rs = conn.createStatement().executeQuery(dataTableQuery); assertFalse(rs.next()); conn.createStatement().execute( "CREATE INDEX " + INDEX_TABLE_NAME + " ON " + DATA_TABLE_FULL_NAME + " (v1) include (v2, v3)"); conn.createStatement().execute( "CREATE LOCAL INDEX " + LOCAL_INDEX_TABLE_NAME + " ON " + DATA_TABLE_FULL_NAME + " (v1) include (v2, v3)"); -query = "SELECT * FROM " + INDEX_TABLE_FULL_NAME; -rs = conn.createStatement().executeQuery(query); +rs = conn.createStatement().executeQuery(dataTableQuery); assertFalse(rs.next()); -query = "SELECT * FROM " + LOCAL_INDEX_TABLE_FULL_NAME; -rs = conn.createStatement().executeQuery(query); +String indexTableQuery = "SELECT * FROM " + INDEX_TABLE_NAME; +rs = conn.createStatement().executeQuery(indexTableQuery); +assertFalse(rs.next()); +String localIndexTableQuery = "SELECT * FROM " + LOCAL_INDEX_TABLE_FULL_NAME; +rs = conn.createStatement().executeQuery(localIndexTableQuery); assertFalse(rs.next()); // load some data into the table @@ -346,16 +347,31 @@ public class AlterTableIT extends BaseOwnClusterHBaseManagedTimeIT { assertIndexExists(conn,true); conn.createStatement().execute("ALTER TABLE " + DATA_TABLE_FULL_NAME + " DROP COLUMN v2"); -// TODO: verify meta data that we get back to confirm our column was dropped assertIndexExists(conn,true); -query = "SELECT * FROM " + DATA_TABLE_FULL_NAME; -rs = conn.createStatement().executeQuery(query); +// verify data table rows +rs = conn.createStatement().executeQuery(dataTableQuery); assertTrue(rs.next()); assertEquals("a",rs.getString(1)); assertEquals("x",rs.getString(2)); assertEquals("j",rs.getString(3)); assertFalse(rs.next()); + +// verify index table rows +rs = conn.createStatement().executeQuery(indexTableQuery); +assertTrue(rs.next()); +assertEquals("x",rs.getString(1)); +assertEquals("a",rs.getString(2)); +assertEquals("j",rs.getString(3)); +assertFalse(rs.next()); + +// verify local index table rows +rs = conn.createStatement().executeQuery(localIndexTableQuery); +