[Feature][SQL Transform] Check SQL Cast will fail or not during the SQL parsing stage#9600
Conversation
- 移除了 SystemFunction 中不必要的类型转换逻辑 - 在 ZetaSQLType 中增加了对不同数据类型转换的限制
|
Thanks @liuwei178 . Please follow the guide to open CI on your fork repository. https://github.com/apache/seatunnel/pull/9600/checks?check_run_id=46369080578 |
|
i added the test and enabled the CI. Please take some time to review them when you're available @Hisoka-X |
Please retrigger the failed ci. Thanks |
| public static final String TIME = "TIME"; | ||
| public static final String BOOLEAN = "BOOLEAN"; | ||
|
|
||
| public static final List<SqlType> DATETIME_CAST_TYPES = |
There was a problem hiding this comment.
Thanks @liuwei178 . Can we refactor it and move the cast-related logic and validation rules into separate classes?
There was a problem hiding this comment.
Okay, I'll refactor it as soon as possible
There was a problem hiding this comment.
@Hisoka-X hi,Please help check which parts still need to adjust
-Added CastFunction class to handle type conversion operations -Optimized type conversion logic to support more data type conversions
-add long type
| return BasicType.STRING_TYPE; | ||
| case BYTE: | ||
| case TINYINT: | ||
| if (SqlType.TINYINT.equals(originType) || SqlType.STRING.equals(originType)) { |
There was a problem hiding this comment.
For validation types, are they referring to the types that we currently have the capability to convert?
There was a problem hiding this comment.
Yes, these are just some pre-validation steps added to our existing capabilities, for example, when converting Timestamp to SMALLINT is illegal. @Carl-Zhou-CN
Link to #9538
There was a problem hiding this comment.
Ok. Thank you for your answer


Purpose of this pull request
Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide