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


##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java:
##########
@@ -1699,6 +1701,44 @@ public void testCreateTableWithNoVerify() throws 
SQLException, IOException, Inte
         }
     }
 
+    @Test
+    public void testCreateTableWithTableLevelMaxLookbackAge() throws Exception 
{
+        String schemaName = generateUniqueName();
+        String dataTableName = generateUniqueName();
+        String fullTableName = SchemaUtil.getTableName(schemaName, 
dataTableName);
+        Long maxLookbackAge = 259200L;
+        createTableWithTableLevelMaxLookbackAge(fullTableName, 
maxLookbackAge.toString());
+        assertEquals(maxLookbackAge, queryTableLevelMaxLookbackAge(schemaName, 
dataTableName));
+        schemaName = generateUniqueName();
+        dataTableName = generateUniqueName();
+        fullTableName = SchemaUtil.getTableName(schemaName, dataTableName);
+        maxLookbackAge = 25920000000L;
+        createTableWithTableLevelMaxLookbackAge(fullTableName, 
maxLookbackAge.toString());
+        assertEquals(maxLookbackAge, queryTableLevelMaxLookbackAge(schemaName, 
dataTableName));
+    }
+
+    @Test
+    public void testCreateTableWithTableLevelMaxLookbackAgeAsNull() throws 
Exception {
+        String schemaName = generateUniqueName();
+        String dataTableName = generateUniqueName();
+        String fullTableName = SchemaUtil.getTableName(schemaName, 
dataTableName);
+        createTableWithTableLevelMaxLookbackAge(fullTableName, "NULL");
+        assertNull(queryTableLevelMaxLookbackAge(schemaName, dataTableName));
+        schemaName = generateUniqueName();
+        dataTableName = generateUniqueName();
+        fullTableName = SchemaUtil.getTableName(schemaName, dataTableName);
+        createTableWithTableLevelMaxLookbackAge(fullTableName, "null");

Review Comment:
   This variant is not nneeded, it is really only testing the parser literal 
token.



##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java:
##########
@@ -1727,4 +1767,26 @@ private int checkGuidePostWidth(String tableName) throws 
Exception {
         }
     }
 
+    private void createTableWithTableLevelMaxLookbackAge(String fullTableName, 
String maxLookbackAge) throws Exception {
+        try(Connection conn = DriverManager.getConnection(getUrl())) {
+            String createDdl = "CREATE TABLE " + fullTableName +
+                    " (id char(1) NOT NULL," + " col1 integer NOT NULL," + " 
col2 bigint NOT NULL," +
+                    " CONSTRAINT NAME_PK PRIMARY KEY (id, col1, col2)) " +
+                    "MAX_LOOKBACK_AGE="+maxLookbackAge;

Review Comment:
   As I commented earlier, there is no need to use anything but the simplest 
table schema here.



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