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

   ## What is the purpose of the change
   
   Add the built-in function TO_NUMBER.
   Examples:
   ```SQL
   -- The format expects:
   --  * an optional sign at the beginning,
   --  * followed by a dollar sign,
   --  * followed by a number between 3 and 6 digits long,
   --  * thousands separators,
   --  * up to two dight beyond the decimal point.
   > SELECT TO_NUMBER('-$12,345.67', 'S$999,099.99');
    -12345.67
   
   -- Plus is optional, and so are fractional digits.
   > SELECT TO_NUMBER('$345', 'S$999,099.99');
    345.00
   
   -- The format requires at least three digits.
   > SELECT TO_NUMBER('$45', 'S$999,099.99');
    NULL
   
   -- The format requires at least three digits
   > SELECT TO_NUMBER('$045', 'S$999,099.99');
    45.00
   
   -- Using brackets to denote negative values
   > SELECT TO_NUMBER('<1234>', '999999PR');
    -1234
   ```
   
   ## Brief change log
   
   - [FLINK-36025](https://issues.apache.org/jira/browse/FLINK-36025)
   - Add `ToNumberTypeStrategy`
   - Add `NumberParser`
   - Fix doc issue of function PRINTF
   
   ## Verifying this change
   
   - `StringFunctionsITCase#toNumberTestCases`
   - `TypeStrategiesTest#testData`
   - `NumberParserTest`
   
   ## 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)
     - 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-unsubscr...@flink.apache.org

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

Reply via email to