You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "fhueske (via GitHub)" <gi...@apache.org> on 2024/11/01 10:40:07 UTC

[PR] [FLINK-36642][table] Fix SQL names of built-in functions [flink]

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

   ## What is the purpose of the change
   
   Fix the SQL names of several built-in functions. 
   The names are used to serialize Table API expressions to SQL. Using wrong function names results in SQL statements that cannot be executed.
   
   ## Brief change log
   
   * add `sqlName()` to several `BuiltInFunctionDefinition` in `BuiltInFunctionDefinitions`
   * add test cases to `ExpressionSerializationTest`
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   * run `ExpressionSerializationTest` unit test
   
   ## 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)`: yes (`BuiltInFunctionDefinitions` is `@PublicEvolving`)
     - 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
   


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


Re: [PR] [FLINK-36642][table] Fix SQL names of built-in functions [flink]

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "e49564a2e36a43ac5a3cb4bd64c0470f3ec9c9df",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "e49564a2e36a43ac5a3cb4bd64c0470f3ec9c9df",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e49564a2e36a43ac5a3cb4bd64c0470f3ec9c9df 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


Re: [PR] [FLINK-36642][table] Fix SQL names of built-in functions [flink]

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


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/BuiltInFunctionDefinitions.java:
##########
@@ -2157,6 +2172,7 @@ ANY, and(logical(LogicalTypeRoot.BOOLEAN), LITERAL)
     public static final BuiltInFunctionDefinition CURRENT_ROW_TIMESTAMP =
             BuiltInFunctionDefinition.newBuilder()
                     .name("currentRowTimestamp")
+                    .name("CURRENT_ROW_TIMESTAMP")

Review Comment:
   Thanks Sergey! Fixed that 😄 



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


Re: [PR] [FLINK-36642][table] Fix SQL names of built-in functions [flink]

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

   +1 
   LGTM
   
   one minor thing: I noticed there is absent test for CURRENT_ROW_TIMESTAMP
   does it make sense to add it as well?


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


Re: [PR] [FLINK-36642][table] Fix SQL names of built-in functions [flink]

Posted by "fhueske (via GitHub)" <gi...@apache.org>.
fhueske merged PR #25601:
URL: https://github.com/apache/flink/pull/25601


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


Re: [PR] [FLINK-36642][table] Fix SQL names of built-in functions [flink]

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

   Thanks for the review @snuyanzin!
   I didn't add a test case for `CURRENT_ROW_TIMESTAMP` because there is no Table API expression for it yet.
   I fixed the SQL name to have it prepared once a Table API expression is added.
   But I can also remove it, if you prefer that.
   
   Thanks, Fabian


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


Re: [PR] [FLINK-36642][table] Fix SQL names of built-in functions [flink]

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

   ok, I see, thanks for clarification here


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


Re: [PR] [FLINK-36642][table] Fix SQL names of built-in functions [flink]

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


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/BuiltInFunctionDefinitions.java:
##########
@@ -2157,6 +2172,7 @@ ANY, and(logical(LogicalTypeRoot.BOOLEAN), LITERAL)
     public static final BuiltInFunctionDefinition CURRENT_ROW_TIMESTAMP =
             BuiltInFunctionDefinition.newBuilder()
                     .name("currentRowTimestamp")
+                    .name("CURRENT_ROW_TIMESTAMP")

Review Comment:
   ```suggestion
                       .sqlName("CURRENT_ROW_TIMESTAMP")
   ```
   ?



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