[
https://issues.apache.org/jira/browse/FLINK-7446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16179064#comment-16179064
]
ASF GitHub Bot commented on FLINK-7446:
---------------------------------------
Github user twalthr commented on a diff in the pull request:
https://github.com/apache/flink/pull/4710#discussion_r140782081
--- Diff:
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/stream/table/TableSourceTest.scala
---
@@ -121,19 +161,81 @@ class TableSourceTest extends TableTestBase {
)
util.verifyTable(t, expected)
}
+
+ @Test
+ def testProjectableProcTimeTableSource(): Unit = {
+ // ensures that projection is not pushed into table source with
proctime indicators
+ val util = streamTestUtil()
+
+ val projectableTableSource = new TestProctimeSource("pTime") with
ProjectableTableSource[Row] {
+ override def projectFields(fields: Array[Int]): TableSource[Row] = {
+ // ensure this method is not called!
+ Assert.fail()
+ null.asInstanceOf[TableSource[Row]]
+ }
+ }
+ util.tableEnv.registerTableSource("PTimeTable", projectableTableSource)
+
+ val t = util.tableEnv.scan("PTimeTable")
+ .select('name, 'val)
+ .where('val > 10)
+
+ val expected =
+ unaryNode(
+ "DataStreamCalc",
+ "StreamTableSourceScan(table=[[PTimeTable]], fields=[id, val,
name, pTime])",
+ term("select", "name", "val"),
+ term("where", ">(val, 10)")
+ )
+ util.verifyTable(t, expected)
+ }
+
+ @Test
+ def testProjectableRowTimeTableSource(): Unit = {
--- End diff --
Does filter push down work? With rowtime and proctime?
> Support to define an existing field as the rowtime field for TableSource
> ------------------------------------------------------------------------
>
> Key: FLINK-7446
> URL: https://issues.apache.org/jira/browse/FLINK-7446
> Project: Flink
> Issue Type: Improvement
> Components: Table API & SQL
> Reporter: Jark Wu
> Assignee: Fabian Hueske
>
> Currently {{DefinedRowtimeAttribute}} can define an appended rowtime field
> for a {{TableSource}}. But it would be helpful if we can support to define an
> existing field as the rowtime field. Just like registering a DataStream, the
> rowtime field can be appended but also can replace an existing field.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)