Skip to content
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

Use implicit row constructors. Optionally skip nested rows. Nullability bug fixes. #64

Merged
merged 3 commits into from
Apr 9, 2024

Conversation

ryannedolan
Copy link
Collaborator

@ryannedolan ryannedolan commented Apr 1, 2024

Summary

TableResolver and DataType.Struct can now optionally skip nested Rows. This is useful for pipelines that can't handle complex record types.

ScriptImplementor will now replace explicit Row(...) constructors with implicit (...) row constructors, which is better supported by Flink before 1.18.

Added support for Avro arrays.

Small bug fixes related to nullability of Avro fields.

Details

Added dropNestedRows method to DataType.Struct. Added mapStruct method to TableResolver to enable applying this and similar data type transformations to rows. Adapters can use this as an easy way to deal with complex schemas.

Flink SQL prior to 1.18 doesn't support arbitrary expressions inside an explicit row constructor, so we now rewrite these using an implicit row constructor. This works when the number of elements in the row is more than one.

Added support for Avro arrays, and added a commented-out impl of Avro maps. Maps aren't un-parseable in this version of Calcite, so Avro maps will need to wait for a version bump.

Testing

New unit tests covering:

  • avro --> rel and rel --> type conversions with nested rows
  • nullability of nested avro rows
  • drop nested rows

Also, spot-tested in a Kafka-->Kafka pipeline.

@ryannedolan ryannedolan changed the title Support skipping nested Rows Support skipping nested rows and use implicit row constructors Apr 2, 2024
@ryannedolan ryannedolan changed the title Support skipping nested rows and use implicit row constructors Use implicit row constructors. Optionally skip nested rows. Nullability bug fixes. Apr 3, 2024
@ryannedolan ryannedolan enabled auto-merge (squash) April 9, 2024 17:51
@ryannedolan ryannedolan merged commit c3fa16a into main Apr 9, 2024
1 check passed
@ryannedolan ryannedolan deleted the skip-nested-rows branch April 9, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants