You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "thswlsqls (via GitHub)" <gi...@apache.org> on 2026/08/06 10:49:51 UTC

[I] [Bug] Hive write of a multiset column fails with ClassCastException [paimon]

thswlsqls opened a new issue, #9078:
URL: https://github.com/apache/paimon/issues/9078

   **Search before asking**
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.
   
   **Paimon version**
   master @ a5e87ebf6 (2.1-SNAPSHOT)
   
   **Compute Engine**
   Hive
   
   **Minimal reproduce step**
   Create a Paimon table with a `MULTISET<STRING>` column, then insert one row from Hive:
   
   ```sql
   INSERT INTO t SELECT 1, map('apple', 2);
   ```
   
   `PaimonSerDe.initialize()` succeeds — the object inspector is `struct<id:int,tags:map<string,int>>`, because #8949 added `case MULTISET:` to `PaimonObjectInspectorFactory`. The first `serialize()` call then fails:
   
   ```
   java.lang.ClassCastException: StandardMapObjectInspector cannot be cast to PrimitiveObjectInspector
     at org.apache.paimon.hive.HiveDeserializer$DeserializerVisitor.lambda$primitive$0(HiveDeserializer.java:117)
   ```
   
   `SchemaVisitor.visit()` (SchemaVisitor.java line 56-96) branches on `ROW`, `ARRAY` and `MAP` only, so `MULTISET` falls through to `default: return visitor.primitive(type, partner)`.
   
   **What doesn't meet your expectations?**
   Expected: the row is written, as reading the same column already works.
   Actual: reads work but every write of a multiset column throws.
   
   **Anything else?**
   Fix: visit `MULTISET` as `MapType(elementType, IntType)` — the mapping `PaimonObjectInspectorFactory` already uses on the read side (#8949).
   
   **Are you willing to submit a PR?**
   - [x] I'm willing to submit a PR!
   


-- 
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: issues-unsubscribe@paimon.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Hive write of a multiset column fails with ClassCastException [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi closed issue #9078: [Bug] Hive write of a multiset column fails with ClassCastException
URL: https://github.com/apache/paimon/issues/9078


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org