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/08/30 02:44:39 UTC

[I] Implement native function of dayofyear [auron]

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

   **Is your feature request related to a problem? Please describe.**
   
   `dayofyear()` does not currently have a dedicated native implementation in Auron.
   
   `NativeConverters` handles related Spark expressions such as `DayOfWeek` and `WeekOfYear`, but does not handle `DayOfYear`. Queries using this function therefore remain on the fallback path.
   
   Spark's `dayofyear()` returns the day of the year as an integer from 1 to 366.
   It supports date and timestamp inputs, returns `NULL` for a null input, and timestamp results must respect the session time zone.
   
   **Describe the solution you'd like**
   
   Add Spark-compatible native support for `dayofyear(expr)`, following the existing date-part function path:
   
   - Convert Spark's `DayOfYear` expression in `NativeConverters`.
   - Register the corresponding native extension function.
   - Reuse the existing local-date and session-time-zone handling in `spark_dates.rs`.
   - Add Spark integration tests and Rust unit tests.
   
   Expected examples:
   
   ```sql
   SELECT dayofyear(DATE '2016-04-09'); -- 100
   SELECT dayofyear(DATE '2023-12-31'); -- 365
   SELECT dayofyear(DATE '2024-12-31'); -- 366
   SELECT dayofyear(CAST(NULL AS DATE)); -- NULL
   ```
   
   Tests should cover:
   - DATE and TIMESTAMP inputs;
   - leap-year and year-boundary dates;
   - null propagation;
   - timestamps under a non-UTC session time zone;
   
   **Describe alternatives you've considered**
   
   Keep the current Spark fallback. This preserves correctness, but dayofyear() cannot benefit from native execution.
   
   **Additional context**
   
   The earlier umbrella issue #1521 mentioned dayofyear, but it was closed without an implementation.
   
   Related implementations:
   - #2129: native dayofweek
   - #2131: native weekofyear
   


-- 
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 dayofyear [auron]

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


-- 
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 dayofyear [auron]

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

   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