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/07/03 07:50:23 UTC

[flink] branch release-1.11 updated: [FLINK-18395][FLINK-18388][docs-zh] Translate "ORC Format" and "CSV Format" page into Chinese

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 66044ef  [FLINK-18395][FLINK-18388][docs-zh] Translate "ORC Format" and "CSV Format" page into Chinese
66044ef is described below

commit 66044ef8d9636e2b31299f4063d99aeb1b7f4cc0
Author: pengweibo <we...@viacesi.fr>
AuthorDate: Fri Jun 26 21:56:04 2020 +0800

    [FLINK-18395][FLINK-18388][docs-zh] Translate "ORC Format" and "CSV Format" page into Chinese
    
    This closes #12774
---
 docs/dev/table/connectors/formats/csv.zh.md | 96 ++++++++++++++---------------
 docs/dev/table/connectors/formats/orc.zh.md | 49 +++++++--------
 2 files changed, 68 insertions(+), 77 deletions(-)

diff --git a/docs/dev/table/connectors/formats/csv.zh.md b/docs/dev/table/connectors/formats/csv.zh.md
index b34a1e8..d63aab5 100644
--- a/docs/dev/table/connectors/formats/csv.zh.md
+++ b/docs/dev/table/connectors/formats/csv.zh.md
@@ -29,21 +29,23 @@ under the License.
 * This will be replaced by the TOC
 {:toc}
 
