-
Notifications
You must be signed in to change notification settings - Fork 278
feat: add support for make_date expression #3147
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
base: main
Are you sure you want to change the base?
Conversation
Adds native Comet support for Spark's make_date function which creates a date from year, month, and day components. Closes apache#3091 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3147 +/- ##
============================================
+ Coverage 56.12% 59.87% +3.74%
- Complexity 976 1414 +438
============================================
Files 119 168 +49
Lines 11743 15587 +3844
Branches 2251 2589 +338
============================================
+ Hits 6591 9332 +2741
- Misses 4012 4946 +934
- Partials 1140 1309 +169 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
comphead
left a comment
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.
Thanks @andygrove
I dont see fuzzer here though
Add a custom SparkMakeDate implementation that returns NULL for invalid dates instead of throwing exceptions, matching Spark's behavior. Changes: - Add native/spark-expr/src/datetime_funcs/make_date.rs with: - Support for type coercion (Int64 -> Int32 for SQL literals) - Proper validation of month (1-12) and day (1-31) ranges - NULL return for invalid dates (e.g., Feb 30, non-leap year Feb 29) - Uses chrono for date validation and epoch calculation - Register SparkMakeDate in comet_scalar_funcs.rs - Add integration tests in spark_expr_reg.rs - Update test comments in CometTemporalExpressionSuite.scala Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Moving this to draft until #3328 is merged |
Summary
make_datefunctionmake_datefunctionTest Plan
CometTemporalExpressionSuiteCloses #3091