You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2019/12/13 18:26:30 UTC

[GitHub] [phoenix] gjacoby126 commented on a change in pull request #653: PHOENIX-5618 IndexScrutinyTool fix for array type columns

gjacoby126 commented on a change in pull request #653: PHOENIX-5618 IndexScrutinyTool fix for array type columns
URL: https://github.com/apache/phoenix/pull/653#discussion_r357772627
 
 

 ##########
 File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexScrutinyToolIT.java
 ##########
 @@ -161,6 +162,54 @@ public IndexScrutinyToolIT(String dataTableDdl, String indexTableDdl) {
         assertEquals(numIndexRows, countRows(conn, indexTableFullName));
     }
 
+    @Test public void testScrutinyOnArrayTypes() throws Exception {
+        String dataTableName = generateUniqueName();
+        String indexTableName = generateUniqueName();
+        String dataTableDDL = "CREATE TABLE %s (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR, VB VARBINARY)";
+        String indexTableDDL = "CREATE INDEX %s ON %s (NAME) INCLUDE (VB)";
+        String upsertData = "UPSERT INTO %s VALUES (?, ?, ?)";
+        String upsertIndex = "UPSERT INTO %s (\"0:NAME\", \":ID\", \"0:VB\") values (?,?,?)";
+
+        try (Connection conn =
+                DriverManager.getConnection(getUrl(), PropertiesUtil.deepCopy(TEST_PROPERTIES))) {
+            conn.createStatement().execute(String.format(dataTableDDL, dataTableName));
+            conn.createStatement().execute(String.format(indexTableDDL, indexTableName, dataTableName));
+            // insert two rows
+            PreparedStatement upsertDataStmt = conn.prepareStatement(String.format(upsertData, dataTableName));
+            upsertRow(upsertDataStmt, 1, "name-1", new byte[] {127, 0, 0, 1});
+            upsertRow(upsertDataStmt, 2, "name-2", new byte[] {127, 1, 0, 5});
+            conn.commit();
+
+            List<Job> completedJobs = runScrutiny(null, dataTableName, indexTableName);
+            Job job = completedJobs.get(0);
+            assertTrue(job.isSuccessful());
+            Counters counters = job.getCounters();
+            assertEquals(2, getCounterValue(counters, VALID_ROW_COUNT));
+            assertEquals(0, getCounterValue(counters, INVALID_ROW_COUNT));
+
+            // Now insert a different varbinary row
+//            conn.createStatement().execute(
+//                    String.format("ALTER INDEX %s ON %S disable", indexTableName, dataTableName));
 
 Review comment:
   Please remove commented out 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:
users@infra.apache.org


With regards,
Apache Git Services