-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[datafusion-spark] Implement Spark luhn_check function
#16580
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
Conversation
e977eb8 to
6abe5d1
Compare
Remove clippy warning Remove clippy warning Remove clippy warning
|
FYI @andygrove and @shehabgamin |
|
Thank you @tlm365 🙏 |
|
Will review by Tuesday! Thank you @tlm365 🚀 |
luhn_check functionluhn_check function
|
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![ |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
Looks like this went back into draft mode, feel free to ping me whenever for review! |
|
@tlm365 do you think you will have a chance to work on this PR anytime soon? |
|
@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 🥲 |
Which issue does this PR close?
datafusion-sparkSpark Compatible Functions #15914.stringfunctionluhn_check#16612Rationale for this change
Implement spark-compatible
luhn_checkfunction.What changes are included in this PR?
Are these changes tested?
Yes.
Are there any user-facing changes?
No.