Skip to content

Conversation

@ShashidharM0118
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

The Spark sha1 UDF was always marked nullable because it relied on the default nullability; Spark semantics require the output nullability to follow the input (or null scalar) instead.

What changes are included in this PR?

  • Implement return_field_from_args for SparkSha1 to report Utf8 with nullability derived from argument fields or null scalar args, and guard return_type.
  • Add a nullability unit test covering non-nullable input, nullable input, and null scalar cases.

Are these changes tested?

Yes,

Are there any user-facing changes?

No behavior change beyond correct nullability reporting for sha1 results.

Copilot AI review requested due to automatic review settings December 9, 2025 17:48
@github-actions github-actions bot added the spark label Dec 9, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the nullability reporting for the Spark sha1 UDF to correctly propagate nullability from input arguments and null scalar values, aligning with Spark semantics.

Key changes:

  • Implemented return_field_from_args method to compute output nullability based on input field nullability and null scalar arguments
  • Modified return_type to return an error directing callers to use return_field_from_args instead
  • Added comprehensive unit tests for nullability behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ShashidharM0118 ShashidharM0118 changed the title fix: spark sha1 nullability reporting” fix: spark sha1 nullability reporting Dec 12, 2025
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.

spark sha1 need to have custom nullability

1 participant