You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ruanhang1993 (via GitHub)" <gi...@apache.org> on 2023/03/17 07:58:48 UTC

[GitHub] [flink] ruanhang1993 opened a new pull request, #22201: [FLINK-30959][table][doc-zh] Improve the documentation of UNIX_TIMESTAMP function for different argument formats

ruanhang1993 opened a new pull request, #22201:
URL: https://github.com/apache/flink/pull/22201

   ## What is the purpose of the change
   
   This pull request improves the documentation of UNIX_TIMESTAMP function for different argument formats for doc-zh.
   
   ## Brief change log
   
     - Modify the system functions doc-zh
   
   ## Verifying this change
   
   This change is a document change 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, 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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink] ruanhang1993 closed pull request #22201: [FLINK-30959][table][doc-zh] Improve the documentation of UNIX_TIMESTAMP function for different argument formats

Posted by "ruanhang1993 (via GitHub)" <gi...@apache.org>.
ruanhang1993 closed pull request #22201: [FLINK-30959][table][doc-zh] Improve the documentation of UNIX_TIMESTAMP function for different argument formats
URL: https://github.com/apache/flink/pull/22201


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink] flinkbot commented on pull request #22201: [FLINK-30959][table][doc-zh] Improve the documentation of UNIX_TIMESTAMP function for different argument formats

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #22201:
URL: https://github.com/apache/flink/pull/22201#issuecomment-1473335330

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3e131047f543222ef7b0ffdb381e9f4dd27c0e8e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "3e131047f543222ef7b0ffdb381e9f4dd27c0e8e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3e131047f543222ef7b0ffdb381e9f4dd27c0e8e UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink] ruanhang1993 commented on pull request #22201: [FLINK-30959][table][doc-zh] Improve the documentation of UNIX_TIMESTAMP function for different argument formats

Posted by "ruanhang1993 (via GitHub)" <gi...@apache.org>.
ruanhang1993 commented on PR #22201:
URL: https://github.com/apache/flink/pull/22201#issuecomment-1476182580

   Thanks for reviewing @leonardBang . 
   I have opened a new issue and I will raise a new PR for this.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink] leonardBang commented on a diff in pull request #22201: [FLINK-30959][table][doc-zh] Improve the documentation of UNIX_TIMESTAMP function for different argument formats

Posted by "leonardBang (via GitHub)" <gi...@apache.org>.
leonardBang commented on code in PR #22201:
URL: https://github.com/apache/flink/pull/22201#discussion_r1140032804


##########
docs/data/sql_functions_zh.yml:
##########
@@ -630,6 +630,23 @@ temporal:
     description: |
       使用表配置中指定的时区将格式为 string2 的日期时间字符串 string1(如果未指定默认情况下:yyyy-MM-dd HH:mm:ss)
       转换为 Unix 时间戳(以秒为单位)。
+      
+      如果日期时间字符串指定了时区并使用UTC+X的格式解析(例如:"yyyy-MM-dd HH:mm:ss.SSS X"),此函数将会使用日期
+      时间字符串中的时区来转换,而不是表配置的时区。
+      如果日期时间字符串无法正常解析,此函数将会默认返回Long.MIN_VALUE(即-9223372036854775808)作为结果。

Review Comment:
   ```suggestion
         如果时间戳字符串指定了时区并使用 UTC+X 的格式解析(例如:"yyyy-MM-dd HH:mm:ss.SSS X"),此函数将会使用时间戳字符串中的时区来转换,而不是 Flink 会话中所配置的时区。
         如果时间戳字符串无法正常解析,此函数将会默认返回 Long.MIN_VALUE(即: -9223372036854775808)作为结果。
   ```



##########
docs/data/sql_functions_zh.yml:
##########
@@ -630,6 +630,23 @@ temporal:
     description: |
       使用表配置中指定的时区将格式为 string2 的日期时间字符串 string1(如果未指定默认情况下:yyyy-MM-dd HH:mm:ss)
       转换为 Unix 时间戳(以秒为单位)。
+      
+      如果日期时间字符串指定了时区并使用UTC+X的格式解析(例如:"yyyy-MM-dd HH:mm:ss.SSS X"),此函数将会使用日期
+      时间字符串中的时区来转换,而不是表配置的时区。
+      如果日期时间字符串无法正常解析,此函数将会默认返回Long.MIN_VALUE(即-9223372036854775808)作为结果。
+
+      ```sql
+      Flink SQL> SET 'table.local-time-zone' = 'Europe/Berlin';
+
+      -- Returns 25201
+      Flink SQL> SELECT UNIX_TIMESTAMP('1970-01-01 08:00:01.001', 'yyyy-MM-dd HH:mm:ss.SSS');
+      -- Returns 1
+      Flink SQL> SELECT UNIX_TIMESTAMP('1970-01-01 08:00:01.001 +0800', 'yyyy-MM-dd HH:mm:ss.SSS X');
+      -- Returns 25201
+      Flink SQL> SELECT UNIX_TIMESTAMP('1970-01-01 08:00:01.001 +0800', 'yyyy-MM-dd HH:mm:ss.SSS');
+      -- Returns -9223372036854775808
+      Flink SQL> SELECT UNIX_TIMESTAMP('1970-01-01 08:00:01.001', 'yyyy-MM-dd HH:mm:ss.SSS X');

Review Comment:
   Returns -> 返回



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink] leonardBang commented on pull request #22201: [FLINK-30959][table][doc-zh] Improve the documentation of UNIX_TIMESTAMP function for different argument formats

Posted by "leonardBang (via GitHub)" <gi...@apache.org>.
leonardBang commented on PR #22201:
URL: https://github.com/apache/flink/pull/22201#issuecomment-1473599179

   @ruanhang1993 Could we can create a new JIRA issue to track the translation for all sql function?  I found some content of these function is outdated.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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