You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Kaibo Zhou (JIRA)" <ji...@apache.org> on 2017/06/20 11:54:00 UTC

[jira] [Updated] (FLINK-6955) Add operation log for Table

     [ https://issues.apache.org/jira/browse/FLINK-6955?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kaibo Zhou updated FLINK-6955:
------------------------------
    Description: 
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}


  was:
In some of the actual production scenarios, the operation of the Table is very complicated, will go through a number of steps, 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}



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