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

   ### What is the purpose of the change
   Implement` CAST` from `BINARY`/`VARBINART`/`BYTES `to `NUMBER`
   Implement` CAST` from `NUMBER` to `BINARY`/`VARBINART`/`BYTES ` 
   ### Brief change log
   ` CAST` from `BINARY`/`VARBINART`/`BYTES `to `NUMBER` for Table API and SQL
   ` CAST` from `NUMBER` to `BINARY`/`VARBINART`/`BYTES ` for Table API and SQL
   Syntax:
   `
   CAST(NUMBER AS BYTES)
   CAST(BYTEs AS NUMBER)
   `
   
   Examples:
   ```
   Flink SQL> select cast(cast('1234' as BYTES) as BIGINT);;
   res: 1234
   
   Flink SQL> select cast(cast('1234' as BYTES) as DOUBLE);
   res: 1234.0
   
   select cast(cast('123' as BYTES) as TINYINT);
   res: 123
   
   Flink SQL> select cast(cast('123' as BYTES) as INT);
   res:123
   
   Flink SQL> select cast(cast('123' as BYTES) as FLOAT);
   res:123.0
   
   Flink SQL> select cast(cast('123' as BYTES) as SMALLINT);
   res:123
   
   Flink SQL> select cast(1 as BYTES);
   res: x'31'
   
   Flink SQL> select cast(cast(1 as DOUBLE) as BYTES);
   res: x'312e30'
   
   Flink SQL> select cast(cast(1 as BIGINT) as BYTES);
   res: x'31'
   
   ```
   
   ### Verifying this change
   
   - This change added tests in CastFunctionITCase.
   
   ### 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