godfreyhe commented on a change in pull request #15559:
URL: https://github.com/apache/flink/pull/15559#discussion_r613801217



##########
File path: 
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/TableSourceITCase.scala
##########
@@ -303,4 +305,81 @@ class TableSourceITCase extends BatchTestBase {
         row("6"))
     )
   }
+
+  @Test
+  def testTableHint(): Unit = {
+    tEnv.getConfig.getConfiguration.setBoolean(
+      TableConfigOptions.TABLE_DYNAMIC_TABLE_OPTIONS_ENABLED, true)
+    val resultPath = TEMPORARY_FOLDER.newFolder().getAbsolutePath
+    tEnv.executeSql(
+      s"""
+         |CREATE TABLE MySink (
+         |  `a` INT,
+         |  `b` BIGINT,
+         |  `c` STRING
+         |) WITH (
+         |  'connector' = 'filesystem',
+         |  'format' = 'testcsv',
+         |  'path' = '$resultPath'
+         |)
+       """.stripMargin)
+
+    val stmtSet= tEnv.createStatementSet()
+    stmtSet.addInsertSql(
+      """
+        |insert into MySink select a,b,c from MyTable
+        |  /*+ OPTIONS('source.num-element-to-skip'='1') */
+        |""".stripMargin)
+    stmtSet.addInsertSql(
+      """
+        |insert into MySink select a,b,c from MyTable
+        |  /*+ OPTIONS('source.num-element-to-skip'='2') */
+        |""".stripMargin)
+    stmtSet.execute().await()
+
+    val result = TableTestUtil.readFromFile(resultPath)
+    val expected = Seq("2,2,Hello", "3,2,Hello world", "3,2,Hello world")
+    Assert.assertEquals(expected.sorted, result.sorted)
+  }
+
+  @Test
+  def testTableHintWithLogicalTableScanReuse(): Unit = {

Review comment:
       yes,  `testTableHintWithDigestReuseForLogicalTableScan` may be more clear




-- 
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:
[email protected]


Reply via email to