twalthr commented on code in PR #26923:
URL: https://github.com/apache/flink/pull/26923#discussion_r2306974827


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/ShowCreateUtil.java:
##########
@@ -263,10 +289,32 @@ static Optional<String> 
extractFormattedPartitionedInfo(ResolvedCatalogTable cat
         if (!catalogTable.isPartitioned()) {
             return Optional.empty();
         }
-        return Optional.of(
-                catalogTable.getPartitionKeys().stream()
-                        .map(EncodingUtils::escapeIdentifier)
-                        .collect(Collectors.joining(", ")));
+        return 
Optional.of(extractPartitionKeys(catalogTable.getPartitionKeys()));
+    }
+
+    static Optional<String> extractFormattedPartitionedInfo(
+            ResolvedCatalogMaterializedTable catalogMaterializedTable) {
+        if (!catalogMaterializedTable.isPartitioned()) {
+            return Optional.empty();
+        }
+        return 
Optional.of(extractPartitionKeys(catalogMaterializedTable.getPartitionKeys()));
+    }
+
+    private static String extractPartitionKeys(List<String> partitionKeys) {
+        return partitionKeys.stream()
+                .map(EncodingUtils::escapeIdentifier)
+                .collect(Collectors.joining(", "));
+    }
+
+    static String extractFreshness(ResolvedCatalogMaterializedTable 
materializedTable) {
+        final IntervalFreshness definitionFreshness = 
materializedTable.getDefinitionFreshness();
+        return String.format(
+                "FRESHNESS = INTERVAL '%s' %s",

Review Comment:
   Would the SQL parser allow parsing `INTERVAL '5' DAY`. Doesn't it need to be 
plural. Also why is the interval a string, this looks like a bug to me. Maybe 
we should change it before it is too late.



-- 
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-unsubscr...@flink.apache.org

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

Reply via email to