You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "peterxcli (via GitHub)" <gi...@apache.org> on 2026/07/29 15:19:27 UTC

[I] [Bug] Native make_interval overflows or loses precision for valid Spark seconds [datafusion-comet]

peterxcli opened a new issue, #5131:
URL: https://github.com/apache/datafusion-comet/issues/5131

   ## Describe the bug
   
   Native make_interval delegates to DataFusion SparkMakeInterval. Its seconds argument is coerced from Spark Decimal(18,6) to Float64 and its time component is accumulated as i64 nanoseconds. This creates two Spark compatibility gaps:
   
   - Float64 coercion can lose microsecond precision.
   - Nanosecond accumulation overflows for seconds values that fit in Spark i64 microseconds.
   
   ## Steps to reproduce
   
   ```sql
   SELECT make_interval(0, 0, 0, 0, 0, 0, 999999999.000001);
   SELECT make_interval(1, 2, 3, 4, 0, 0, 123456789012.123456);
   ```
   
   For the first query, native execution loses one microsecond. For the second, native execution returns NULL in non-ANSI mode or throws in ANSI mode, while Spark returns a valid interval.
   
   ## Expected behavior
   
   Native make_interval should preserve Decimal(18,6) microsecond precision and support every seconds value Spark can represent.
   
   ## Additional context
   
   Found while reviewing #5039. Until this is fixed, CometMakeInterval is marked Incompatible by default and the native path requires explicit opt-in.
   
   Review context: https://github.com/apache/datafusion-comet/pull/5039#discussion_r3659501474


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org