-The [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) format allows to read and write CSV data based on an CSV schema. Currently, the CSV schema is derived from table schema.
+[CSV](https://zh.wikipedia.org/wiki/%E9%80%97%E5%8F%B7%E5%88%86%E9%9A%94%E5%80%BC) Format 允许我们基于 CSV schema 进行解析和生成 CSV 数据。 目前 CSV schema 是基于 table schema 推断而来的。
 
-Dependencies
+依赖
 ------------
 
-In order to setup the CSV format, the following table provides dependency information for both projects using a build automation tool (such as Maven or SBT) and SQL Client with SQL JAR bundles.
 
-| Maven dependency   | SQL Client JAR         |
+为了建立CSV格式,下列的表格提供了为项目使用自动化工具(例如Maven或者SBT)以及SQL客户端使用SQL JAR包的依赖信息。
+
+| Maven依赖           | SQL 客户端 JAR        |
 | :----------------- | :----------------------|
-| `flink-csv`        | Built-in               |
+| `flink-csv`        | 内置               |
 
-How to create a table with CSV format
+如何创建使用 CSV 格式的表
 ----------------
 
-Here is an example to create a table using Kafka connector and CSV format.
+
+以下是一个使用 Kafka 连接器和 CSV 格式创建表的示例。
 
 <div class="codetabs" markdown="1">
 <div data-lang="SQL" markdown="1">
@@ -67,116 +69,113 @@ CREATE TABLE user_behavior (
 </div>
 </div>
 
-Format Options
+Format 参数
 ----------------
 
 <table class="table table-bordered">
     <thead>
       <tr>
-        <th class="text-left" style="width: 25%">Option</th>
-        <th class="text-center" style="width: 8%">Required</th>
-        <th class="text-center" style="width: 7%">Default</th>
-        <th class="text-center" style="width: 10%">Type</th>
-        <th class="text-center" style="width: 50%">Description</th>
+        <th class="text-left" style="width: 25%">参数</th>
+        <th class="text-center" style="width: 10%">是否必选</th>
+        <th class="text-center" style="width: 10%">默认值</th>
+        <th class="text-center" style="width: 10%">类型</th>
+        <th class="text-center" style="width: 45%">描述</th>
       </tr>
     </thead>
     <tbody>
     <tr>
       <td><h5>format</h5></td>
-      <td>required</td>
+      <td>必选</td>
       <td style="word-wrap: break-word;">(none)</td>
       <td>String</td>
-      <td>Specify what format to use, here should be <code>'csv'</code>.</td>
+      <td>指定要使用的格式,这里应该是 <code>'csv'</code>。</td>
     </tr>
     <tr>
       <td><h5>csv.field-delimiter</h5></td>
-      <td>optional</td>
+      <td>可选</td>
       <td style="word-wrap: break-word;"><code>,</code></td>
       <td>String</td>
-      <td>Field delimiter character (<code>','</code> by default).</td>
+      <td>字段分隔符 (默认<code>','</code>)。</td>
     </tr>
     <tr>
       <td><h5>csv.line-delimiter</h5></td>
-      <td>optional</td>
+      <td>可选</td>
       <td style="word-wrap: break-word;"><code>\n</code></td>
       <td>String</td>
-      <td>Line delimiter, <code>\n</code> by default. Note the <code>\n</code> and <code>\r</code> are invisible special characters, you have to use unicode to specify them in plain SQL.
+      <td>行分隔符, 默认<code>\n</code>。注意 <code>\n</code> 和 <code>\r</code> 是不可见的特殊符号, 在显式的 SQL 语句中必须使用 unicode 编码。
           <ul>
-           <li>e.g. <code>'csv.line-delimiter' = U&'\\000D'</code> specifies the to use carriage return <code>\r</code> as line delimiter.</li>
-           <li>e.g. <code>'csv.line-delimiter' = U&'\\000A'</code> specifies the to use line feed <code>\n</code> as line delimiter.</li>
+           <li>例如 <code>'csv.line-delimiter' = U&'\\000D'</code> 使用换行符号 <code>\r</code> 作为行分隔符。</li>
+           <li>例如 <code>'csv.line-delimiter' = U&'\\000A'</code> 使用换行符号 <code>\n</code> 作为行分隔符。</li>
           </ul>
       </td>
     </tr>
     <tr>
       <td><h5>csv.disable-quote-character</h5></td>
-      <td>optional</td>
+      <td>可选</td>
       <td style="word-wrap: break-word;">false</td>
       <td>Boolean</td>
-      <td>Disabled quote character for enclosing field values (false by default).
-      If true, option <code>'csv.quote-character'</code> must be set.</td>
+      <td>关闭对引用的值使用引号 (默认是 false).如果允许,选项 <code>'csv.quote-character'</code> 必须被设置。</td>
     </tr>
     <tr>
       <td><h5>csv.quote-character</h5></td>
-      <td>optional</td>
+      <td>可选</td>
       <td style="word-wrap: break-word;"><code>"</code></td>
       <td>String</td>
-      <td>Quote character for enclosing field values (<code>"</code> by default).</td>
+      <td>用于围住字段值的引号字符 (默认<code>"</code>).</td>
     </tr>
     <tr>
       <td><h5>csv.allow-comments</h5></td>
-      <td>optional</td>
+      <td>可选</td>
       <td style="word-wrap: break-word;">false</td>
       <td>Boolean</td>
-      <td>Ignore comment lines that start with <code>'#'</code> (disabled by default).
-      If enabled, make sure to also ignore parse errors to allow empty rows.</td>
+      <td>是否允许忽略注释行(默认不允许),注释行以 <code>'#'</code> 作为起始字符。
+      如果允许注释行,请确保 <code>csv.ignore-parse-errors</code> 也开启了从而允许空行。 
+      </td>
     </tr>
     <tr>
       <td><h5>csv.ignore-parse-errors</h5></td>
-      <td>optional</td>
+      <td>可选</td>
       <td style="word-wrap: break-word;">false</td>
       <td>Boolean</td>
-      <td>Skip fields and rows with parse errors instead of failing.
-      Fields are set to null in case of errors.</td>
+    <td>当解析异常时,是跳过当前字段或行,还是抛出错误失败(默认为 false,即抛出错误失败)。如果忽略字段的解析异常,则会将该字段值设置为<code>null</code>。</td>
     </tr>
     <tr>
       <td><h5>csv.array-element-delimiter</h5></td>
-      <td>optional</td>
+      <td>可选</td>
       <td style="word-wrap: break-word;"><code>;</code></td>
       <td>String</td>
-      <td>Array element delimiter string for separating
-      array and row element values (<code>';'</code> by default).</td>
+      <td>分隔数组和行元素的字符串(默认<code>';'</code>).</td>
     </tr>
     <tr>
       <td><h5>csv.escape-character</h5></td>
-      <td>optional</td>
+      <td>可选</td>
       <td style="word-wrap: break-word;">(none)</td>
       <td>String</td>
-      <td>Escape character for escaping values (disabled by default).</td>
+      <td>转义字符(默认关闭).</td>
     </tr>
     <tr>
       <td><h5>csv.null-literal</h5></td>
-      <td>optional</td>
+      <td>可选</td>
       <td style="word-wrap: break-word;">(none)</td>
       <td>String</td>
-      <td>Null literal string that is interpreted as a null value (disabled by default).</td>
+      <td>是否将 "null" 字符串转化为 null 值。</td>
     </tr>
     </tbody>
 </table>
 
-Data Type Mapping
+数据类型映射
 ----------------
 
-Currently, the CSV schema is always derived from table schema. Explicitly defining an CSV schema is not supported yet.
+目前 CSV 的 schema 都是从 table schema 推断而来的。显式地定义 CSV schema 暂不支持。
+Flink 的 CSV Format 数据使用 [jackson databind API](https://github.com/FasterXML/jackson-databind) 去解析 CSV 字符串。
 
-Flink CSV format uses [jackson databind API](https://github.com/FasterXML/jackson-databind) to parse and generate CSV string.
-
-The following table lists the type mapping from Flink type to CSV type.
+下面的表格列出了flink数据和CSV数据的对应关系。
 
 <table class="table table-bordered">
     <thead>
       <tr>
-        <th class="text-left">Flink SQL type</th>
-        <th class="text-left">CSV type</th>
+        <th class="text-left">Flink SQL 类型</th>
+        <th class="text-left">CSV 类型</th>
       </tr>
     </thead>
     <tbody>
@@ -246,8 +245,3 @@ The following table lists the type mapping from Flink type to CSV type.
     </tr>
     </tbody>
 </table>
-
-
-
-
-
diff --git a/docs/dev/table/connectors/formats/orc.zh.md b/docs/dev/table/connectors/formats/orc.zh.md
index 4c878a4..03b73f8 100644
--- a/docs/dev/table/connectors/formats/orc.zh.md
+++ b/docs/dev/table/connectors/formats/orc.zh.md
@@ -26,25 +26,25 @@ under the License.
 <span class="label label-info">Format: Serialization Schema</span>
 <span class="label label-info">Format: Deserialization Schema</span>
 
-* This will be replaced by the TOC
+* This will be replaced by the TOC {:toc}
 {:toc}
 
-The [Apache Orc](https://orc.apache.org/) format allows to read and write Orc data.
+[Apache Orc](https://orc.apache.org/) Format 允许读写 ORC 数据。
 
-Dependencies
+依赖
 ------------
 
-In order to setup the Orc format, the following table provides dependency information for both
-projects using a build automation tool (such as Maven or SBT) and SQL Client with SQL JAR bundles.
+为了建立Orc格式,下列的表格提供了为项目使用自动化工具(例如Maven或者SBT)以及SQL客户端使用SQL JAR包的依赖信息。
 
-| Maven dependency   | SQL Client JAR         |
+| Maven 依赖         | SQL 客户端 JAR         |
 | :----------------- | :----------------------|
 | flink-orc{{site.scala_version_suffix}}        |{% if site.is_stable %}[Download](https://repo.maven.apache.org/maven2/org/apache/flink/flink-sql-orc{{site.scala_version_suffix}}/{{site.version}}/flink-sql-orc{{site.scala_version_suffix}}-{{site.version}}.jar) {% else %} Only available for stable releases {% endif %}|
 
-How to create a table with Orc format
+
+如何用 Orc 格式创建一个表格
 ----------------
 
-Here is an example to create a table using Filesystem connector and Orc format.
+下面是一个用 Filesystem connector 和 Orc format 创建表格的例子
 
 <div class="codetabs" markdown="1">
 <div data-lang="SQL" markdown="1">
@@ -65,45 +65,42 @@ CREATE TABLE user_behavior (
 </div>
 </div>
 
-Format Options
+Format 参数
 ----------------
 
 <table class="table table-bordered">
     <thead>
       <tr>
-        <th class="text-left" style="width: 25%">Option</th>
-        <th class="text-center" style="width: 8%">Required</th>
-        <th class="text-center" style="width: 7%">Default</th>
-        <th class="text-center" style="width: 10%">Type</th>
-        <th class="text-center" style="width: 50%">Description</th>
+        <th class="text-left" style="width: 25%">参数</th>
+        <th class="text-center" style="width: 10%">是否必选</th>
+        <th class="text-center" style="width: 10%">默认值</th>
+        <th class="text-center" style="width: 10%">类型</th>
+        <th class="text-center" style="width: 45%">描述</th>
       </tr>
     </thead>
     <tbody>
     <tr>
       <td><h5>format</h5></td>
-      <td>required</td>
+      <td>必选</td>
       <td style="word-wrap: break-word;">(none)</td>
       <td>String</td>
-      <td>Specify what format to use, here should be 'orc'.</td>
+      <td>指定要使用的格式,这里应该是 'orc'。</td>
     </tr>
     </tbody>
 </table>
 
-Orc format also supports table properties from [Table properties](https://orc.apache.org/docs/hive-config.html#table-properties).
-For example, you can configure `orc.compress=SNAPPY` to enable snappy compression.
+Orc 格式也支持来源于 [Table properties](https://orc.apache.org/docs/hive-config.html#table-properties) 的表属性。 举个例子,你可以设置 `orc.compress=SNAPPY` 来允许spappy压缩。
 
-Data Type Mapping
+数据类型映射
 ----------------
 
-Orc format type mapping is compatible with Apache Hive.
-The following table lists the type mapping from Flink type to Orc type.
-
+Orc 格式类型的映射和 Apache Hive 是兼容的。下面的表格列出了 Flink 类型的数据和 Orc 类型的数据的映射关系。
 <table class="table table-bordered">
     <thead>
       <tr>
-        <th class="text-left">Flink Data Type</th>
-        <th class="text-center">Orc physical type</th>
-        <th class="text-center">Orc logical type</th>
+        <th class="text-left">Flink 数据类型</th>
+        <th class="text-center">Orc 物理类型</th>
+        <th class="text-center">Orc 逻辑类型</th>
       </tr>
     </thead>
     <tbody>
@@ -180,4 +177,4 @@ The following table lists the type mapping from Flink type to Orc type.
     </tbody>
 </table>
 
-<span class="label label-danger">Attention</span> Composite data type: Array, Map and Row are not supported.
+<span class="label label-danger">注意</span> 复合数据类型: 数组、 映射和行类型暂不支持。