AHeise commented on code in PR #29030:
URL: https://github.com/apache/flink/pull/29030#discussion_r3880331003


##########
flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/api/internal/ShowCreateUtilTest.java:
##########
@@ -195,6 +196,51 @@ void showCreateMaterializedTableWithFlags(
         assertThat(result).isEqualTo(expected.toString());
     }
 
+    @Test
+    void extractStartModeFromNowEvaluatesToPastTimestamp() {
+        final Clock fixedClock = 
Clock.fixed(Instant.parse("2020-12-12T23:18:12Z"), ZoneOffset.UTC);
+        final ResolvedCatalogMaterializedTable materializedTable =
+                createResolvedMaterialized(
+                        ONE_COLUMN_SCHEMA,
+                        null,
+                        List.of(),
+                        null,
+                        StartMode.of(StartModeKind.FROM_NOW, Interval.of(3, 
TimeUnit.MINUTE)),
+                        IntervalFreshness.ofMinute(1),
+                        RefreshMode.CONTINUOUS,
+                        "SELECT 1",
+                        "SELECT 1");
+
+        assertThat(ShowCreateUtil.extractStartMode(materializedTable, 
ZoneOffset.UTC, fixedClock))
+                .isEqualTo(
+                        "START_MODE = FROM_NOW(INTERVAL '3' MINUTE) /* 
Evaluated to"
+                                + " FROM_TIMESTAMP(TIMESTAMP '2020-12-12 
23:15:12') at execution"
+                                + " */");
+    }

Review Comment:
   Fair — that one was fully redundant, same fixed clock/interval/expected 
string already exercised by the parameterized `showCreateMaterializedTable` 
case. Removed it. Kept `extractStartModeFromNowIsUnaffectedByClockZone` since 
it varies a different axis (non-UTC clock zone) that the parameterized test 
doesn't cover — it hardcodes one shared clock across all table-shape fixtures, 
so folding a variable clock in there just for this one case would mix concerns 
rather than share coverage.



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