You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/07/06 05:26:47 UTC

[GitHub] [flink] TJX2014 commented on a change in pull request #12819: [FLINK-18440][table-planner-blink] Allow ROW/RANGE with RANK, DENSE_RANK or ROW_NUMBER functions on window stream

TJX2014 commented on a change in pull request #12819:
URL: https://github.com/apache/flink/pull/12819#discussion_r449990273



##########
File path: flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/stream/sql/TableScanTest.scala
##########
@@ -357,4 +357,20 @@ class TableScanTest extends TableTestBase {
         |)
       """.stripMargin)
   }
+
+  @Test
+  def testRowNumOverWindow(): Unit = {
+    util.addTable(
+      """
+        |CREATE TABLE src (
+        |  name STRING,
+        |  age BIGINT
+        |) WITH (
+        |  'connector' = 'values'
+        |)
+      """.stripMargin)
+    util.tableEnv.executeSql("create view src_view as select *, " +
+      "ROW_NUMBER() OVER (PARTITION BY name ORDER BY age DESC) as row_num from src")
+    util.verifyPlan("select name, age, row_num from src_view where row_num <= 3")

Review comment:
       @wuchong Thank you for your suggestion, I have made the test code clean and meaningful.




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

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