[ 
https://issues.apache.org/jira/browse/PHOENIX-6649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17498343#comment-17498343
 ] 

ASF GitHub Bot commented on PHOENIX-6649:
-----------------------------------------

gokceni commented on a change in pull request #1397:
URL: https://github.com/apache/phoenix/pull/1397#discussion_r815206739



##########
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/transform/TransformMonitorExtendedIT.java
##########
@@ -156,16 +162,138 @@ public void testTransformTableWithNamespaceEnabled() 
throws Exception {
             waitForTransformToGetToState(conn.unwrap(PhoenixConnection.class), 
record, PTable.TransformStatus.COMPLETED);
             SingleCellIndexIT.assertMetadata(conn, 
PTable.ImmutableStorageScheme.SINGLE_CELL_ARRAY_WITH_OFFSETS, 
PTable.QualifierEncodingScheme.TWO_BYTE_QUALIFIERS, 
record.getNewPhysicalTableName());
             TransformToolIT.upsertRows(conn, fullDataTableName, 2, 1);
-            assertEquals(numOfRows+1, TransformMonitorIT.countRows(conn, 
fullDataTableName));
+            assertEquals(numOfRows + 1, TransformMonitorIT.countRows(conn, 
fullDataTableName));
 
             ResultSet rs = conn.createStatement().executeQuery("SELECT ID, ZIP 
FROM " + fullDataTableName);
             assertTrue(rs.next());
             assertEquals("1", rs.getString(1));
-            assertEquals( 95051, rs.getInt(2));
+            assertEquals(95051, rs.getInt(2));
             assertTrue(rs.next());
             assertEquals("2", rs.getString(1));
-            assertEquals( 95052, rs.getInt(2));
+            assertEquals(95052, rs.getInt(2));
             assertFalse(rs.next());
         }
     }
+
+    @Test
+    public void testTransformWithGlobalAndTenantViews() throws Exception {
+        String schemaName = generateUniqueName();
+        String dataTableName1 = generateUniqueName();
+        String dataTableFullName1 = SchemaUtil.getTableName(schemaName, 
dataTableName1);
+        String namespaceMappedDataTableName1 = 
SchemaUtil.getPhysicalHBaseTableName(schemaName, dataTableName1, 
true).getString();
+        String view1Name = SchemaUtil.getTableName(schemaName, "VW1_" + 
generateUniqueName());
+        String view2Name = SchemaUtil.getTableName(schemaName, "VW2_" + 
generateUniqueName());
+        String tenantView = SchemaUtil.getTableName(schemaName, "VWT_" + 
generateUniqueName());
+        String readOnlyTenantView = SchemaUtil.getTableName(schemaName, 
"ROVWT_" + generateUniqueName());
+
+        try (Connection conn = DriverManager.getConnection(getUrl(), 
propsNamespace)) {
+            conn.setAutoCommit(true);
+            int numOfRows = 1;
+            conn.createStatement().execute("CREATE SCHEMA IF NOT EXISTS " + 
schemaName);
+            TransformToolIT.createTableAndUpsertRows(conn, dataTableFullName1, 
numOfRows, "TABLE_ONLY", dataTableDdl);
+
+            SingleCellIndexIT.assertMetadata(conn, 
PTable.ImmutableStorageScheme.ONE_CELL_PER_COLUMN, 
PTable.QualifierEncodingScheme.NON_ENCODED_QUALIFIERS, dataTableFullName1);
+
+            String createViewSql = "CREATE VIEW " + view1Name + " ( VIEW_COL1 
INTEGER, VIEW_COL2 VARCHAR ) AS SELECT * FROM "
+                    + dataTableFullName1 + " where DATA='GLOBAL_VIEW' ";
+            conn.createStatement().execute(createViewSql);
+            PreparedStatement stmt1 = 
conn.prepareStatement(String.format("UPSERT INTO %s VALUES(?, ? , ?, ?, ?,?)", 
view1Name));
+            stmt1.setInt(1, 2);
+            stmt1.setString(2, "uname2");
+            stmt1.setInt(3, 95053);
+            stmt1.setString(4, "GLOBAL_VIEW");
+            stmt1.setInt(5, 111);
+            stmt1.setString(6, "viewcol2");
+            stmt1.executeUpdate();
+
+            createViewSql = "CREATE VIEW " + view2Name + " ( VIEW_COL1 
INTEGER, VIEW_COL2 VARCHAR ) AS SELECT * FROM "
+                    + dataTableFullName1 + " where DATA='GLOBAL_VIEW' AND 
ZIP=95053";

Review comment:
       @gjacoby126 for overlapping view




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


> TransformTool should transform the tenant view content as well
> --------------------------------------------------------------
>
>                 Key: PHOENIX-6649
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6649
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Gokcen Iskender
>            Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to