sanjeet006py commented on code in PR #1751:
URL: https://github.com/apache/phoenix/pull/1751#discussion_r1436311360


##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableIT.java:
##########
@@ -1795,4 +1796,65 @@ public void 
testChangePropertiesUpdatesLASTDDLTimestamp() throws Exception {
                     newLastDDLTimestamp > oldLastDDLTimestamp);
         }
     }
-}
\ No newline at end of file
+
+    @Test
+    public void testChangeTableLevelMaxLookbackAge() throws Exception {
+        String schemaName = generateUniqueName();
+        String dataTableName = generateUniqueName();
+        String fullTableName = SchemaUtil.getTableName(schemaName, 
dataTableName);
+        long baseMaxLookbackAge = 86400000; // 1 day
+        Long maxLookbackAge = baseMaxLookbackAge;
+        try (Connection conn = DriverManager.getConnection(getUrl())) {
+            String ddl = "CREATE TABLE  " + fullTableName +
+                    "  (a_string varchar not null, a_binary VARCHAR not null, 
col1 integer" +
+                    "  CONSTRAINT pk PRIMARY KEY (a_string, a_binary)) " + 
"MAX_LOOKBACK_AGE=" + maxLookbackAge;
+            conn.createStatement().execute(ddl);
+            assertMaxLookbackAge(schemaName, dataTableName, maxLookbackAge);
+            maxLookbackAge = 3L * baseMaxLookbackAge;
+            alterTableLevelMaxLookbackAge(fullTableName, 
maxLookbackAge.toString());
+            assertMaxLookbackAge(schemaName, dataTableName, maxLookbackAge);
+            maxLookbackAge = 2L * baseMaxLookbackAge;

Review Comment:
   First I created a table with maxlookback age 1 day, then I increased it to 3 
days and now decreasing it to 2 days. Lastly setting it to 0.



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