[Feature][Flink] Support Decimal Type with configurable precision and scale#5419
Merged
Merged
Conversation
5ae54bc to
a105c6c
Compare
a105c6c to
597616a
Compare
Contributor
Author
Contributor
Author
Contributor
Author
Contributor
Author
|
There are 3 failed jobs about zeta, please re-run failed jobs. @liugddx |
Member
Done. |
5 tasks
Contributor
Author
|
@liugddx @TyrantLucifer PTAL |
Member
Member
|
@s7monk PTAL |
Member
Member
|
Please fix conflicts. |
597616a to
2707c84
Compare
2707c84 to
769919a
Compare
Contributor
Author
I have fixed confilcts. PTAL @EricJoy2048 |
Contributor
Author
|
all-connectors-it-7 build failure, please re-run failed jobs. @EricJoy2048 |
EricJoy2048
approved these changes
Sep 25, 2023
gnehil
pushed a commit
to gnehil/seatunnel
that referenced
this pull request
Oct 12, 2023
4 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
SeaTunnelRowTypeto bypass the type conversion betweenTypeInformationandSeaTunnelDataType.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.