feat: add support for timestamp_seconds expression#3146
feat: add support for timestamp_seconds expression#3146andygrove wants to merge 12 commits intoapache:mainfrom
Conversation
Adds native Comet support for Spark's timestamp_seconds (SecondsToTimestamp) function, which converts seconds since Unix epoch to a timestamp. Supports Int32, Int64, and Float64 inputs. NaN and Infinite float values return null per Spark behavior. Closes apache#3111 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 #3146 +/- ##
============================================
+ Coverage 56.12% 59.96% +3.83%
- Complexity 976 1473 +497
============================================
Files 119 175 +56
Lines 11743 16170 +4427
Branches 2251 2682 +431
============================================
+ Hits 6591 9696 +3105
- Misses 4012 5126 +1114
- Partials 1140 1348 +208 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…mestamp # Conflicts: # docs/source/user-guide/latest/configs.md # native/spark-expr/src/comet_scalar_funcs.rs # native/spark-expr/src/lib.rs # spark/src/main/scala/org/apache/comet/serde/datetime.scala # spark/src/test/scala/org/apache/comet/CometTemporalExpressionSuite.scala
|
Moving this to draft until #3328 is merged |
…mestamp # Conflicts: # native/spark-expr/src/comet_scalar_funcs.rs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks @andygrove! Claude summarized my notes for me. Hopefully it didn't transcribe anything wrong or hallucinate :)
|
- Error on Int64 overflow instead of returning null, matching Spark's Math.multiplyExact which throws ArithmeticException - Use try_unary kernel for Int32/Int64 paths to avoid per-row null buffer tracking overhead - Add Float32 input type support - Properly handle scalar inputs (scalar-in/scalar-out contract) - Add test coverage for NaN, Infinity, Int32 column, Float64 column - Mark timestamp_seconds as supported in spark_expressions_support.md
…mestamp # Conflicts: # native/spark-expr/src/comet_scalar_funcs.rs # native/spark-expr/src/lib.rs # spark/src/main/scala/org/apache/comet/serde/datetime.scala
|
@mbutrovich this is ready for another look when you have time |
|
This was the only nit:
|
Summary
timestamp_secondsfunction (also known asseconds_to_timestamp)Test Plan
CometTemporalExpressionSuiteCloses #3111