flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhue...@apache.org
Subject [1/2] flink git commit: [hotfix] [docs] Improve Supported Types section of Table API & SQL docs.
Date Tue, 07 Nov 2017 23:21:21 GMT
Repository: flink
Updated Branches:
  refs/heads/release-1.3 310817035 -> 6bf24b968


[hotfix] [docs] Improve Supported Types section of Table API & SQL docs.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/c8b45391
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/c8b45391
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/c8b45391

Branch: refs/heads/release-1.3
Commit: c8b453918d34307ebea4e436e33d0d571d6d7d6b
Parents: 3108170
Author: Fabian Hueske <fhueske@apache.org>
Authored: Tue Nov 7 23:43:45 2017 +0100
Committer: Fabian Hueske <fhueske@apache.org>
Committed: Wed Nov 8 00:20:37 2017 +0100

----------------------------------------------------------------------
 docs/dev/table/sql.md      |  63 ++++++++++++-------------
 docs/dev/table/tableApi.md | 101 +++++++++++++++++++---------------------
 2 files changed, 76 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/c8b45391/docs/dev/table/sql.md
----------------------------------------------------------------------
diff --git a/docs/dev/table/sql.md b/docs/dev/table/sql.md
index 8a60694..00222ef 100644
--- a/docs/dev/table/sql.md
+++ b/docs/dev/table/sql.md
@@ -676,7 +676,7 @@ val result4 = tableEnv.sql(
 Data Types
 ----------
 
-The SQL runtime is built on top of Flink's DataSet and DataStream APIs. Internally, it also
uses Flink's `TypeInformation` to distinguish between types. The SQL support does not include
all Flink types so far. All supported simple types are listed in `org.apache.flink.table.api.Types`.
The following table summarizes the relation between SQL Types, Table API types, and the resulting
Java class.
+The SQL runtime is built on top of Flink's DataSet and DataStream APIs. Internally, it also
uses Flink's `TypeInformation` to define data types. Fully supported types are listed in `org.apache.flink.table.api.Types`.
The following table summarizes the relation between SQL Types, Table API types, and the resulting
Java class.
 
 | Table API              | SQL                         | Java type              |
 | :--------------------- | :-------------------------- | :--------------------- |
@@ -698,21 +698,14 @@ The SQL runtime is built on top of Flink's DataSet and DataStream APIs.
Internal
 | `Types.OBJECT_ARRAY`   | `ARRAY`                     | e.g. `java.lang.Byte[]`|
 | `Types.MAP`            | `MAP`                       | `java.util.HashMap`    |
 
-
-Advanced types such as generic types, composite types (e.g. POJOs or Tuples), and array types
(object or primitive arrays) can be fields of a row.
-
-Generic types are treated as a black box within Table API and SQL yet.
-
-Composite types, however, are fully supported types where fields of a composite type can
be accessed using the `.get()` operator in Table API and dot operator (e.g. `MyTable.pojoColumn.myField`)
in SQL. Composite types can also be flattened using `.flatten()` in Table API or `MyTable.pojoColumn.*`
in SQL.
-
-Array types can be accessed using the `myArray.at(1)` operator in Table API and `myArray[1]`
operator in SQL. Array literals can be created using `array(1, 2, 3)` in Table API and `ARRAY[1,
2, 3]` in SQL.
+Generic types and composite types (e.g., POJOs or Tuples) can be fields of a row as well.
Generic types are treated as a black box and can be passed on or processed by [user-defined
functions](udfs.html). Composite types can be accessed with [built-in functions](#built-in-functions)
(see *Value access functions* section).
 
 {% top %}
 
 Built-In Functions
 ------------------
 
-Both the Table API and SQL come with a set of built-in functions for data transformations.
This section gives a brief overview of the available functions so far.
+Flink's SQL support comes with a set of built-in functions for data transformations. This
section gives a brief overview of the available functions.
 
 <!--
 This list of SQL functions should be kept in sync with SqlExpressionTest to reduce confusion
due to the large amount of SQL functions.
@@ -1609,6 +1602,7 @@ CAST(value AS type)
   </tbody>
 </table>
 
+<!-- Disabled temporarily in favor of composite type support
 <table class="table table-bordered">
   <thead>
     <tr>
@@ -1618,7 +1612,7 @@ CAST(value AS type)
   </thead>
 
   <tbody>
-  <!-- Disabled temporarily in favor of composite type support
+  
     <tr>
       <td>
         {% highlight text %}
@@ -1640,32 +1634,10 @@ ROW (value [, value]* )
         <p>Creates a row from a list of values.</p>
       </td>
     </tr>
--->
-
-    <tr>
-      <td>
-        {% highlight text %}
-array ‘[’ index ‘]’
-{% endhighlight %}
-      </td>
-      <td>
-        <p>Returns the element at a particular position in an array. The index starts
at 1.</p>
-      </td>
-    </tr>
-
-    <tr>
-      <td>
-        {% highlight text %}
-ARRAY ‘[’ value [, value ]* ‘]’
-{% endhighlight %}
-      </td>
-      <td>
-        <p>Creates an array from a list of values.</p>
-      </td>
-    </tr>
 
   </tbody>
 </table>
+-->
 
 <table class="table table-bordered">
   <thead>
@@ -2038,6 +2010,18 @@ tableName.compositeType.*
   </thead>
 
   <tbody>
+
+    <tr>
+      <td>
+        {% highlight text %}
+ARRAY ‘[’ value [, value ]* ‘]’
+{% endhighlight %}
+      </td>
+      <td>
+        <p>Creates an array from a list of values.</p>
+      </td>
+    </tr>
+
     <tr>
       <td>
         {% highlight text %}
@@ -2052,6 +2036,17 @@ CARDINALITY(ARRAY)
     <tr>
       <td>
         {% highlight text %}
+array ‘[’ index ‘]’
+{% endhighlight %}
+      </td>
+      <td>
+        <p>Returns the element at a particular position in an array. The index starts
at 1.</p>
+      </td>
+    </tr>
+
+    <tr>
+      <td>
+        {% highlight text %}
 ELEMENT(ARRAY)
 {% endhighlight %}
       </td>

http://git-wip-us.apache.org/repos/asf/flink/blob/c8b45391/docs/dev/table/tableApi.md
----------------------------------------------------------------------
diff --git a/docs/dev/table/tableApi.md b/docs/dev/table/tableApi.md
index aa3bd84..a74ac92 100644
--- a/docs/dev/table/tableApi.md
+++ b/docs/dev/table/tableApi.md
@@ -1435,7 +1435,7 @@ The `OverWindow` defines a range of rows over which aggregates are computed.
`Ov
 Data Types
 ----------
 
-The Table API is built on top of Flink's DataSet and DataStream API. Internally, it also
uses Flink's `TypeInformation` to distinguish between types. The Table API does not support
all Flink types so far. All supported simple types are listed in `org.apache.flink.table.api.Types`.
The following table summarizes the relation between Table API types, SQL types, and the resulting
Java class.
+The Table API is built on top of Flink's DataSet and DataStream APIs. Internally, it also
uses Flink's `TypeInformation` to define data types. Fully supported types are listed in `org.apache.flink.table.api.Types`.
The following table summarizes the relation between Table API types, SQL types, and the resulting
Java class.
 
 | Table API              | SQL                         | Java type              |
 | :--------------------- | :-------------------------- | :--------------------- |
@@ -1457,14 +1457,7 @@ The Table API is built on top of Flink's DataSet and DataStream API.
Internally,
 | `Types.OBJECT_ARRAY`   | `ARRAY`                     | e.g. `java.lang.Byte[]`|
 | `Types.MAP`            | `MAP`                       | `java.util.HashMap`    |
 
-
-Advanced types such as generic types, composite types (e.g. POJOs or Tuples), and array types
(object or primitive arrays) can be fields of a row. 
-
-Generic types are treated as a black box within Table API and SQL yet.
-
-Composite types, however, are fully supported types where fields of a composite type can
be accessed using the `.get()` operator in Table API and dot operator (e.g. `MyTable.pojoColumn.myField`)
in SQL. Composite types can also be flattened using `.flatten()` in Table API or `MyTable.pojoColumn.*`
in SQL.
-
-Array types can be accessed using the `myArray.at(1)` operator in Table API and `myArray[1]`
operator in SQL. Array literals can be created using `array(1, 2, 3)` in Table API and `ARRAY[1,
2, 3]` in SQL.
+Generic types and composite types (e.g., POJOs or Tuples) can be fields of a row as well.
Generic types are treated as a black box and can be passed on or processed by [user-defined
functions](udfs.html). Composite types can be accessed with [built-in functions](#built-in-functions)
(see *Value access functions* section).
 
 **TODO: Clean-up and move relevant parts to the "Mappings Types to Table Schema" section
of the Common Concepts & API page.**
 
@@ -1549,7 +1542,7 @@ Temporal intervals can be represented as number of months (`Types.INTERVAL_MONTH
 Built-In Functions
 ------------------
 
-Both the Table API and SQL come with a set of built-in functions for data transformations.
This section gives a brief overview of the available functions so far.
+The Table API comes with a set of built-in functions for data transformations. This section
gives a brief overview of the available functions.
 
 <div class="codetabs" markdown="1">
 <div data-lang="java" markdown="1">
@@ -2268,28 +2261,6 @@ ANY.cast(TYPE)
     <tr>
       <td>
         {% highlight java %}
-ARRAY.at(INT)
-{% endhighlight %}
-      </td>
-      <td>
-        <p>Returns the element at a particular position in an array. The index starts
at 1.</p>
-      </td>
-    </tr>
-
-    <tr>
-      <td>
-        {% highlight java %}
-array(ANY [, ANY ]*)
-{% endhighlight %}
-      </td>
-      <td>
-        <p>Creates an array from a list of values. The array will be an array of objects
(not primitives).</p>
-      </td>
-    </tr>
-
-    <tr>
-      <td>
-        {% highlight java %}
 NUMERIC.rows
 {% endhighlight %}
       </td>
@@ -2714,6 +2685,17 @@ ANY.flatten()
     <tr>
       <td>
         {% highlight java %}
+array(ANY [, ANY ]*)
+{% endhighlight %}
+      </td>
+      <td>
+        <p>Creates an array from a list of values. The array will be an array of objects
(not primitives).</p>
+      </td>
+    </tr>
+
+    <tr>
+      <td>
+        {% highlight java %}
 ARRAY.cardinality()
 {% endhighlight %}
       </td>
@@ -2725,6 +2707,17 @@ ARRAY.cardinality()
     <tr>
       <td>
         {% highlight java %}
+ARRAY.at(INT)
+{% endhighlight %}
+      </td>
+      <td>
+        <p>Returns the element at a particular position in an array. The index starts
at 1.</p>
+      </td>
+    </tr>
+
+    <tr>
+      <td>
+        {% highlight java %}
 ARRAY.element()
 {% endhighlight %}
       </td>
@@ -3475,28 +3468,6 @@ ANY.cast(TYPE)
     <tr>
       <td>
         {% highlight scala %}
-ARRAY.at(INT)
-{% endhighlight %}
-      </td>
-      <td>
-        <p>Returns the element at a particular position in an array. The index starts
at 1.</p>
-      </td>
-    </tr>
-
-    <tr>
-      <td>
-        {% highlight scala %}
-array(ANY [, ANY ]*)
-{% endhighlight %}
-      </td>
-      <td>
-        <p>Creates an array from a list of values. The array will be an array of objects
(not primitives).</p>
-      </td>
-    </tr>
-
-    <tr>
-      <td>
-        {% highlight scala %}
 NUMERIC.rows
 {% endhighlight %}
       </td>
@@ -3919,6 +3890,17 @@ ANY.flatten()
     <tr>
       <td>
         {% highlight scala %}
+array(ANY [, ANY ]*)
+{% endhighlight %}
+      </td>
+      <td>
+        <p>Creates an array from a list of values. The array will be an array of objects
(not primitives).</p>
+      </td>
+    </tr>
+
+    <tr>
+      <td>
+        {% highlight scala %}
 ARRAY.cardinality()
 {% endhighlight %}
       </td>
@@ -3930,6 +3912,17 @@ ARRAY.cardinality()
     <tr>
       <td>
         {% highlight scala %}
+ARRAY.at(INT)
+{% endhighlight %}
+      </td>
+      <td>
+        <p>Returns the element at a particular position in an array. The index starts
at 1.</p>
+      </td>
+    </tr>
+
+    <tr>
+      <td>
+        {% highlight scala %}
 ARRAY.element()
 {% endhighlight %}
       </td>


Mime
View raw message