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

 ##########
 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:
   It is a good idea. I will do that.

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