[SPARK-59273][SQL][FOLLOWUP] Skip non-string columns in fill - #58647
Closed
zhangxinyao88 wants to merge 1 commit into
Closed
zhangxinyao88 wants to merge 1 commit into
zhangxinyao88 wants to merge 1 commit into
Conversation
uros-b
reviewed
Sep 9, 2026
uros-b
left a comment
Member
There was a problem hiding this comment.
@zhangxinyao88 Is this fix still relevant? If so, please resolve conflicts.
Member
|
Seems like this was superseded by #58646 (already merged). Shall we close the current PR @zhangxinyao88? |
Author
|
Thanks, #58646 covers the same regression and is now in master. Closing this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Restore
DataFrameNaFunctions.fillValuebehavior for string replacements: non-string columns are skipped rather than falling through to an exception.The existing SPARK-59273 CHAR/VARCHAR test now also includes an integer column, ensuring
na.fill("x")fills the string-family columns while leaving the integer column unchanged.Why are the changes needed?
SPARK-59273 changed the string match from exact
StringTypeequality to aStringTypesubtype match so CHAR and VARCHAR columns are included. Without a fallback for other column types, a normal mixed string/integer DataFrame throwsStringType is not matched at fillValue. This regressesna.fill("x")in Scala, PySpark, SparkR, and Connect tests.Does this PR introduce any user-facing change?
Yes. It restores the existing behavior of
DataFrame.na.fill("...")on DataFrames that contain both string-family and non-string columns.How was this patch tested?
./build/sbt -Phadoop-3 -Dsbt.supershell=false 'sql/testOnly org.apache.spark.sql.DataFrameNaFunctionsSuite -- -z "fill"'\n\n### Was this patch authored or co-authored using generative AI tooling?\n\nGenerated-by: Codex (GPT-5)