You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by la...@apache.org on 2019/06/12 19:36:24 UTC
[phoenix] branch 4.x-HBase-1.4 updated: PHOENIX-5334 Fix
MutableIndexIT.
This is an automated email from the ASF dual-hosted git repository.
larsh pushed a commit to branch 4.x-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x-HBase-1.4 by this push:
new c0f7dd6 PHOENIX-5334 Fix MutableIndexIT.
c0f7dd6 is described below
commit c0f7dd6ff89266d45293d9ea2bd1074857bc0799
Author: Lars Hofhansl <la...@apache.org>
AuthorDate: Wed Jun 12 12:36:45 2019 -0700
PHOENIX-5334 Fix MutableIndexIT.
---
.../apache/phoenix/end2end/index/MutableIndexIT.java | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
index 388ed08..8e11af6 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
@@ -613,6 +613,9 @@ public class MutableIndexIT extends ParallelStatsDisabledIT {
@Test
public void testAlterTableWithImmutability() throws Exception {
+ if (localIndex)
+ return;
+
String query;
ResultSet rs;
String tableName = "TBL_" + generateUniqueName();
@@ -651,6 +654,9 @@ public class MutableIndexIT extends ParallelStatsDisabledIT {
@Test
public void testIndexHalfStoreFileReader() throws Exception {
+ if (!localIndex)
+ return;
+
Connection conn1 = getConnection();
ConnectionQueryServices connectionQueryServices = driver.getConnectionQueryServices(getUrl(), TestUtil.TEST_PROPERTIES);
HBaseAdmin admin = connectionQueryServices.getAdmin();
@@ -807,8 +813,7 @@ public class MutableIndexIT extends ParallelStatsDisabledIT {
"CONSTRAINT PK_CONSTRAINT PRIMARY KEY (TENANT_ID, ENTITY_ID)) MULTI_TENANT=TRUE "
+ (!tableDDLOptions.isEmpty() ? "," + tableDDLOptions : "") );
// create index
- conn.createStatement().execute("CREATE INDEX IF NOT EXISTS " + indexName + " ON " + fullTableName + " (ENTITY_ID, TYPE)");
-
+ conn.createStatement().execute("CREATE " + (localIndex ? " LOCAL " : "") + " INDEX IF NOT EXISTS " + indexName + " ON " + fullTableName + " (ENTITY_ID, TYPE)");
// upsert rows
String dml = "UPSERT INTO " + fullTableName + " (ENTITY_ID, TYPE) VALUES ( ?, ?)";
props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, "tenant1");
@@ -829,8 +834,12 @@ public class MutableIndexIT extends ParallelStatsDisabledIT {
// Tests that if major compaction is run on a table with a disabled index,
// deleted cells are kept
+ // TODO: Move to a different test class?
@Test
public void testCompactDisabledIndex() throws Exception {
+ if (localIndex || tableDDLOptions.contains("TRANSACTIONAL=true"))
+ return;
+
try (Connection conn = getConnection()) {
String schemaName = generateUniqueName();
String dataTableName = generateUniqueName() + "_DATA";
@@ -877,8 +886,12 @@ public class MutableIndexIT extends ParallelStatsDisabledIT {
// some tables (e.g. indexes on views) have UngroupedAgg coproc loaded, but don't have a
// corresponding row in syscat. This tests that compaction isn't blocked
+ // TODO: Move to a different test class?
@Test(timeout=120000)
public void testCompactNonPhoenixTable() throws Exception {
+ if (localIndex || tableDDLOptions.contains("TRANSACTIONAL=true"))
+ return;
+
try (Connection conn = getConnection()) {
// create a vanilla HBase table (non-Phoenix)
String randomTable = generateUniqueName();
@@ -935,7 +948,7 @@ public class MutableIndexIT extends ParallelStatsDisabledIT {
+ (multiCf ? columnFamily1 : "") + "f float, "
+ (multiCf ? columnFamily2 : "") + "s varchar)" + tableDDLOptions);
conn.createStatement().execute(
- "create index " + indexName + " on " + fullTableName + " ("
+ "create " + (localIndex ? "LOCAL" : "") + " index " + indexName + " on " + fullTableName + " ("
+ (multiCf ? columnFamily1 : "") + "f) include ("+(multiCf ? columnFamily2 : "") +"s)");
conn.createStatement().execute(
"upsert into " + fullTableName + " values (1, 0.5, 'foo')");