You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@auron.apache.org by "Sigma-Ma (via GitHub)" <gi...@apache.org> on 2026/09/01 14:52:07 UTC

[I] Implement native function of datediff [auron]

Sigma-Ma opened a new issue, #2501:
URL: https://github.com/apache/auron/issues/2501

   **Is your feature request related to a problem? Please describe.**
   
   Spark `datediff(endDate, startDate)` is not supported in Auron's native execution path. `NativeConverters` does not handle Spark's `DateDiff` expression, so queries using it remain on the fallback path.
   
   **Describe the solution you'd like**
   
   Add Spark-compatible native support for `datediff(endDate, startDate)` through the extension-function path:
   
   - convert Spark `DateDiff` in `NativeConverters`
   - register and implement a native `Spark_DateDiff` function
   - return the signed number of days from `startDate` to `endDate`
   - preserve null propagation and Spark input coercion behavior
   - add coverage in `AuronFunctionSuite` and Rust unit tests
   
   Expected examples:
   
   ```sql
   SELECT datediff(DATE '2009-07-31', DATE '2009-07-30'); -- 1
   SELECT datediff(DATE '2009-07-30', DATE '2009-07-31'); -- -1
   SELECT datediff(DATE '2024-03-01', DATE '2024-02-28'); -- 2
   SELECT datediff(CAST(NULL AS DATE), DATE '2024-01-01'); -- NULL
   ```
   
   Tests should cover positive, negative, and zero differences, leap-year and year-boundary dates, and null inputs.
   
   **Describe alternatives you've considered**
   
   Keep the current Spark fallback. This preserves correctness, but datediff cannot benefit from native execution.
   
   **Additional context**
   
   Related native date-function implementations:
   - #2129: dayofweek
   - #2486: last_day
   - #2489: dayofyear


-- 
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: commits-unsubscribe@auron.apache.org.apache.org

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


Re: [I] Implement native function of datediff [auron]

Posted by "Sigma-Ma (via GitHub)" <gi...@apache.org>.
Sigma-Ma commented on issue #2501:
URL: https://github.com/apache/auron/issues/2501#issuecomment-5513327357

   Implemented in #2502. The PR adds native DateDiff conversion, the Spark_DateDiff implementation, and Rust and Spark regression coverage. It is ready for review.


-- 
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: commits-unsubscribe@auron.apache.org

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


Re: [I] Implement native function of datediff [auron]

Posted by "Sigma-Ma (via GitHub)" <gi...@apache.org>.
Sigma-Ma commented on issue #2501:
URL: https://github.com/apache/auron/issues/2501#issuecomment-5495852229

   I'd like to work on this issue. 


-- 
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: commits-unsubscribe@auron.apache.org

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


Re: [I] Implement native function of datediff [auron]

Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 closed issue #2501: Implement native function of datediff
URL: https://github.com/apache/auron/issues/2501


-- 
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: commits-unsubscribe@auron.apache.org

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