Skip to content

Conversation

@tlm365
Copy link
Contributor

@tlm365 tlm365 commented Jun 27, 2025

Which issue does this PR close?

Rationale for this change

Implement spark-compatible luhn_check function.

What changes are included in this PR?

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

Tai Le Manh and others added 3 commits May 20, 2025 10:19
@github-actions github-actions bot added sqllogictest SQL Logic Tests (.slt) spark labels Jun 27, 2025
@tlm365 tlm365 force-pushed the spark_luhn_check branch 3 times, most recently from e977eb8 to 6abe5d1 Compare June 27, 2025 09:41
Remove clippy warning

Remove clippy warning

Remove clippy warning
@tlm365 tlm365 force-pushed the spark_luhn_check branch from 6abe5d1 to 1932bbe Compare June 27, 2025 10:04
@tlm365 tlm365 marked this pull request as ready for review June 27, 2025 10:31
@alamb
Copy link
Contributor

alamb commented Jun 28, 2025

FYI @andygrove and @shehabgamin

@alamb
Copy link
Contributor

alamb commented Jun 28, 2025

Thank you @tlm365 🙏

@shehabgamin
Copy link
Contributor

Will review by Tuesday!

Thank you @tlm365 🚀

@alamb alamb changed the title [datafusion-spark] Implement spark luhn_check function [datafusion-spark] Implement Spark luhn_check function Jun 29, 2025
@alamb
Copy link
Contributor

alamb commented Jun 29, 2025

Thanks @tlm365 and @shehabgamin 🙏

Note I filed a ticket to track this PR here:

(I spent a while on it as I am trying to get a template that we can copy/paste for other functions. I think we are close)


#[test]
fn test_array_utf8() -> Result<()> {
let input = Arc::new(StringArray::from(vec![
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we can come up with a good pattern to test these functions with the different kinds of strings

For example the main datafusion code uses this pattern: https://github.com/apache/datafusion/blob/main/datafusion/sqllogictest/test_files/string/README.md

Maybe we could do something similar for string functions in Spark (so we dont have to maintain 3 sets of expected outputs)

----
true

query B
Copy link
Contributor

@comphead comphead Jun 29, 2025

Choose a reason for hiding this comment

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

can we also add test with extra large numbers, not valid numbers, fractional, exponential and negative?

@tlm365 tlm365 marked this pull request as draft July 1, 2025 06:42
@shehabgamin
Copy link
Contributor

Will review by Tuesday!

Thank you @tlm365 🚀

Looks like this went back into draft mode, feel free to ping me whenever for review!

@alamb
Copy link
Contributor

alamb commented Jul 14, 2025

@tlm365 do you think you will have a chance to work on this PR anytime soon?

@tlm365
Copy link
Contributor Author

tlm365 commented Jul 15, 2025

@alamb Unfortunately, I don't think I'll be able to work on this PR anytime soon as I'm quite busy at the moment 🥲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[datafusion-spark] Implement Spark string function luhn_check

4 participants