thswlsqls opened a new pull request, #9066:
URL: https://github.com/apache/paimon/pull/9066

   
   ### Purpose
   
   fix #9064
   
   - `AvroSchemaConverter` handles `MULTISET` and `MAP` in one branch, so a 
non-string element gets the array-of-record encoding.
   - `AvroSchemaVisitor.visit()` recognized only `MapType` in its `ARRAY` 
branch and cast everything else to the `final` class `ArrayType`, so any 
`MULTISET` with a non-string element threw `ClassCastException` on write and 
read, even though `validateDataFields` passed. ORC and Parquet already accept 
that schema.
   - Reuse the converter's 
`extractKeyTypeToAvroMap`/`extractValueTypeToAvroMap` there, keeping schema 
creation and visiting on one source. The converter is untouched, so the written 
encoding is unchanged.
   - Correct the avro `MAP`/`MULTISET` rows in `fileformat.md`: the `MAP` row 
says the key must be a string type, but `FormatReadWriteTest`'s `nonStrKeyMap = 
MAP(INT, ...)` already passes on avro.
   
   ### Tests
   
   - Added `AvroFormatReadWriteTest#testMultisetWithNonStringElement` (round 
trip; throws without the fix) and `#testMultisetWithStringElement` (regression 
guard).
   - `mvn -pl paimon-format -DfailIfNoTests=false clean install` — 531 tests 
passed, 0 failures. No existing test used `MULTISET`.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to