You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by dw...@apache.org on 2021/05/03 14:09:10 UTC

[flink-web] branch asf-site updated: Rebuild page

This is an automated email from the ASF dual-hosted git repository.

dwysakowicz pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/flink-web.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 8a575a0  Rebuild page
8a575a0 is described below

commit 8a575a0b0b6fd7b0cc1f161f457bd7ad083957d0
Author: Dawid Wysakowicz <dw...@apache.org>
AuthorDate: Mon May 3 16:08:57 2021 +0200

    Rebuild page
---
 content/blog/feed.xml                       | 21 ++++++++++-----------
 content/news/2021/05/03/release-1.13.0.html | 21 ++++++++++-----------
 2 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/content/blog/feed.xml b/content/blog/feed.xml
index 9312bd2..d3a6b6c 100644
--- a/content/blog/feed.xml
+++ b/content/blog/feed.xml
@@ -452,17 +452,16 @@ stream into “buckets” of bounded size), this greatly increases the expressiv
 &lt;p&gt;The Python Table API now supports row-based operations, i.e., custom transformation functions on rows.
 These functions are an easy way to apply data transformations on tables beyond the built-in functions.&lt;/p&gt;
 
-&lt;p&gt;This is an example of using a &lt;code&gt;map()&lt;/code&gt; operation in Python Table API:
-```python
-@udf(result_type=DataTypes.ROW(
-  [DataTypes.FIELD(“c1”, DataTypes.BIGINT()),
-   DataTypes.FIELD(“c2”, DataTypes.STRING())]))
-def increment_column(r: Row) -&amp;gt; Row:
-  return Row(r[0] + 1, r[1])&lt;/p&gt;
-
-&lt;p&gt;table = …  # type: Table
-mapped_result = table.map(increment_column)
-```&lt;/p&gt;
+&lt;p&gt;This is an example of using a &lt;code&gt;map()&lt;/code&gt; operation in Python Table API:&lt;/p&gt;
+
+&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;nd&quot;&gt;@udf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result_type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DataTypes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ROW&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
+  &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DataTypes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FIELD&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;c1&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DataTypes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;BI [...]
+   &lt;span class=&quot;n&quot;&gt;DataTypes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FIELD&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;c2&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DataTypes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;STRING&lt;/span&gt;&lt;span class=&quot;p&quot; [...]
+&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;increment_column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
+  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&q [...]
+
+&lt;span class=&quot;n&quot;&gt;table&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;# type: Table&lt;/span&gt;
+&lt;span class=&quot;n&quot;&gt;mapped_result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;increment_column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
 
 &lt;p&gt;In addition to &lt;code&gt;map()&lt;/code&gt;, the API also supports &lt;code&gt;flat_map()&lt;/code&gt;, &lt;code&gt;aggregate()&lt;/code&gt;, &lt;code&gt;flat_aggregate()&lt;/code&gt;,
 and other row-based operations. This brings the Python Table API a big step closer to feature
diff --git a/content/news/2021/05/03/release-1.13.0.html b/content/news/2021/05/03/release-1.13.0.html
index 970c2e3..c8ddaa1 100644
--- a/content/news/2021/05/03/release-1.13.0.html
+++ b/content/news/2021/05/03/release-1.13.0.html
@@ -646,17 +646,16 @@ stream into “buckets” of bounded size), this greatly increases the expressiv
 <p>The Python Table API now supports row-based operations, i.e., custom transformation functions on rows.
 These functions are an easy way to apply data transformations on tables beyond the built-in functions.</p>
 
-<p>This is an example of using a <code>map()</code> operation in Python Table API:
-```python
-@udf(result_type=DataTypes.ROW(
-  [DataTypes.FIELD(“c1”, DataTypes.BIGINT()),
-   DataTypes.FIELD(“c2”, DataTypes.STRING())]))
-def increment_column(r: Row) -&gt; Row:
-  return Row(r[0] + 1, r[1])</p>
-
-<p>table = …  # type: Table
-mapped_result = table.map(increment_column)
-```</p>
+<p>This is an example of using a <code>map()</code> operation in Python Table API:</p>
+
+<div class="highlight"><pre><code class="language-python"><span class="nd">@udf</span><span class="p">(</span><span class="n">result_type</span><span class="o">=</span><span class="n">DataTypes</span><span class="o">.</span><span class="n">ROW</span><span class="p">(</span>
+  <span class="p">[</span><span class="n">DataTypes</span><span class="o">.</span><span class="n">FIELD</span><span class="p">(</span><span class="s">&quot;c1&quot;</span><span class="p">,</span> <span class="n">DataTypes</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">()),</span>
+   <span class="n">DataTypes</span><span class="o">.</span><span class="n">FIELD</span><span class="p">(</span><span class="s">&quot;c2&quot;</span><span class="p">,</span> <span class="n">DataTypes</span><span class="o">.</span><span class="n">STRING</span><span class="p">())]))</span>
+<span class="k">def</span> <span class="nf">increment_column</span><span class="p">(</span><span class="n">r</span><span class="p">:</span> <span class="n">Row</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Row</span><span class="p">:</span>
+  <span class="k">return</span> <span class="n">Row</span><span class="p">(</span><span class="n">r</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">r</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
+
+<span class="n">table</span> <span class="o">=</span> <span class="o">...</span>  <span class="c"># type: Table</span>
+<span class="n">mapped_result</span> <span class="o">=</span> <span class="n">table</span><span class="o">.</span><span class="n">map</span><span class="p">(</span><span class="n">increment_column</span><span class="p">)</span></code></pre></div>
 
 <p>In addition to <code>map()</code>, the API also supports <code>flat_map()</code>, <code>aggregate()</code>, <code>flat_aggregate()</code>,
 and other row-based operations. This brings the Python Table API a big step closer to feature