diff --git a/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/GroupAggregateTestPrograms.java b/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/GroupAggregateTestPrograms.java index 6c43cf9095986..755eb781a3563 100644 --- a/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/GroupAggregateTestPrograms.java +++ b/flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/GroupAggregateTestPrograms.java @@ -387,13 +387,15 @@ public class GroupAggregateTestPrograms { "+I[1, 1, null, Hi]", "+I[2, 1, 2.0, Hello]", "+U[2, 2, 2.0, Hello]") + // Due to state TTL in hint, the state in the metadata + // savepoint has expired. .consumedAfterRestore( - "+U[1, 2, null, Hi]", - "+U[2, 3, 2.0, Hello]", - "+U[2, 4, 2.0, Hello]") + "+I[1, 1, null, Hi Again!]", + "+I[2, 1, 2.0, Hello Again!]", + "+U[2, 2, 2.0, Hello Again!]") .build()) .runSql( - "INSERT INTO sink_t SELECT /*+ STATE_TTL('source_t' = '4d') */" + "INSERT INTO sink_t SELECT /*+ STATE_TTL('source_t' = '1s') */" + "b, " + "COUNT(*) AS cnt, " + "AVG(a) FILTER (WHERE a > 1) AS avg_a, " diff --git a/flink-table/flink-table-planner/src/test/resources/restore-tests/stream-exec-group-aggregate_1/agg-with-state-ttl-hint/plan/agg-with-state-ttl-hint.json b/flink-table/flink-table-planner/src/test/resources/restore-tests/stream-exec-group-aggregate_1/agg-with-state-ttl-hint/plan/agg-with-state-ttl-hint.json index cebe1e5898b5c..cfdcfed459b8d 100644 --- a/flink-table/flink-table-planner/src/test/resources/restore-tests/stream-exec-group-aggregate_1/agg-with-state-ttl-hint/plan/agg-with-state-ttl-hint.json +++ b/flink-table/flink-table-planner/src/test/resources/restore-tests/stream-exec-group-aggregate_1/agg-with-state-ttl-hint/plan/agg-with-state-ttl-hint.json @@ -128,7 +128,7 @@ "needRetraction" : false, "state" : [ { "index" : 0, - "ttl" : "4 d", + "ttl" : "1 s", "name" : "groupAggregateState" } ], "inputProperties" : [ { diff --git a/flink-table/flink-table-planner/src/test/resources/restore-tests/stream-exec-group-aggregate_1/agg-with-state-ttl-hint/savepoint/_metadata b/flink-table/flink-table-planner/src/test/resources/restore-tests/stream-exec-group-aggregate_1/agg-with-state-ttl-hint/savepoint/_metadata index 50e4bee3a94a9..e956dafb98179 100644 Binary files a/flink-table/flink-table-planner/src/test/resources/restore-tests/stream-exec-group-aggregate_1/agg-with-state-ttl-hint/savepoint/_metadata and b/flink-table/flink-table-planner/src/test/resources/restore-tests/stream-exec-group-aggregate_1/agg-with-state-ttl-hint/savepoint/_metadata differ