-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature][Flink] Support Decimal Type with configurable precision and scale #5419
Conversation
5ae54bc
to
a105c6c
Compare
a105c6c
to
597616a
Compare
There are 3 failed jobs about zeta, please re-run failed jobs. @liugddx |
Done. |
@liugddx @TyrantLucifer PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@s7monk PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Please fix conflicts. |
597616a
to
2707c84
Compare
2707c84
to
769919a
Compare
I have fixed confilcts. PTAL @EricJoy2048 |
all-connectors-it-7 build failure, please re-run failed jobs. @EricJoy2048 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Purpose of this pull request
Motivation
Flink has two type systems: TypeInformation of DataSet/DataStream API, and LogicType of Table & SQL API. TypeInformation has some shortcomings. For example, precision and scale can not be defined for DECIMALs.
SeaTunnel has implemented a translation layer based on DataStream, which used TypeInformation type system.
Solution
To support configurable decimal type, there are two solutions.
1st SolutionThe 1st solution requires rewriting the translation layer based on Table & SQL API. But it will consume a lot of work and cause many code changes.
2nd Solution[Adopt]
The 2nd solution adopts the idea of type mapping and uses the String type as the carrier medium of Decimal. SeaTunnel restores the Decimal type field from String before processing the data, and converts the Decimal type field into String after completing the data processing. Because it cannot be inferred from the String type field of typeinformation whether it is a Decimal type field, this solution temporarily stores
SeaTunnelRowType
to bypass the type conversion betweenTypeInformation
andSeaTunnelDataType
.Because this solution does not require too much work and can guarantee the stability of the source code, I will adopt it.
Check list
New License Guide
release-note
.