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

    https://github.com/apache/flink/pull/4012#discussion_r119069339
  
    --- Diff: docs/dev/table/common.md ---
    @@ -68,28 +63,24 @@ env.execute("Your Query");
     
     <div data-lang="scala" markdown="1">
     {% highlight scala %}
    -val env = ExecutionEnvironment.getExecutionEnvironment
    +// For batch programs use ExecutionEnvironment instead of 
StreamExecutionEnvironment
    +val env = StreamExecutionEnvironment.getExecutionEnvironment
     
     // Create a TableEnvironment
     val tableEnv = TableEnvironment.getTableEnvironment(env)
     
     // Register a Table
    -tableEnv.registerTable("yourTable", ...)             // or
    -tableEnv.registerTableSource("yourTableSrc", ...)    // or
    -tableEnv.registerDataStream("yourTableStream", ...)  // or
    -tableEnv.registerDataSet("yourTableSet", ...)        // or
    -tableEnv.registerExternalCatalog("yourCatalog", ...)
    -
    -// Create a table from a Table API query
    -val tapiResult = tableEnv.scan("yourTableSrc").select(...)
    -// Or create a table from a SQL query
    -val sqlResult  = tableEnv.sql("SELECT ... FROM yourTableSrc ...")
    -
    -// Emit a Table
    -resultTable.writeToSink(...)     // or
    -resultTable.toAppendStream(...)  // or
    -resultTable.toRetractStream(...) // or
    -resultTable.toDataSet(...)
    +tableEnv.registerTable("table1", ...)           // or
    +tableEnv.registerTableSource("table2", ...)     // or
    +tableEnv.registerExternalCatalog("extCat", ...) 
    +
    +// Create a Table from a Table API query
    +val tapiResult = tableEnv.scan("table1").select(...)
    +// Create a Table from a SQL query
    +val sqlResult  = tableEnv.sql("SELECT ... FROM table2 ...")
    +
    +// Emit a Table to a TableSink
    +resultTable.writeToSink(...)
    --- End diff --
    
    Do we need unified naming `sqlResult` `tapiResult` -> `resultTable`?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to