You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/08/07 07:32:34 UTC

[GitHub] [flink] dianfu opened a new pull request #13084: [FLINK-18847][docs][python] Add documentation about data types in Python Table API

dianfu opened a new pull request #13084:
URL: https://github.com/apache/flink/pull/13084


   
   ## What is the purpose of the change
   
   *This pull request add documentation about data types in Python Table API*
   
   ## Brief change log
   
     - *Add documentation about data types in Python Table API*
   
   
   ## Verifying this change
   
   This change is a documentation rework without any test coverage.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] dianfu closed pull request #13084: [FLINK-18847][docs][python] Add documentation about data types in Python Table API

Posted by GitBox <gi...@apache.org>.
dianfu closed pull request #13084:
URL: https://github.com/apache/flink/pull/13084


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #13084: [FLINK-18847][docs][python] Add documentation about data types in Python Table API

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13084:
URL: https://github.com/apache/flink/pull/13084#issuecomment-670378544


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8e32bc6b48a920108127fed3277a0225ec2b9abd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8e32bc6b48a920108127fed3277a0225ec2b9abd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8e32bc6b48a920108127fed3277a0225ec2b9abd UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] WeiZhong94 commented on a change in pull request #13084: [FLINK-18847][docs][python] Add documentation about data types in Python Table API

Posted by GitBox <gi...@apache.org>.
WeiZhong94 commented on a change in pull request #13084:
URL: https://github.com/apache/flink/pull/13084#discussion_r466900408



##########
File path: docs/dev/table/python/python_types.md
##########
@@ -0,0 +1,74 @@
+---
+title: "Python Data Types"
+nav-parent_id: python_tableapi
+nav-pos: 15
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+This page describes the data types supported in PyFlink Table API.
+
+* This will be replaced by the TOC
+{:toc}
+
+Data Type
+---------
+
+A *data type* describes the logical type of a value in the table ecosystem. It can be used to declare input and/or
+output types of Python user-defined functions. Users of the Python Table API work with instances of
+`pyflink.table.types.DataType` within the Python Table API or when defining user-defined functions.
+
+A `DataType` instance declares the **logical type** which does not imply a concrete physical representation for transmission
+or storage. All pre-defined data types are available in `pyflink.table.types` and can be instantiated with the utility methods
+defined in `pyflink.table.types.DataTypes`.
+
+A list of all pre-defined data types can be found [below]({{ site.baseurl }}/dev/table/types.html#list-of-data-types).
+
+Data Type and Python type mapping

Review comment:
       Capitalize the first letter?

##########
File path: docs/dev/table/types.zh.md
##########
@@ -397,6 +438,21 @@ DataTypes.DECIMAL(p, s)
 |`java.math.BigDecimal`                    | X     | X      | *缺省*               |
 |`org.apache.flink.table.data.DecimalData` | X     | X      | 内部数据结构。 |
 
+</div>
+
+<div data-lang="Python" markdown="1">
+{% highlight python %}
+DataTypes.DECIMAL(p, s)
+{% endhighlight %}
+
+<span class="label label-danger">注意</span> 当前,声明`DataTypes.DECIMAL(p, s)`中的所指定的精度 `p` 必须为38,尾数 `n` 必须为 `18`。

Review comment:
       38 -> \`38\`?

##########
File path: docs/dev/table/types.zh.md
##########
@@ -698,6 +797,21 @@ DataTypes.TIMESTAMP(p)
 |`java.sql.Timestamp`                        | X     | X      |                                   |
 |`org.apache.flink.table.data.TimestampData` | X     | X      | 内部数据结构。                      |
 
+</div>
+
+<div data-lang="Python" markdown="1">
+{% highlight python %}
+DataTypes.TIMESTAMP(p)
+{% endhighlight %}
+
+<span class="label label-danger">注意</span> 当前,声明`DataTypes.TIMESTAMP(p)`中的所指定的精度 `p` 必须为3。

Review comment:
       ditto

##########
File path: docs/dev/table/types.zh.md
##########
@@ -656,6 +749,19 @@ DataTypes.TIME(p)
 |`java.lang.Long`      | X     | X      | 描述自当天以来的纳秒数。     |
 |`long`                | X     | (X)    | 描述自当天以来的纳秒数。<br>仅当类型不可为空时才输出。 |
 
+</div>
+
+<div data-lang="Python" markdown="1">
+{% highlight python %}
+DataTypes.TIME(p)
+{% endhighlight %}
+
+<span class="label label-danger">注意</span> 当前,声明`DataTypes.TIME(p)`中的所指定的精度 `p` 必须为0。

Review comment:
       0 -> \`0\`?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] dianfu commented on pull request #13084: [FLINK-18847][docs][python] Add documentation about data types in Python Table API

Posted by GitBox <gi...@apache.org>.
dianfu commented on pull request #13084:
URL: https://github.com/apache/flink/pull/13084#issuecomment-671178507


   @WeiZhong94 Thanks for the review. Will fix the comments when merging the PR.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] WeiZhong94 commented on a change in pull request #13084: [FLINK-18847][docs][python] Add documentation about data types in Python Table API

Posted by GitBox <gi...@apache.org>.
WeiZhong94 commented on a change in pull request #13084:
URL: https://github.com/apache/flink/pull/13084#discussion_r467670215



##########
File path: docs/dev/table/python/python_types.md
##########
@@ -0,0 +1,74 @@
+---
+title: "Python Data Types"
+nav-parent_id: python_tableapi
+nav-pos: 15
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+This page describes the data types supported in PyFlink Table API.
+
+* This will be replaced by the TOC
+{:toc}
+
+Data Type
+---------
+
+A *data type* describes the logical type of a value in the table ecosystem. It can be used to declare input and/or
+output types of Python user-defined functions. Users of the Python Table API work with instances of
+`pyflink.table.types.DataType` within the Python Table API or when defining user-defined functions.
+
+A `DataType` instance declares the **logical type** which does not imply a concrete physical representation for transmission
+or storage. All pre-defined data types are available in `pyflink.table.types` and can be instantiated with the utility methods
+defined in `pyflink.table.types.DataTypes`.
+
+A list of all pre-defined data types can be found [below]({{ site.baseurl }}/dev/table/types.html#list-of-data-types).
+
+Data Type and Python type mapping

Review comment:
       type mapping -> Type Mapping ?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13084: [FLINK-18847][docs][python] Add documentation about data types in Python Table API

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13084:
URL: https://github.com/apache/flink/pull/13084#issuecomment-670378544


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8e32bc6b48a920108127fed3277a0225ec2b9abd",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5275",
       "triggerID" : "8e32bc6b48a920108127fed3277a0225ec2b9abd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8e32bc6b48a920108127fed3277a0225ec2b9abd Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5275) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #13084: [FLINK-18847][docs][python] Add documentation about data types in Python Table API

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13084:
URL: https://github.com/apache/flink/pull/13084#issuecomment-670376080


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 8e32bc6b48a920108127fed3277a0225ec2b9abd (Fri Aug 07 07:34:07 UTC 2020)
   
    ✅no warnings
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org