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/10/25 18:48:51 UTC

[GitHub] [phoenix] gokceni commented on a change in pull request #608: PHOENIX-5539 Full row index write at the last write phase for mutable…

gokceni commented on a change in pull request #608: PHOENIX-5539 Full row index write at the last write phase for mutable…
URL: https://github.com/apache/phoenix/pull/608#discussion_r339191619
 
 

 ##########
 File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexCheckerIT.java
 ##########
 @@ -257,6 +266,44 @@ public void testFailPostIndexRowUpdate() throws Exception {
         }
     }
 
+    @Test
+    public void testUnverifiedRowIncludesOnlyEmptyCell() throws Exception {
+        String dataTableName = generateUniqueName();
+        try (Connection conn = DriverManager.getConnection(getUrl())) {
+            conn.createStatement().execute("create table " + dataTableName +
+                    " (id varchar(10) not null primary key, val1 varchar(10), val2 varchar(10), val3 varchar(10))" + tableDDLOptions);
+            String indexTableName = generateUniqueName();
+            conn.createStatement().execute("CREATE INDEX " + indexTableName + " on " +
+                    dataTableName + " (val1) include (val2, val3)");
+            // Configure IndexRegionObserver to fail the last write phase (i.e., the post index update phase)
+            IndexRegionObserver.setFailPostIndexUpdatesForTesting(true);
+            conn.createStatement().execute("upsert into " + dataTableName + " (id, val2) values ('a', 'abcc')");
+            conn.commit();
+            IndexRegionObserver.setFailPostIndexUpdatesForTesting(false);
+            Table hIndexTable = conn.unwrap(PhoenixConnection.class).getQueryServices()
+                    .getTable(Bytes.toBytes(indexTableName));
+            long indexCnt = TestUtil.getRowCount(hIndexTable, false);
+            assertEquals(1, indexCnt);
+            assertEquals(true, verifyRowsForEmptyColValue(conn, indexTableName, IndexRegionObserver.UNVERIFIED_BYTES));
+            // check that in the first phase we don't send the full row.
+            // We count the num of cells for this
+            Scan s = new Scan();
 
 Review comment:
   nit: nice to have is to have this as a separate function to call. But don't worry about it

----------------------------------------------------------------
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