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:35:32 UTC

[phoenix] branch 4.x-HBase-1.3 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.3
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.3 by this push:
     new c537586  PHOENIX-5334 Fix MutableIndexIT.
c537586 is described below

commit c5375866e8d180cb40b5a654bb5e79270a8f30e1
Author: Lars Hofhansl <la...@apache.org>
AuthorDate: Wed Jun 12 12:35:55 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 48243ba..2f4accd 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
@@ -612,6 +612,9 @@ public class MutableIndexIT extends ParallelStatsDisabledIT {
     
     @Test
     public void testAlterTableWithImmutability() throws Exception {
+        if (localIndex)
+            return;
+
         String query;
         ResultSet rs;
         String tableName = "TBL_" + generateUniqueName();
@@ -650,6 +653,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();
@@ -806,8 +812,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");
@@ -828,8 +833,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";
@@ -876,8 +885,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();
@@ -934,7 +947,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')");