Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4C1FD200D41 for ; Wed, 8 Nov 2017 00:21:23 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4AA20160C01; Tue, 7 Nov 2017 23:21:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 42E4F160BED for ; Wed, 8 Nov 2017 00:21:22 +0100 (CET) Received: (qmail 71465 invoked by uid 500); 7 Nov 2017 23:21:21 -0000 Mailing-List: contact commits-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list commits@flink.apache.org Received: (qmail 71456 invoked by uid 99); 7 Nov 2017 23:21:21 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2017 23:21:21 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 59C92DFC25; Tue, 7 Nov 2017 23:21:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: fhueske@apache.org To: commits@flink.apache.org Date: Tue, 07 Nov 2017 23:21:21 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] flink git commit: [hotfix] [docs] Improve Supported Types section of Table API & SQL docs. archived-at: Tue, 07 Nov 2017 23:21:23 -0000 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 Authored: Tue Nov 7 23:43:45 2017 +0100 Committer: Fabian Hueske 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. - - - - {% highlight text %} -array ‘[’ index ‘]’ -{% endhighlight %} - - -

Returns the element at a particular position in an array. The index starts at 1.

- - - - - - {% highlight text %} -ARRAY ‘[’ value [, value ]* ‘]’ -{% endhighlight %} - - -

Creates an array from a list of values.

- - +--> @@ -2038,6 +2010,18 @@ tableName.compositeType.* + + + + + + + + + + + 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.
@@ -2268,28 +2261,6 @@ ANY.cast(TYPE)
- - - - - - - - - - @@ -2714,6 +2685,17 @@ ANY.flatten() + + + + + @@ -2725,6 +2707,17 @@ ARRAY.cardinality() + + + + + @@ -3475,28 +3468,6 @@ ANY.cast(TYPE) - - - - - - - - - - @@ -3919,6 +3890,17 @@ ANY.flatten() + + + + + @@ -3930,6 +3912,17 @@ ARRAY.cardinality() + + + + +
+ {% highlight text %} +ARRAY ‘[’ value [, value ]* ‘]’ +{% endhighlight %} + +

Creates an array from a list of values.

+
{% highlight text %} @@ -2052,6 +2036,17 @@ CARDINALITY(ARRAY)
{% highlight text %} +array ‘[’ index ‘]’ +{% endhighlight %} + +

Returns the element at a particular position in an array. The index starts at 1.

+
+ {% highlight text %} ELEMENT(ARRAY) {% endhighlight %}
{% highlight java %} -ARRAY.at(INT) -{% endhighlight %} - -

Returns the element at a particular position in an array. The index starts at 1.

-
- {% highlight java %} -array(ANY [, ANY ]*) -{% endhighlight %} - -

Creates an array from a list of values. The array will be an array of objects (not primitives).

-
- {% highlight java %} NUMERIC.rows {% endhighlight %}
{% highlight java %} +array(ANY [, ANY ]*) +{% endhighlight %} + +

Creates an array from a list of values. The array will be an array of objects (not primitives).

+
+ {% highlight java %} ARRAY.cardinality() {% endhighlight %}
{% highlight java %} +ARRAY.at(INT) +{% endhighlight %} + +

Returns the element at a particular position in an array. The index starts at 1.

+
+ {% highlight java %} ARRAY.element() {% endhighlight %}
{% highlight scala %} -ARRAY.at(INT) -{% endhighlight %} - -

Returns the element at a particular position in an array. The index starts at 1.

-
- {% highlight scala %} -array(ANY [, ANY ]*) -{% endhighlight %} - -

Creates an array from a list of values. The array will be an array of objects (not primitives).

-
- {% highlight scala %} NUMERIC.rows {% endhighlight %}
{% highlight scala %} +array(ANY [, ANY ]*) +{% endhighlight %} + +

Creates an array from a list of values. The array will be an array of objects (not primitives).

+
+ {% highlight scala %} ARRAY.cardinality() {% endhighlight %}
{% highlight scala %} +ARRAY.at(INT) +{% endhighlight %} + +

Returns the element at a particular position in an array. The index starts at 1.

+
+ {% highlight scala %} ARRAY.element() {% endhighlight %}