Skip to content

[AURON #2485] Support last_day function natively - #2486

Merged
slfan1989 merged 1 commit into
apache:masterfrom
Sigma-Ma:Auron-2485-last-day-native
Aug 30, 2026
Merged

[AURON #2485] Support last_day function natively#2486
slfan1989 merged 1 commit into
apache:masterfrom
Sigma-Ma:Auron-2485-last-day-native

Conversation

@Sigma-Ma

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #2485

Rationale for this change

Spark last_day expressions cannot currently be converted to native expressions, causing affected plans to fall back to Spark execution.

What changes are included in this PR?

  • Convert Spark LastDay expressions to the Spark_LastDay extension function.
  • Implement Spark_LastDay using the existing Date32 conversion and month-length helpers.
  • Add Rust unit tests and Spark regression coverage for regular months, leap years, dates before the Unix epoch, and null values.

Are there any user-facing changes?

No. The Spark SQL syntax and result semantics remain unchanged. Eligible last_day expressions can now run natively.

How was this patch tested?

cargo test -p datafusion-ext-functions \
  spark_dates::tests::test_spark_last_day -- --exact

./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

@Sigma-Ma
Sigma-Ma force-pushed the Auron-2485-last-day-native branch from a3c8f4e to 9fd678c Compare August 29, 2026 14:46
@slfan1989 slfan1989 self-assigned this Aug 30, 2026

@slfan1989 slfan1989 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding native support for last_day. I reviewed the expression conversion, function registration, native implementation, and test coverage. The implementation correctly handles month boundaries, leap years, pre-epoch dates, and null values. All checks are passing. LGTM!

@slfan1989
slfan1989 merged commit 3d52de0 into apache:master Aug 30, 2026
134 checks passed
@slfan1989

Copy link
Copy Markdown
Contributor

@Sigma-Ma Thanks for the contribution! Merged into master.

@Sigma-Ma
Sigma-Ma deleted the Auron-2485-last-day-native branch August 30, 2026 14:07
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 last_day

2 participants