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/12/19 09:02:34 UTC

[phoenix] branch 4.x-HBase-1.3 updated: PHOENIX-5616 Speed up ParameterizedIndexUpgradeToolIT.

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 53c0089  PHOENIX-5616 Speed up ParameterizedIndexUpgradeToolIT.
53c0089 is described below

commit 53c0089a29a33124b0a0be4c5315995ace2c70fd
Author: Lars Hofhansl <la...@apache.org>
AuthorDate: Thu Dec 19 01:02:05 2019 -0800

    PHOENIX-5616 Speed up ParameterizedIndexUpgradeToolIT.
---
 .../end2end/ParameterizedIndexUpgradeToolIT.java   | 38 ++++++++++------------
 1 file changed, 17 insertions(+), 21 deletions(-)

diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParameterizedIndexUpgradeToolIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParameterizedIndexUpgradeToolIT.java
index 16f99e3..5a2cef9 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParameterizedIndexUpgradeToolIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ParameterizedIndexUpgradeToolIT.java
@@ -310,44 +310,40 @@ public class ParameterizedIndexUpgradeToolIT extends BaseTest {
     }
 
     @Test
-    public void testToolWithIncorrectTables() throws Exception {
+    public void testDryRunAndFailures() throws Exception {
         validate(true);
+
+        // test with incorrect table
         iut.setInputTables("TEST3.TABLE_NOT_PRESENT");
         iut.prepareToolSetup();
 
         int status = iut.executeTool();
         Assert.assertEquals(-1, status);
         validate(true);
-    }
 
-    @Test
-    public void testToolWithNoIndex() throws Exception {
-        if (!upgrade || isNamespaceEnabled) {
-            return;
-        }
-        conn.createStatement().execute("CREATE TABLE TEST.NEW_TABLE (id bigint NOT NULL "
-                + "PRIMARY KEY, a.name varchar, sal bigint, address varchar)" + tableDDLOptions);
-        iut.setInputTables("TEST.NEW_TABLE");
-        iut.prepareToolSetup();
-        int status = iut.executeTool();
-        Assert.assertEquals(0, status);
-        conn.createStatement().execute("DROP TABLE TEST.NEW_TABLE");
-    }
-
-    @Test
-    public void testToolWithInputFileParameter() throws Exception {
+        // test with input file parameter
         BufferedWriter writer = new BufferedWriter(new FileWriter(new File(INPUT_FILE)));
         writer.write(INPUT_LIST);
         writer.close();
 
-        validate(true);
-
         iut.setInputTables(null);
         iut.setInputFile(INPUT_FILE);
         iut.prepareToolSetup();
-        iut.executeTool();
+        status = iut.executeTool();
+        Assert.assertEquals(0, status);
 
         validate(true);
+
+        // test table without index
+        if (upgrade && !isNamespaceEnabled) {
+            conn.createStatement().execute("CREATE TABLE TEST.NEW_TABLE (id bigint NOT NULL "
+                    + "PRIMARY KEY, a.name varchar, sal bigint, address varchar)" + tableDDLOptions);
+            iut.setInputTables("TEST.NEW_TABLE");
+            iut.prepareToolSetup();
+            status = iut.executeTool();
+            Assert.assertEquals(0, status);
+            conn.createStatement().execute("DROP TABLE TEST.NEW_TABLE");
+        }
     }
 
     @After