Skip to content

Comments

[SPARK-39818][SQL] Fix bug in ARRAY, STRUCT, MAP types with DEFAULT values with NULL field(s)#37229

Closed
dtenedor wants to merge 2 commits intoapache:masterfrom
dtenedor:fix-bug-sql
Closed

[SPARK-39818][SQL] Fix bug in ARRAY, STRUCT, MAP types with DEFAULT values with NULL field(s)#37229
dtenedor wants to merge 2 commits intoapache:masterfrom
dtenedor:fix-bug-sql

Conversation

@dtenedor
Copy link
Contributor

What changes were proposed in this pull request?

Fix bug in SQL string generation for literal values of ARRAY, STRUCT, MAP types with DEFAULT values with NULL field(s). Specifically, prevent Scala MatchErrors from getting raised when attempting to call the sql method of the Literal expression for such values when one of their fields is null.

Why are the changes needed?

This fixes a bug by preventing exceptions from being inappropriately raised.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

This PR adds new unit test coverage.

@github-actions github-actions bot added the SQL label Jul 19, 2022
@dtenedor
Copy link
Contributor Author

Hi @gengliangwang, sorry I created a bug recently. This PR fixes it for Apache Spark.

Copy link
Member

@gengliangwang gengliangwang left a comment

Choose a reason for hiding this comment

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

LGTM

@gengliangwang
Copy link
Member

Thanks, merging to master

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.

2 participants