-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Flink: Add decimal write/read roundtrip test for FlinkParquetReaders #16346
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,8 @@ | |
| */ | ||
| class DataGenerators { | ||
|
|
||
| static final DataGenerator[] ALL = new DataGenerator[] {new StructOfPrimitive()}; | ||
| static final DataGenerator[] ALL = | ||
| new DataGenerator[] {new StructOfPrimitive(), new StructWithDecimals()}; | ||
|
|
||
| private DataGenerators() {} | ||
|
|
||
|
|
@@ -50,6 +51,20 @@ public Schema schema() { | |
| } | ||
| } | ||
|
|
||
| static class StructWithDecimals implements DataGenerator { | ||
| private final Schema schema = | ||
| new Schema( | ||
| required(1, "row_id", Types.StringType.get()), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No — |
||
| required(2, "dec_9_2", Types.DecimalType.of(9, 2)), | ||
| required(3, "dec_15_3", Types.DecimalType.of(15, 3)), | ||
| required(4, "dec_38_10", Types.DecimalType.of(38, 10))); | ||
|
|
||
| @Override | ||
| public Schema schema() { | ||
| return schema; | ||
| } | ||
| } | ||
|
|
||
| static class DefaultSchema implements DataGenerator { | ||
| private final Schema schema = | ||
| new Schema( | ||
|
|
||
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.
This is
DecimalsThere 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.
Good catch — there's no nested struct here, so
StructWithDecimalswas a misleading name. Renamed the class toDecimals(and updated theALLarray) in 5dc4b5d.