Skip to content

[hive] Support multiset type in hive writes - #9081

Merged
JingsongLi merged 1 commit into
apache:masterfrom
thswlsqls:fix/hive-schema-visitor-multiset-write
Aug 6, 2026
Merged

[hive] Support multiset type in hive writes#9081
JingsongLi merged 1 commit into
apache:masterfrom
thswlsqls:fix/hive-schema-visitor-multiset-write

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Purpose

fix #9078

  • [hive] Support multiset type in hive reads #8949 added multiset support to the read side (PaimonObjectInspectorFactory), but the write-side dispatcher SchemaVisitor.visit() branches on ROW/ARRAY/MAP only.
  • MULTISET falls through to default: visitor.primitive(...), so HiveDeserializer.primitive() throws ClassCastException: StandardMapObjectInspector cannot be cast to PrimitiveObjectInspector on the first row — reads work, writes do not.
  • Visit MULTISET as MapType(elementType, IntType), the mapping PaimonObjectInspectorFactory already uses. Other type branches are untouched.

Tests

  • Added PaimonSerDeTest#testSerializeMultiset: serializes id INT, tags MULTISET<STRING> through a Hive StandardStructObjectInspector and asserts the resulting InternalMap.
  • Reverting the fix fails only the new test, with the exception above; no existing test covered the multiset write path, so this cannot regress CI.
  • mvn -pl paimon-hive/paimon-hive-connector-common clean install — 101 unit tests and 83 *ITCase tests passed, including HiveWriteITCase.

SchemaVisitor dispatched MULTISET to the primitive branch, so writing a
multiset column through PaimonSerDe threw ClassCastException. Visit it as
a map from element to count, the same mapping the read side already uses.

Generated-by: Claude Code
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit 7913d74 into apache:master Aug 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants