dianfu commented on a change in pull request #8916: [FLINK-12897][python][docs] 
Improve the Python Table API docs by adding more examples
URL: https://github.com/apache/flink/pull/8916#discussion_r298467227
 
 

 ##########
 File path: docs/dev/table/common.md
 ##########
 @@ -89,6 +89,35 @@ tapiResult.insertInto("outputTable")
 // execute
 env.execute()
 
+{% endhighlight %}
+</div>
+
+<div data-lang="python" markdown="1">
+{% highlight python %}
+# for batch programs use ExecutionEnvironment instead of 
StreamExecutionEnvironment
+env = StreamExecutionEnvironment.get_execution_environment()
+
+# create a TableEnvironment
+table_env = StreamTableEnvironment.create(env)
+
+# register a Table
+table_env.register_table("table1", ...)           # or
+table_env.register_table_source("table2", ...)     # or
+
+# register an output Table
+table_env.register_table_sink("outputTable", ...);
+
+# create a Table from a Table API query
+tapi_result = table_env.scan("table1").select(...)
+# Create a Table from a SQL query
 
 Review comment:
   Create -> create. The Java/Scala documentation should also be updated.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to