Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/2810#discussion_r89778399
--- Diff:
flink-libraries/flink-table/src/test/scala/org/apache/flink/api/scala/batch/TableSourceITCase.scala
---
@@ -131,6 +101,58 @@ class TableSourceITCase(
TestBaseUtils.compareResultAsText(results.asJava, expected)
}
+ @Test
+ def testCsvTableSourceWithProjection(): Unit = {
+
+ val csvTable = CommonTestData.getCsvTableSource
+
+ val env = ExecutionEnvironment.getExecutionEnvironment
+ val tEnv = TableEnvironment.getTableEnvironment(env, config)
+
+ tEnv.registerTableSource("csvTable", csvTable)
+
+ val results = tEnv
+ .scan("csvTable")
+ .select('last, 'id, 'score)
+ .collect()
+
+ val expected = Seq(
+ "Smith,1,12.3",
+ "Taylor,2,45.6",
+ "Miller,3,7.89",
+ "Smith,4,0.12",
+ "Williams,5,34.5",
+ "Miller,6,6.78",
+ "Smith,7,90.1",
+ "Williams,8,2.34").mkString("\n")
+ TestBaseUtils.compareResultAsText(results.sortBy(_.toString).asJava,
expected)
+ }
+
+ @Test
+ def testCsvProjecableTableSourceWithDiffRexs(): Unit = {
--- End diff --
I think this ITCase could be omitted.
Instead it would be good to add a few tests that extend the `TableTestBase`
and check that a correct plan is generated.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---