loserwang1024 opened a new pull request, #3150:
URL: https://github.com/apache/flink-cdc/pull/3150

   ### What's the problem
   Flink only have bigint type, if mysql data is unsigned bigint , maybe out of 
range, so cast to DECIMAL(20, 0).
   
   If starrocks supports unsigned bigint, maybe can transform DECIMAL(20, 0) to 
unsigned bigint in sink. To be honest, unsigned bigint is not in SQL standard, 
thus many databases maybe not support it. 
https://docs.starrocks.io/zh/docs/sql-reference/sql-statements/data-types/data-type-list/
   
   And starrock not support DECIMAL as primary key, thus should be transformed 
to String.
   
   ### How to solve
   StarRocks is not support Decimal as primary key, so decimal should be cast 
to INT, BIGINT, LARGEINT or VARHCAR.
   If scale == 0, cast parse to  INT, BIGINT, LARGEINT
   * Int is range from [-2,147,483,648, 2,147,483,647], some data with 
precision of 10 is out of range.
   * BigInt is range from 
[-9,223.372,036,854,775,808~9,223.372,036,854,775,807], some data with 
precision of 19 is out of range.(like unsigned big int from mysql)
   * LargeInt is range from [-1.701411835E38 ~ 1.701411835E38], some data with 
precision of 38 is out of range.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to