fhueske commented on code in PR #28713:
URL: https://github.com/apache/flink/pull/28713#discussion_r3613312060


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/LateralSnapshotJoinSemanticTestPrograms.java:
##########
@@ -0,0 +1,451 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.plan.nodes.exec.stream;
+
+import org.apache.flink.table.api.config.TableConfigOptions;
+import org.apache.flink.table.test.program.SinkTestStep;
+import org.apache.flink.table.test.program.SourceTestStep;
+import org.apache.flink.table.test.program.TableTestProgram;
+import org.apache.flink.types.Row;
+import org.apache.flink.types.RowKind;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+/**
+ * Deterministic result {@link TableTestProgram} definitions for the {@code 
LATERAL SNAPSHOT}
+ * processing-time temporal join ({@link StreamExecLateralSnapshotJoin}).
+ *
+ * <p>Processing-time semantics make the join non-deterministic in general. To 
get stable results,
+ * each build source appends a non-matching "flip-trigger" row at the flip 
timestamp ({@link
+ * #FLIP_TRIGGER_TS}) while all real build rows are earlier. With per-record 
({@code on-event})
+ * watermarks the operator flips to the JOIN phase. Some programs throttle 
source emission ({@code
+ * source.sleep-*}) to place probes deterministically around the flip.
+ */
+public class LateralSnapshotJoinSemanticTestPrograms {
+
+    /** The {@code 'user_time'} condition reached mid-stream by the build-side 
flip-trigger row. */
+    private static final String MID_FLIP =
+            "load_completed_condition => 'user_time', "
+                    + "load_completed_time => CAST(TIMESTAMP '2020-01-01 
00:00:10' AS TIMESTAMP_LTZ(3))";

Review Comment:
   Unfortunately no, the cast is still needed:
   ```
   No match found for function signature 
SNAPSHOT(<RecordType(VARCHAR(2147483647) bk, INTEGER bv, TIMESTAMP(3) *ROWTIME* 
bts)>, <CHARACTER>, <TIMESTAMP>, <INTERVAL_DAY_TIME>, <INTERVAL_DAY_TIME>).
   Supported signatures are:
   SNAPSHOT(input => {TABLE, ROW SEMANTIC TABLE, SUPPORT UPDATES, REQUIRE 
UPDATE BEFORE, REQUIRE FULL DELETE}, load_completed_condition => STRING, 
load_completed_time => TIMESTAMP_LTZ(3), load_completed_idle_timeout => 
INTERVAL SECOND(6), state_ttl => INTERVAL SECOND(6))
   ```



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