swaroopak commented on a change in pull request #648: Phoenix 5591 Fail 
indextool if split-merge happens during job run
URL: https://github.com/apache/phoenix/pull/648#discussion_r356225120
 
 

 ##########
 File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolIT.java
 ##########
 @@ -633,6 +635,66 @@ public void testSplitIndex() throws Exception {
         }
     }
 
+    /**
+     * Test that index tool fails when data table splits
+     */
+    @Test
+    public void testDataTableSplit() throws Exception {
+        if (localIndex) return; // can't split local indexes
+        if (!mutable) return;
+        if (transactional) return;
+        String schemaName = generateUniqueName();
+        String dataTableName = generateUniqueName();
+        String dataTableFullName = SchemaUtil.getTableName(schemaName, 
dataTableName);
+        final TableName dataTN = TableName.valueOf(dataTableFullName);
+        String indexTableName = generateUniqueName();
+        String indexTableFullName = SchemaUtil.getTableName(schemaName, 
indexTableName);
+        TableName indexTN = TableName.valueOf(indexTableFullName);
+        try (Connection conn =
+                DriverManager.getConnection(getUrl(), 
PropertiesUtil.deepCopy(TEST_PROPERTIES));
+                Admin admin = 
conn.unwrap(PhoenixConnection.class).getQueryServices().getAdmin()) {
+            String dataDDL =
+                    "CREATE TABLE " + dataTableFullName + "(\n"
+                            + "ID VARCHAR NOT NULL PRIMARY KEY,\n"
+                            + "\"info\".CAR_NUM VARCHAR(18) NULL,\n"
+                            + "\"test\".CAR_NUM VARCHAR(18) NULL,\n"
+                            + "\"info\".CAP_DATE VARCHAR NULL,\n" + 
"\"info\".ORG_ID BIGINT NULL,\n"
+                            + "\"info\".ORG_NAME VARCHAR(255) NULL\n" + ") 
COLUMN_ENCODED_BYTES = 0 SPLIT ON(1,2,3)";
+            conn.createStatement().execute(dataDDL);
+
+            //String[] carNumPrefixes = new String[] {"a", "b", "c", "d"};
 
 Review comment:
   nit: remove the commented code.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to