phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [phoenix] priyankporwal commented on a change in pull request #499: Phoenix 4703 ALTER INDEX REBUILD ALL
Date Tue, 07 May 2019 16:09:42 GMT
priyankporwal commented on a change in pull request #499: Phoenix 4703 ALTER INDEX REBUILD
ALL 
URL: https://github.com/apache/phoenix/pull/499#discussion_r281710290
 
 

 ##########
 File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
 ##########
 @@ -610,7 +613,84 @@ public void testAsyncRebuildTimestamp() throws Exception {
                 "order by table_name" );
         assertFalse(rs.next());
     }
-    
+
+    @Test
+    public void testAsyncRebuildAll() throws Exception {
+        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+        Connection conn = DriverManager.getConnection(getUrl(), props);
+        conn.setAutoCommit(true);
+        String testTable = generateUniqueName();
+
+
+        String ddl = "create table " + testTable  + " (k varchar primary key, v4 varchar)";
+        Statement stmt = conn.createStatement();
+        stmt.execute(ddl);
+
+        PreparedStatement upsertStmt = conn.prepareStatement("UPSERT INTO " + testTable +
" VALUES(?, ?)");
+        upsertStmt.setString(1, "key1");
+        upsertStmt.setString(2, "val1");
+        upsertStmt.execute();
+
+        String indexName = "R_ASYNCIND_" + generateUniqueName();
+        ddl = "CREATE INDEX " + indexName + " ON " + testTable  + " (k, v4)";
+        stmt.execute(ddl);
+
+        // Check that index value is same as table
+        String val = getIndexValue(conn, indexName, 2);
+        assertEquals("val1", val);
+
+        // Update index value, check that index value is still not updated
+        conn.createStatement().execute("ALTER INDEX "+indexName+" ON " + testTable +" DISABLE");
 
 Review comment:
   Nit: inconsistent space between addends

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

Mime
View raw message