Skip to content

[SPARK-51842][SQL] Remove unnecessary judgement from fillDefaultValue #50633

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

beliefer
Copy link
Contributor

@beliefer beliefer commented Apr 18, 2025

What changes were proposed in this pull request?

This PR aims to remove unnecessary judgement from fillDefaultValue.

Why are the changes needed?

Currently, there is a judgement e.default == null while declaring fillDefaultValue.
After an investigation, there should not be a value of primitive type here. It might be a literal null even if users specify null as the default value.

Does this PR introduce any user-facing change?

'No'.

How was this patch tested?

GA.

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

No.

@github-actions github-actions bot added the SQL label Apr 18, 2025
@beliefer beliefer changed the title [Do not Merge][SQL] Investigate default is null [SPARK-51842][SQL] Remove unnecessary judgement from fillDefaultValue Apr 18, 2025
@beliefer
Copy link
Contributor Author

ping @cloud-fan cc @viirya

@the-sakthi
Copy link
Member

LGTM barring merge conflicts.

# Conflicts:
#	sql/core/src/main/scala/org/apache/spark/sql/execution/window/WindowFunctionFrame.scala
@beliefer beliefer force-pushed the investigate-default-is-null branch from f08cace to 4199285 Compare April 30, 2025 04:31
@@ -123,10 +123,7 @@ abstract class OffsetWindowFunctionFrameBase(
protected val fillDefaultValue = {
// Collect the expressions and bind them.
val boundExpressions = Seq.fill(ordinal)(NoOp) ++ expressions.toImmutableArraySeq.map { e =>
if (e.default == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not clear to me why this is not possible to happen, and I don't think it's worth the time to figure it out. This null check doesn't hurt at all.

Copy link
Contributor Author

@beliefer beliefer May 8, 2025

Choose a reason for hiding this comment

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

Got it. Maybe there is a chance in future. Let's hold this PR.

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