WeiZhong94 commented on a change in pull request #8401: [FLINK-12407][python] 
Add all table operators align Java Table API.
URL: https://github.com/apache/flink/pull/8401#discussion_r284967458
 
 

 ##########
 File path: docs/dev/table/tableApi.zh.md
 ##########
 @@ -510,6 +510,73 @@ val result = orders.renameColumns('b as 'b2, 'c as 'c2)
                 </tr>
   </tbody>
 </table>
+</div>
+<div data-lang="python" markdown="1">
+
+<table class="table table-bordered">
+  <thead>
+    <tr>
+      <th class="text-left" style="width: 20%">操作</th>
+      <th class="text-center">描述</th>
+    </tr>
+  </thead>
+  <tbody>
+  <tr>
+          <td>
+            <strong>AddColumns</strong><br>
+            <span class="label label-primary">批处理</span> <span class="label 
label-primary">流处理</span>
+          </td>
+          <td>
+          <p>执行新增字段操作。如果欲添加字段已经存在,将会抛出异常。</p>
+{% highlight python %}
+orders = table_env.scan("Orders")
+result = orders.add_columns("concat(c, 'sunny')")
+{% endhighlight %}
+</td>
+        </tr>
+        
+ <tr>
+     <td>
+                    <strong>AddOrReplaceColumns</strong><br>
+                    <span class="label label-primary">批处理</span> <span 
class="label label-primary">流处理</span>
+                  </td>
+                  <td>
+                  
<p>执行新增字段操作。如果欲添加字段已经存在,将会替换该字段。如果新增字段列表中有同名字段,取最靠后的为有效字段。</p>
+{% highlight python %}
+orders = table_env.scan("Orders")
+result = orders.add_or_replace_columns("concat(c, 'sunny') as desc")
+{% endhighlight %}
+                  </td>
+                </tr>
+         <tr>
+                  <td>
+                    <strong>DropColumns</strong><br>
+                    <span class="label label-primary">批处理</span> <span 
class="label label-primary">流处理</span>
+                  </td>
+                  <td>
+                  <p>执行删除字段操作。参数必须是字段列表,并且必须是已经存在的字段才能被删除。</p>
+{% highlight python %}
+orders = table_env.scan("Orders")
+result = orders.drop_columns("b, c")
+{% endhighlight %}
+                  </td>
+                </tr>
+         <tr>
+                  <td>
+                    <strong>RenameColumns</strong><br>
+                    <span class="label label-primary">批处理</span> <span 
class="label label-primary">流处理</span>
+                  </td>
+                  <td>
+                  <p>执行重命名字段操作。参数必须是字段别名(例:xxx as 
xxx)列表,并且必须是已经存在的字段才能被重命名。</p>
+{% highlight python %}
 
 Review comment:
   Done.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to