dawidwys commented on code in PR #23923:
URL: https://github.com/apache/flink/pull/23923#discussion_r1427958337


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/WindowDeduplicateTestPrograms.java:
##########
@@ -0,0 +1,287 @@
+/*
+ * 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.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 java.math.BigDecimal;
+
+/** {@link TableTestProgram} definitions for testing {@link 
StreamExecWindowDeduplicate}. */
+public class WindowDeduplicateTestPrograms {
+
+    static final Row[] BEFORE_DATA = {
+        Row.of("2020-04-15 08:00:05", new BigDecimal(4.00), "A", "supplier1"),
+        Row.of("2020-04-15 08:00:06", new BigDecimal(4.00), "A", "supplier2"),
+        Row.of("2020-04-15 08:00:07", new BigDecimal(2.00), "G", "supplier1"),
+        Row.of("2020-04-15 08:00:08", new BigDecimal(2.00), "A", "supplier3"),
+        Row.of("2020-04-15 08:00:09", new BigDecimal(5.00), "D", "supplier4"),
+        Row.of("2020-04-15 08:00:11", new BigDecimal(2.00), "B", "supplier3"),
+        Row.of("2020-04-15 08:00:13", new BigDecimal(1.00), "E", "supplier1"),
+        Row.of("2020-04-15 08:00:15", new BigDecimal(3.00), "B", "supplier2"),
+        Row.of("2020-04-15 08:00:17", new BigDecimal(6.00), "D", "supplier5")
+    };
+
+    static final Row[] AFTER_DATA = {
+        Row.of("2020-04-15 08:00:21", new BigDecimal(2.00), "B", "supplier7"),
+        Row.of("2020-04-15 08:00:23", new BigDecimal(1.00), "A", "supplier4"),
+        Row.of("2020-04-15 08:00:25", new BigDecimal(3.00), "C", "supplier3"),
+        Row.of("2020-04-15 08:00:28", new BigDecimal(6.00), "A", "supplier8")
+    };
+
+    static final SourceTestStep SOURCE =
+            SourceTestStep.newBuilder("bid_t")
+                    .addSchema(
+                            "ts STRING",
+                            "price DECIMAL(10,2)",
+                            "item STRING",
+                            "supplier_id STRING",
+                            "`bid_time` AS TO_TIMESTAMP(`ts`)",
+                            "`proc_time` AS PROCTIME()",
+                            "WATERMARK for `bid_time` AS `bid_time` - INTERVAL 
'1' SECOND")
+                    .producedBeforeRestore(BEFORE_DATA)
+                    .producedAfterRestore(AFTER_DATA)
+                    .build();
+
+    static final String[] SINK_SCHEMA = {
+        "bid_time TIMESTAMP(3)",
+        "price DECIMAL(10,2)",
+        "item STRING",
+        "supplier_id STRING",
+        "window_start TIMESTAMP(3)",
+        "window_end TIMESTAMP(3)",
+        "row_num BIGINT"
+    };
+
+    static final String TUMBLE_TVF =
+            "TABLE(TUMBLE(TABLE bid_t, DESCRIPTOR(bid_time), INTERVAL '10' 
SECOND))";
+
+    static final String HOP_TVF =
+            "TABLE(HOP(TABLE bid_t, DESCRIPTOR(bid_time), INTERVAL '5' SECOND, 
INTERVAL '10' SECOND))";
+
+    static final String CUMULATIVE_TVF =
+            "TABLE(CUMULATE(TABLE bid_t, DESCRIPTOR(bid_time), INTERVAL '5' 
SECOND, INTERVAL '10' SECOND))";
+
+    static final String ONE_ROW = "row_num <= 1";
+
+    static final String N_ROWS = "row_num < 3";

Review Comment:
   Is this still converted to `WindowDeduplicate`? I think it tests 
`WindowRank`, doesn't it? The json plans seem to confirm as I can not find the 
`WindowDeduplicate` node there.



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