You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "palashc (via GitHub)" <gi...@apache.org> on 2023/05/31 17:37:46 UTC

[GitHub] [phoenix] palashc commented on a diff in pull request #1612: PHOENIX-6963 : Bootstrap last ddl timestamp for indexes

palashc commented on code in PR #1612:
URL: https://github.com/apache/phoenix/pull/1612#discussion_r1212071303


##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java:
##########
@@ -697,21 +698,33 @@ public void testLastDDLTimestampBootstrap() throws Exception {
             conn.createStatement().execute(
                 "CREATE VIEW " + fullViewName + " AS SELECT * FROM " + fullTableName);
 
+            conn.createStatement().execute("CREATE INDEX " + indexName + " ON " + fullTableName + " (KV1) ASYNC");
+
             //Now we null out any existing last ddl timestamps
             nullDDLTimestamps(conn);
 
             //now get the row timestamps for each header row
             long tableTS = getRowTimestampForMetadata(conn, schemaName, tableName,
                 PTableType.TABLE);
             long viewTS = getRowTimestampForMetadata(conn, schemaName, viewName, PTableType.VIEW);
+            long indexTS = getRowTimestampForMetadata(conn, schemaName, indexName, PTableType.INDEX);
 
-            UpgradeUtil.bootstrapLastDDLTimestamp(conn.unwrap(PhoenixConnection.class));
+            // bootstrap last ddl timestamp for tables and views
+            UpgradeUtil.bootstrapLastDDLTimestampForTablesAndViews(conn.unwrap(PhoenixConnection.class));
             long actualTableTS = getLastTimestampForMetadata(conn, schemaName, tableName,
                 PTableType.TABLE);
             long actualViewTS = getLastTimestampForMetadata(conn, schemaName, viewName,
                 PTableType.VIEW);
+            long actualIndexTS = getLastTimestampForMetadata(conn, schemaName, indexName,
+                    PTableType.INDEX);
             assertEquals(tableTS, actualTableTS);
             assertEquals(viewTS, actualViewTS);
+            assertEquals(0L, actualIndexTS);

Review Comment:
   It is returned using a `rs.getLong()` call which returns 0 if the actual value was sql null. 



-- 
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: issues-unsubscribe@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org