kwonder0926 commented on PR #463: URL: https://github.com/apache/doris-flink-connector/pull/463#issuecomment-2800690000
@bingquanzhao @JNSimba Hello! I stumbled upon a potential issue while browsing this pull request. The code suggests that int types (such as BIGINT, INT, SMALLINT, TINYINT from DorisType) will be converted to Decimal type. Here’s the specific code snippet: ```java private static final List<String> CONVERT_TYPE = Arrays.asList(DorisType.BIGINT, DorisType.INT, DorisType.SMALLINT, DorisType.TINYINT); ... if (existDecimal && isDecimal) { return DecimalJudgement.CERTAIN_DECIMAL; } else if (CONVERT_TYPE.contains(dorisType)) { return DecimalJudgement.CONVERT_TO_DECIMAL; } ``` This conversion might not be reasonable in certain cases. For example, if the initial table has a small amount of data and an int-type field with all values below 1000, after conversion to Decimal, the numerical length will be limited to 3 digits, as shown below: ```java if (decimalJudgement == DecimalJudgement.CONVERT_TO_DECIMAL) { int precision = value.toString().length(); dorisType = MongoDBType.formatDecimalType(precision, 0); } ``` If the precision of the data changes with the business and the field value exceeds 1000, the integer will lose precision due to the length limitation. I am currently facing this issue and hope to bring it to attention and find a suitable solution. -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org