feat: add support for unix_date expression#3141
Merged
andygrove merged 2 commits intoapache:mainfrom Jan 16, 2026
Merged
Conversation
Implements native Comet support for Spark's unix_date function, which converts a date to the number of days since Unix epoch (1970-01-01). Since dates are internally stored as days since epoch (i32), this is implemented as a cast from Date32 to Int32. Closes apache#3097 Co-Authored-By: Claude Opus 4.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3141 +/- ##
============================================
+ Coverage 56.12% 59.89% +3.76%
- Complexity 976 1414 +438
============================================
Files 119 168 +49
Lines 11743 15596 +3853
Branches 2251 2589 +338
============================================
+ Hits 6591 9341 +2750
- Misses 4012 4946 +934
- Partials 1140 1309 +169 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
comphead
approved these changes
Jan 16, 2026
Contributor
comphead
left a comment
There was a problem hiding this comment.
Thanks @andygrove what about fuzz testing?
Member
Author
The test does use the fuzz data generator: test("unix_date") {
val r = new Random(42)
val schema = StructType(Seq(StructField("c0", DataTypes.DateType, true)))
val df = FuzzDataGenerator.generateDataFrame(r, spark, schema, 1000, DataGenOptions()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
unix_datefunctionTest Plan
Closes #3097