You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "dylanhz (via GitHub)" <gi...@apache.org> on 2024/08/06 02:41:05 UTC

[PR] [FLINK-35964][table] Add the built-in function STARTSWITH [flink]

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

   ## What is the purpose of the change
   
   Add the built-in function STARTSWITH.
   Examples:
   ```SQL
   > SELECT STARTSWITH('SparkSQL', 'Spark');
    true
   > SELECT STARTSWITH('SparkSQL', 'spark');
    false
   ```
   
   ## Brief change log
   
   [FLINK-35964](https://issues.apache.org/jira/browse/FLINK-35964)
   
   ## Verifying this change
   
   `StringFunctionsITCase#startswithTestCases`
   
   ## 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? (yes)
     - If yes, how is the feature documented? (docs)
   


-- 
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-35964][table] Add the built-in function STARTSWITH & ENDSWITH [flink]

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

   @flinkbot run azure


-- 
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-35964][table] Add the built-in function STARTSWITH & ENDSWITH [flink]

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


-- 
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-35964][table] Add the built-in function STARTSWITH [flink]

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

   @flinkbot run azure


-- 
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-35964][table] Add the built-in function STARTSWITH [flink]

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7c21f6231604599aa8e17bde284791ccef23625e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "7c21f6231604599aa8e17bde284791ccef23625e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7c21f6231604599aa8e17bde284791ccef23625e 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-35964][table] Add the built-in function STARTSWITH & ENDSWITH [flink]

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

   The failed case `LeftOuterJoinTaskTest#testCancelLeftOuterJoinTaskWhileBuilding` in core moulde looks weird...


-- 
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-35964][table] Add the built-in function STARTSWITH & ENDSWITH [flink]

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

   @flinkbot run azure


-- 
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-35964][table] Add the built-in function STARTSWITH & ENDSWITH [flink]

Posted by "lincoln-lil (via GitHub)" <gi...@apache.org>.
lincoln-lil commented on code in PR #25156:
URL: https://github.com/apache/flink/pull/25156#discussion_r1730692658


##########
flink-python/pyflink/table/expression.py:
##########
@@ -1028,6 +1028,16 @@ def truncate(self, n: Union[int, 'Expression[int]'] = 0) -> 'Expression[T]':
 
     # ---------------------------- string functions ----------------------------------
 
+    def starts_with(self, start_expr) -> 'Expression':
+        """
+        Returns if expr begins with start_expr. If start_expr is empty, the result is true.

Review Comment:
   ditto



##########
docs/data/sql_functions.yml:
##########
@@ -329,6 +329,18 @@ string:
       STRING1.overlay(STRING2, INT1)
       STRING1.overlay(STRING2, INT1, INT2)
     description: Returns a string that replaces INT2 (STRING2's length by default) characters of STRING1 with STRING2 from position INT1. E.g., 'xxxxxtest'.overlay('xxxx', 6) returns "xxxxxxxxx"; 'xxxxxtest'.overlay('xxxx', 6, 2) returns "xxxxxxxxxst".
+  - sql: STARTSWITH(expr, startExpr)
+    table: expr.startsWith(startExpr)
+    description: |
+      Returns if expr begins with startExpr. If startExpr is empty, the result is true.

Review Comment:
   -> "Returns whether expr starts with startExpr" ?



##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/BaseExpressions.java:
##########
@@ -846,6 +847,19 @@ public OutType truncate() {
 
     // String operations
 
+    /**
+     * Returns if {@code expr} begins with {@code startExpr}. If {@code startExpr} is empty, the

Review Comment:
   ditto



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