Skip to content

Fix ClassCastException when reading MapType product column on Spark 4.x#177

Merged
jnioche merged 1 commit intomainfrom
fix/spark4-maptype-classcast
Apr 1, 2026
Merged

Fix ClassCastException when reading MapType product column on Spark 4.x#177
jnioche merged 1 commit intomainfrom
fix/spark4-maptype-classcast

Conversation

@jnioche
Copy link
Copy Markdown
Member

@jnioche jnioche commented Apr 1, 2026

Spark 4.x Parquet reader may represent MapType columns as a Seq of key-value Rows instead of a scala.collection.Map, causing Row.getJavaMap() to throw a ClassCastException. Replace all getJavaMap() calls on the product column with a shared Utils.getStringFromProductMap() helper that handles both representations.

Spark 4.x Parquet reader may represent MapType columns as a Seq of
key-value Rows instead of a scala.collection.Map, causing
Row.getJavaMap() to throw a ClassCastException. Replace all
getJavaMap() calls on the product column with a shared
Utils.getStringFromProductMap() helper that handles both
representations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jnioche jnioche added this to the 1.0 milestone Apr 1, 2026
@jnioche jnioche added the enhancement New feature or request label Apr 1, 2026
@jnioche jnioche merged commit ba1127e into main Apr 1, 2026
5 checks passed
@jnioche jnioche deleted the fix/spark4-maptype-classcast branch April 1, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant