Use implicit row constructors. Optionally skip nested rows. Nullability bug fixes. #64
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.
Summary
TableResolver
andDataType.Struct
can now optionally skip nestedRow
s. This is useful for pipelines that can't handle complex record types.ScriptImplementor
will now replace explicitRow(...)
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 toDataType.Struct
. AddedmapStruct
method toTableResolver
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:
Also, spot-tested in a Kafka-->Kafka pipeline.