flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timo Walther (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-6955) Add operation log for Table
Date Tue, 20 Jun 2017 14:41:00 GMT

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

Timo Walther commented on FLINK-6955:
-------------------------------------

[~kaibo.zhou] Isn't {{TableEnvironment#explain}} what you are looking for?

> Add operation log for Table
> ---------------------------
>
>                 Key: FLINK-6955
>                 URL: https://issues.apache.org/jira/browse/FLINK-6955
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API & SQL
>            Reporter: Kaibo Zhou
>            Assignee: Kaibo Zhou
>
> In some of the actual production scenarios, the operation of the Table is very complicated,
will go through a number of steps. For example, the Table object will be generated at the
beginning of the program, in the process of running will be passed to different modules, each
module will do some operations for the Table, such as union, join or filter. At the end of
the program will call writeToSink or other operations.
> Hoping to record the operation about Table and can print out.
> eg:
> {code}
>     val table1 = StreamTestData.getSmall3TupleDataStream(env).toTable(tEnv, 'a, 'b, 'c)
>     val table2 = StreamTestData.get5TupleDataStream(env).toTable(tEnv, 'a, 'b, 'd, 'c,
'e)
>     val unionDs = table1.unionAll(table2.select('a, 'b, 'c)).filter('b < 2).select('c)
>     val results = unionDs.toDataStream[Row]
>     
>     val result = tEnv.getLog
>     val expected =
>       "UnnamedTable$1 = UnnamedTable$0.select('a, 'b, 'c)\n" +
>         "UnnamedTable$5 = UnnamedTable$2.unionAll(UnnamedTable$1)\n" +
>         "  .filter('b < 2)\n" +
>         "  .select('c)\n"
>     assertEquals(expected, result)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message