Skip to content

Conversation

@rishvin
Copy link
Contributor

@rishvin rishvin commented Aug 21, 2025

Which issue does this PR close?

Closes #2193

Rationale for this change

With a recent change, the Sha2 fallback message is now not very user-friendly. This PR brings back the older message.

What changes are included in this PR?

A simple fallback message change.

How are these changes tested?

N/A

@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 58.55%. Comparing base (f09f8af) to head (db66e64).
⚠️ Report is 406 commits behind head on main.

Files with missing lines Patch % Lines
...k/src/main/scala/org/apache/comet/serde/hash.scala 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2213      +/-   ##
============================================
+ Coverage     56.12%   58.55%   +2.43%     
- Complexity      976     1283     +307     
============================================
  Files           119      143      +24     
  Lines         11743    13226    +1483     
  Branches       2251     2363     +112     
============================================
+ Hits           6591     7745    +1154     
- Misses         4012     4250     +238     
- Partials       1140     1231      +91     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

// expression, however DataFusion does not support that yet.
if (!expr.right.foldable) {
withInfo(expr, "For Sha2, non-foldable right argument is not supported")
withInfo(expr, "For Sha2, non literal numBits is not supported")
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for that link.

Looks like there is a bit of inconsistency between spark docs too.
If I look into
Spark4: https://spark.apache.org/docs/latest/api/scala/org/apache/spark/sql/functions$.html#sha2(e:org.apache.spark.sql.Column,numBits:Int):org.apache.spark.sql.Column
and python-doc: https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.sha2.html
they say numBits.

Since Spark4 doc says numBits, we can keep it the same.

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

Thanks @rishvin

@comphead comphead merged commit d93931f into apache:main Aug 26, 2025
94 checks passed
@rishvin rishvin deleted the 2193-improve-sha2-faillback-message branch September 24, 2025 02:54
coderfender pushed a commit to coderfender/datafusion-comet that referenced this pull request Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve SHA2 user-error message in serdes code

3 participants