[fluss-client] Support Complex Data Types on the Java API (NestedRow/ROW)#2900
Open
XuQianJin-Stars wants to merge 1 commit intoapache:mainfrom
Open
[fluss-client] Support Complex Data Types on the Java API (NestedRow/ROW)#2900XuQianJin-Stars wants to merge 1 commit intoapache:mainfrom
XuQianJin-Stars wants to merge 1 commit intoapache:mainfrom
Conversation
Contributor
Author
|
@polyzos Hi, i already updated the pr. Please help review when you got some time. |
757d361 to
86551fa
Compare
…edRow/ROW) - Add ROW type support in PojoToRowConverter (POJO -> GenericRow) - Add ROW type support in RowToPojoConverter (InternalRow -> POJO) - Add ROW type validation in ConverterCommons - Add ROW element support in PojoTypeToFlussTypeConverter (for Array/Map) - Add ROW element support in FlussArrayToPojoArray (for Array<ROW>) - Add comprehensive tests for nested ROW, deeply nested ROW, ROW with Array/Map fields, Array<ROW>, Map<K, ROW>, null handling, and validation - Update java-client.md documentation with ROW type mapping and usage examples
86551fa to
12ead45
Compare
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
Linked issue: close #2805
This pull request extends the Java Typed API to support the
ROWdata type (nested POJO) in POJO ↔ InternalRow conversion, completing the complex type coverage alongside the already supportedARRAYandMAPtypes.Brief change log
ConverterCommons.java: AddedROWtype validation invalidateCompatibility()— ensures the POJO field for a ROW type is not a primitive, array, Collection, or Map. Detailed field-level validation is deferred to the nested converter.PojoToRowConverter.java: Addedcase ROW:increateFieldConverter()— recursively creates a nestedPojoToRowConverterto convert a nested POJO field into aGenericRow.RowToPojoConverter.java: Addedcase ROW:increateRowReader()— recursively creates a nestedRowToPojoConverterto convert anInternalRowback into a nested POJO.PojoTypeToFlussTypeConverter.java: Addedcase ROW:inconvertElementValue()— supports serializing nested ROW elements withinARRAYandMAPtypes.FlussArrayToPojoArray.java: Addedcase ROW:inbuildElementConverter()— supports deserializing ROW elements within arrays. Falls back to returning rawInternalRowwhen the target POJO type isObject.class(due to Java type erasure in MAP values).java-client.md: AddedROW → Nested POJOentry to the type mapping table and a new "Nested POJOs (ROW Type)" documentation section with usage examples and a note about the Java type erasure limitation forMAP<K, ROW>.Tests
NestedRowConverterTest#testSimpleNestedRowRoundTrip— basic POJO with a nested ROW field, roundtrip serialization/deserializationNestedRowConverterTest#testNullNestedRow— null nested POJO is correctly handledNestedRowConverterTest#testDeeplyNestedRowRoundTrip— two-level deep nesting (POJO → ROW → ROW)NestedRowConverterTest#testNestedRowWithArrayFieldRoundTrip— nested POJO containing anARRAY<INT>fieldNestedRowConverterTest#testNestedRowWithMapFieldRoundTrip— nested POJO containing aMAP<STRING, INT>fieldNestedRowConverterTest#testArrayOfNestedRowRoundTrip— top-levelARRAY<ROW<...>>mapped to a POJO arrayNestedRowConverterTest#testMapWithRowValuesRoundTrip—MAP<STRING, ROW<...>>with type erasure fallback (values deserialized asInternalRow)NestedRowConverterTest#testRowFieldWithIncompatibleType— validates that an array type field is rejected when mapped to ROWNestedRowConverterTest#testRowFieldWithMapType— validates that a Map type field is rejected when mapped to ROWAPI and Format
No. This change only adds internal converter logic for the existing
ROWdata type. No public API or storage format changes.Documentation
Updated
website/docs/apis/java-client.md:ROW | Nested POJOto the type mapping tableARRAY<ROW>, andMAP<String, ROW>usage