-
Notifications
You must be signed in to change notification settings - Fork 3k
Arrow: test case for fixed type #13700
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
Conversation
|
@nastra: In #3029 you were working on the Fixed type, but abandoned it, because
OTOH, the Fixed type seems to be supported by the Arrow reader. Thanks, |
Back then I wasn't sure whether we could just remove |
| * Types.FixedType} and {@link Types.DecimalType} See | ||
| * https://github.com/apache/iceberg/issues/2485 and | ||
| * <li>Data types: {@link Types.ListType}, {@link Types.MapType}, {@link Types.StructType}, and | ||
| * {@link Types.DecimalType} See https://github.com/apache/iceberg/issues/2485 and |
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.
decimal type support also exists already, so we can remove that comment
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.
Yes, that's right, I remove this comment in my other PR: #13562
| rec.setField("uuid_nullable", uuid); | ||
| rec.setField("decimal", new BigDecimal("14.0" + i % 10)); | ||
| rec.setField("decimal_nullable", new BigDecimal("14.0" + i % 10)); | ||
| rec.setField("fixed", new byte[] {1, 2, 3, 4, 5, 6, (byte) i}); |
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.
nit: I'd maybe just define a string and convert it to its binary representation (same as we do a few lines above for bytes:
rec.setField("fixed", ("abc" + i).getBytes(StandardCharsets.UTF_8));
rec.setField("fixed_nullable", ("abcdef" + i).getBytes(StandardCharsets.UTF_8));
| rec.setField("uuid_nullable", uuid); | ||
| rec.setField("decimal", new BigDecimal("14.20")); | ||
| rec.setField("decimal_nullable", new BigDecimal("14.20")); | ||
| rec.setField("fixed", new byte[] {1, 2, 3, 4, 5, 6, 7}); |
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.
| rec.setField("fixed", new byte[] {1, 2, 3, 4, 5, 6, 7}); | |
| rec.setField("fixed", "abcd".getBytes(StandardCharsets.UTF_8)); |
| Types.NestedField.required(26, "decimal", Types.DecimalType.of(9, 2)), | ||
| Types.NestedField.optional(27, "decimal_nullable", Types.DecimalType.of(9, 2))); | ||
| Types.NestedField.optional(27, "decimal_nullable", Types.DecimalType.of(9, 2)), | ||
| Types.NestedField.required(28, "fixed", Types.FixedType.ofLength(7)), |
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.
nit: maybe also use different lengths for both fields
nastra
left a comment
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 with a few comments
No description provided.