gjacoby126 commented on a change in pull request #1341:
URL: https://github.com/apache/phoenix/pull/1341#discussion_r741446469



##########
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterMultiTenantTableWithViewsIT.java
##########
@@ -82,7 +79,66 @@ private static void verifyNewColumns(ResultSet rs, String 
... values) throws SQL
         assertFalse(rs.next());
         assertEquals(values.length, i - 1);
     }
-    
+
+    @Test
+    public void testCreateAndAlterViewsWithChangeDetectionEnabled() throws 
Exception {
+        String tenantId = "TE_" + generateUniqueName();
+        String schemaName = "S_" + generateUniqueName();
+        String tableName = "T_" + generateUniqueName();
+        String globalViewName = "GV_" + generateUniqueName();
+        String tenantViewName = "TV_" + generateUniqueName();
+        String fullTableName = SchemaUtil.getTableName(schemaName, tableName);
+        String fullGlobalViewName = SchemaUtil.getTableName(schemaName, 
globalViewName);
+        String fullTenantViewName = SchemaUtil.getTableName(schemaName, 
tenantViewName);
+
+        PTable globalView = null;
+        PTable alteredGlobalView = null;
+        try (Connection conn = DriverManager.getConnection(getUrl())) {
+            String ddl = "CREATE TABLE " + fullTableName +
+                " (id char(1) NOT NULL," + " col1 integer NOT NULL," + " col2 
bigint NOT NULL," +
+                " CONSTRAINT NAME_PK PRIMARY KEY (id, col1, col2)) " +
+                "MULTI_TENANT=true, CHANGE_DETECTION_ENABLED=true";
+            conn.createStatement().execute(ddl);
+            PTable table = PhoenixRuntime.getTableNoCache(conn, fullTableName);
+            assertTrue(table.isChangeDetectionEnabled());
+            AlterTableIT.verifySchemaExport(table, 
getUtility().getConfiguration());
+
+            String globalViewDdl = "CREATE VIEW " + fullGlobalViewName +

Review comment:
       It's not inherited (and should never be true for indexes)




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to