flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-7446) Support to define an existing field as the rowtime field for TableSource
Date Tue, 26 Sep 2017 17:43:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-7446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16181204#comment-16181204
] 

ASF GitHub Bot commented on FLINK-7446:
---------------------------------------

Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4710#discussion_r141130569
  
    --- 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 --
    
    Yes, that should not be a problem. Projection push-down is not possible because the schema
of the table is partially constructed inside of the Table API (e.g., appending the proctime
attribute). 


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

Mime
View raw message