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/10/08 16:15:40 UTC
[I] Support trunc function natively [auron]
Sigma-Ma opened a new issue, #2561:
URL: https://github.com/apache/auron/issues/2561
**Is your feature request related to a problem? Please describe.**
Spark's `trunc(date, fmt)` has no native implementation in Auron and falls back to Spark evaluation. The existing `date_trunc` support handles `TruncTimestamp`, not `TruncDate`.
**Describe the solution you'd like**
Add native support for `TruncDate`, returning a DATE with Spark-compatible behavior:
- Support YEAR/YYYY/YY, QUARTER, MONTH/MM/MON, and WEEK, case-insensitively.
- Truncate WEEK to Monday.
- Return null when either argument is null or the format is unsupported, including DAY and HOUR.
Cover literal and column format arguments, date boundaries, leap years, nulls, and invalid formats in `AuronFunctionSuite` and Rust unit tests. Verify that supported expressions execute natively.
**Describe alternatives you've considered**
Keep using Spark fallback for this expression.
**Additional context**
```sql
SELECT trunc(DATE '2019-08-04', 'week'); -- 2019-07-29
SELECT trunc(DATE '2019-08-04', 'quarter'); -- 2019-07-01
SELECT trunc(DATE '2024-02-29', 'MM'); -- 2024-02-01
```
Spark documentation:
https://spark.apache.org/docs/latest/api/sql/datetime-functions/#trunc
--
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] Support trunc function natively [auron]
Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 closed issue #2561: Support trunc function natively
URL: https://github.com/apache/auron/issues/2561
--
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