[common] Introduce MAP type for ARROW, COMPACTED and INDEXED formats #2190
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 #1973
Introduce MAP type support for INDEXED format, achieving feature parity with ARROW and COMPACTED formats for MAP data type handling.
Brief change log
readMap()method toIndexedRowReaderfor MAP type deserialization, following the same pattern asreadArray()UnsupportedOperationExceptionfor MAP type inIndexedRowReader.createFieldReader()InternalMapimport toIndexedRowReaderBinaryWriterTest.testCreateValueSetterForMapThrowsException()totestValueSetterWithMapType()- changed from exception test to positive validation testIndexedRowTest.assertAllTypeEquals()to include MAP type assertions (validates size, key array, value array, and null handling)IndexedRowReaderTest.assertAllTypeEqualsForReader()to verify MAP readingTests
Unit Tests:
IndexedRowTest(7 tests) - Validates MAP read/write operations with IndexedRowIndexedRowReaderTest(2 tests) - Validates MAP deserialization with IndexedRowReaderBinaryWriterTest(18 tests) - Validates MAP type ValueWriter creation and usageArrowReaderWriterTest(2 tests) - Confirms ARROW format MAP support continues to workCompactedRowTest(20 tests) - Confirms COMPACTED format MAP support continues to workTest Results: All 49 tests passed successfully (0 failures, 0 errors, 0 skipped)
Test Command:
mvn test -pl fluss-common -Dtest=IndexedRowTest,IndexedRowReaderTest,BinaryWriterTest,ArrowReaderWriterTest,CompactedRowTest -Dcheckstyle.skip=true -Dspotless.check.skip=true### API and Format
API: No breaking changes. This is purely additive functionality that removes an
UnsupportedOperationExceptionand enables existing MAP type infrastructure for INDEXED format.Storage Format: No format changes. The MAP storage format in INDEXED rows was already defined and uses the same
BinaryMapserialization mechanism as other formats. This change only enables reading MAP data that was already writeable.Documentation
No documentation changes required. This change brings INDEXED format to feature parity with ARROW and COMPACTED formats for MAP type support. MAP type usage is already documented in existing Fluss documentation. The change completes internal implementation of existing functionality rather than introducing new user-facing features.