Skip to content

[SPARK-52651][SQL] Handle User Defined Type in Nested ColumnVector #51349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

yaooqinn
Copy link
Member

@yaooqinn yaooqinn commented Jul 2, 2025

What changes were proposed in this pull request?

When I read a map column with a UDT nested, I encountered:

Caused by: java.lang.IllegalArgumentException: Spark type: ... doesn't match the type: ... in column vector
	at org.apache.spark.sql.execution.datasources.parquet.ParquetColumnVector.<init>(ParquetColumnVector.java:80)
	at org.apache.spark.sql.execution.datasources.parquet.ParquetColumnVector.<init>(ParquetColumnVector.java:139)

This PR adds a recursive loop to omit the UDT

Why are the changes needed?

Add UDT missing features

Does this PR introduce any user-facing change?

No

How was this patch tested?

New Tests

Was this patch authored or co-authored using generative AI tooling?

no

@github-actions github-actions bot added the SQL label Jul 2, 2025
@@ -196,8 +196,7 @@ class ParquetToSparkSchemaConverter(
field: ColumnIO,
sparkReadType: Option[DataType] = None): ParquetColumn = {
val targetType = sparkReadType.map {
case udt: UserDefinedType[_] => udt.sqlType
case otherType => otherType
_.transformRecursively { case t: UserDefinedType[_] => t.sqlType }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question. What about ORC file format?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dongjoon-hyun, good question. I have an umbrella ticket for udt improvements. Let me check other formats or readers with followups if necessary

@dongjoon-hyun
Copy link
Member

cc @peter-toth

@yaooqinn yaooqinn closed this in 0c6d7fd Jul 3, 2025
@yaooqinn yaooqinn deleted the SPARK-52651 branch July 3, 2025 01:49
@yaooqinn
Copy link
Member Author

yaooqinn commented Jul 3, 2025

Merged to master, thank you @dongjoon-hyun @peter-toth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants