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

    https://github.com/apache/flink/pull/3829#discussion_r139471468
  
    --- Diff: docs/dev/table/common.md ---
    @@ -387,6 +433,59 @@ Table revenue = tableEnv.sql("""
     </div>
     </div>
     
    +The following example shows how to specify a update query to insert the 
result to a registered Table.
    +
    +<div class="codetabs" markdown="1">
    +<div data-lang="java" markdown="1">
    +{% highlight java %}
    +// get a StreamTableEnvironment, works for BatchTableEnvironment 
equivalently
    +StreamTableEnvironment tableEnv = 
TableEnvironment.getTableEnvironment(env);
    +
    +// register Orders table
    +...
    +
    +// register SinkResult table
    +...
    +
    +// compute revenue for all customers from France and emit to SinkResult
    +tableEnv.sqlUpdate(
    +    "INSERT INTO SinkResult" +
    +    "SELECT cID, cName, SUM(revenue) AS revSum " +
    +    "FROM Orders " +
    +    "WHERE cCountry = 'FRANCE' " +
    +    "GROUP BY cID, cName"
    +  );
    +
    +// execute query
    +{% endhighlight %}
    +</div>
    +
    +<div data-lang="scala" markdown="1">
    +{% highlight scala %}
    +// get a TableEnvironment
    +val tableEnv = TableEnvironment.getTableEnvironment(env)
    +
    +// register Orders table
    +...
    +
    +// register SinkResult table
    --- End diff --
    
    same as above


---

Reply via email to