Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[SPARK-55708][SQL] TransformingEncoder with primitive inside OptionEncoder#54506

Open
eejbyfeldt wants to merge 1 commit intoapache:masterfrom
eejbyfeldt:SPARK-55708
Open

[SPARK-55708][SQL] TransformingEncoder with primitive inside OptionEncoder#54506
eejbyfeldt wants to merge 1 commit intoapache:masterfrom
eejbyfeldt:SPARK-55708

Conversation

Copy link
Contributor

eejbyfeldt commented Feb 26, 2026 *
edited
Loading

What changes were proposed in this pull request?

Make it possible to use TransformingEncoder from a primitive type and have that inside an OptionEncoder.

Supports for primitives using TransformingEncoder was initially improved in #51313 but it was missed that it did not work inside an OptionEncoder. The fix here also cleans up how javaClassToPrimitiveType is computed, it was missed that the values in typeJavaMapping are not unique and the previous code would assign wrong types for some classes.

Why are the changes needed?

To make the AgnosticEncoders as flexible as Expression based encoders were, this will allow libraries providing custom encoders to move to Spark 4.0.0 and beyond.

Does this PR introduce any user-facing change?

Yes, libraries trying to derive custom encoders with have more flexibility.

How was this patch tested?

Existing and new unittests.

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

No.

Fix bug when a transformingEncoder from primitive is used inside an
OptionEncoder.
eejbyfeldt marked this pull request as ready for review February 26, 2026 13:59
Copy link
Contributor Author

eejbyfeldt commented Feb 26, 2026

@hvanhovell @chris-twiner here is another issue I ran into trying to move to the AgnosticEncoders. Would be great if someone could have review.

eejbyfeldt changed the title SPARK-55708: TransformingEncoder with primitive inside OptionEncoder [SPARK-55708][SQL] TransformingEncoder with primitive inside OptionEncoder Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant