You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ja...@apache.org on 2020/09/07 12:58:08 UTC

[flink] branch release-1.11 updated: [FLINK-19148][docs] Fix crashed table in Flink Table API & SQL docs

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

jark pushed a commit to branch release-1.11
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.11 by this push:
     new fab7076  [FLINK-19148][docs] Fix crashed table in Flink Table API & SQL docs
fab7076 is described below

commit fab7076d5378a7f341bb1a5a95e1da6b3fecc870
Author: Shawn Huang <hx...@163.com>
AuthorDate: Mon Sep 7 20:54:39 2020 +0800

    [FLINK-19148][docs] Fix crashed table in Flink Table API & SQL docs
    
    This closes #13338
---
 docs/dev/table/types.md    |  5 ++++-
 docs/dev/table/types.zh.md | 13 +++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/docs/dev/table/types.md b/docs/dev/table/types.md
index 572c200..aa73604 100644
--- a/docs/dev/table/types.md
+++ b/docs/dev/table/types.md
@@ -279,7 +279,8 @@ The following data types are supported:
 | `MAP` | |
 | `ROW` | |
 | `RAW` | |
-| stuctured types | Only exposed in user-defined functions yet. |
+| structured types | Only exposed in user-defined functions yet. |
+
 </div>
 <div data-lang="Python" markdown="1">
 N/A
@@ -1271,6 +1272,8 @@ DataTypes.ARRAY(t)
 | Java Type                              | Input | Output | Remarks                           |
 |:---------------------------------------|:-----:|:------:|:----------------------------------|
 |*t*`[]`                                 | (X)   | (X)    | Depends on the subtype. *Default* |
+| `java.util.List<t>`                    | X     | X      |                                   |
+| *subclass* of `java.util.List<t>`      | X     |        |                                   |
 |`org.apache.flink.table.data.ArrayData` | X     | X      | Internal data structure.          |
 
 </div>
diff --git a/docs/dev/table/types.zh.md b/docs/dev/table/types.zh.md
index 3ba1bf7..92584e7 100644
--- a/docs/dev/table/types.zh.md
+++ b/docs/dev/table/types.zh.md
@@ -252,7 +252,8 @@ N/A
 | `MAP` | |
 | `ROW` | |
 | `RAW` | |
-| stuctured types | 暂只能在用户自定义函数里使用。 |
+| structured types | 暂只能在用户自定义函数里使用。 |
+
 </div>
 <div data-lang="Python" markdown="1">
 N/A
@@ -1192,6 +1193,8 @@ DataTypes.ARRAY(t)
 | Java 类型                              | 输入  | 输出   | 备注                              |
 |:---------------------------------------|:-----:|:------:|:----------------------------------|
 |*t*`[]`                                 | (X)   | (X)    | 依赖于子类型。 *缺省*             |
+| `java.util.List<t>`                    | X     | X      |                                   |
+| `java.util.List<t>` 的*子类型*          | X     |        |                                   |
 |`org.apache.flink.table.data.ArrayData` | X     | X      | 内部数据结构。                    |
 
 </div>
@@ -1584,7 +1587,13 @@ DataTypes.NULL()
 <div data-lang="Java/Scala" markdown="1">
 Flink API 经常尝试使用反射自动从类信息中提取数据类型,以避免重复的手动定义模式工作。然而以反射方式提取数据类型并不总是成功的,因为可能会丢失逻辑信息。因此,可能有必要在类或字段声明附近添加额外信息以支持提取逻辑。
 
-下表列出了可以隐式映射到数据类型而无需额外信息的类:
+下表列出了可以隐式映射到数据类型而无需额外信息的类。
+
+If you intend to implement classes in Scala, *it is recommended to use boxed types* (e.g. `java.lang.Integer`)
+instead of Scala's primitives. Scala's primitives (e.g. `Int` or `Double`) are compiled to JVM primitives (e.g.
+`int`/`double`) and result in `NOT NULL` semantics as shown in the table below. Furthermore, Scala primitives that
+are used in generics (e.g. `java.lang.Map[Int, Double]`) are erased during compilation and lead to class
+information similar to `java.lang.Map[java.lang.Object, java.lang.Object]`.
 
 | 类                          | 数据类型                            |
 |:----------------------------|:------------------------------------|