sunjincheng121 commented on a change in pull request #8057: 
[FLINK-12028][table] Add `addColumns`,`renameColumns`, `dropColumns` …
URL: https://github.com/apache/flink/pull/8057#discussion_r270346847
 
 

 ##########
 File path: docs/dev/table/tableApi.md
 ##########
 @@ -188,7 +188,50 @@ Table result = orders.select("*");
 {% endhighlight %}
       </td>
     </tr>
-
+  <tr>
+          <td>
+            <strong>AddColumns</strong><br>
+            <span class="label label-primary">Batch</span> <span class="label 
label-primary">Streaming</span>
+          </td>
+          <td>
+          <p>Performs a field add operation.</p>
+{% highlight java %}
+Table orders = tableEnv.scan("Orders");
+Table result = orders.addColumns("concat(c, 'sunny')");
+{% endhighlight %}
+            <p>You can also replace existing fields, the following example 
will replace the 
+            existing `desc` field </p>
+{% highlight java %}
+Table result = orders.addColumns(true, "concat(c, 'sunny') as desc");
+{% endhighlight %}
+          </td>
+        </tr>
+         <tr>
+                  <td>
+                    <strong>DropColumns</strong><br>
+                    <span class="label label-primary">Batch</span> <span 
class="label label-primary">Streaming</span>
+                  </td>
+                  <td>
+                  <p>Performs a field drop operation.</p>
+{% highlight java %}
+Table orders = tableEnv.scan("Orders");
+Table result = orders.dropColumns("b, c");
 
 Review comment:
   I think dropColumns only supports `FieldRefrence` or column operations, such 
as `dropColunns(columns(...))` when FLINK-12029 is done.  And It will throw an 
exception If the column does not exist. The columns that the user wants to 
delete are all known column names. If the user accidentally writes the wrong 
column name but does not report an error, this will be a bit confusing, so I 
chose strict verification if the column to be deleted does not exist, throw an 
exception directly.  Is that make sense to you? 
   

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