Skip to content

[AURON #2501] Support datediff function natively - #2502

Open
Sigma-Ma wants to merge 1 commit into
apache:masterfrom
Sigma-Ma:Auron-2501-implement-native-function-of-datediff
Open

[AURON #2501] Support datediff function natively#2502
Sigma-Ma wants to merge 1 commit into
apache:masterfrom
Sigma-Ma:Auron-2501-implement-native-function-of-datediff

Conversation

@Sigma-Ma

@Sigma-Ma Sigma-Ma commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #2501

Rationale for this change

Spark DateDiff expressions are not currently converted to native expressions, so queries using datediff remain on the fallback path.

This change adds native execution while preserving Spark's argument order, signed day difference, and null behavior.

What changes are included in this PR?

  • convert Spark DateDiff expressions in NativeConverters
  • register the Spark_DateDiff extension function
  • implement the signed Date32 day difference with null propagation
  • add Rust unit tests for positive, negative, zero, leap-year, year-boundary, and null cases
  • add regression coverage in AuronFunctionSuite

Are there any user-facing changes?

No. The SQL syntax and result semantics remain unchanged. Eligible datediff expressions can now execute natively.

How was this patch tested?

cargo test -p datafusion-ext-functions spark_dates::tests::test_spark_datediff -- --exact

cargo test -p datafusion-ext-functions

./dev/reformat --check

./auron-build.sh --pre --clean true --sparkver 3.5 --scalaver 2.12 --skiptests false -DwildcardSuites=org.apache.auron.AuronFunctionSuite

Was this patch authored or co-authored using generative AI tooling?

  • Yes
  • No

Generated-by: OpenAI Codex (GPT-5)

ASF guidance: https://www.apache.org/legal/generative-tooling.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement native function of datediff

2 participants