weimingdiit opened a new pull request, #2129: URL: https://github.com/apache/auron/pull/2129
# Which issue does this PR close? Closes #https://github.com/apache/auron/issues/2128 # Rationale for this change To achieve full compatibility with Spark’s date functions, we should implement `dayofweek()` with the following characteristics: _Expected behavior_ Function name: `dayofweek(expr)` Return value: `Sunday = 1, Monday = 2, ..., Saturday = 7` Example: `dayofweek('2009-07-30')` → `5` Supports: `DATE`, `TIMESTAMP`, and compatible string/date inputs consistent with existing date extraction functions Null-safe: should return `NULL` if input is `NULL` Array and scalar inputs: consistent with current date extraction function implementations # What changes are included in this PR? This PR adds native support for the `dayofweek()` function with Spark-compatible semantics. The following changes are included: Added native implementation of `spark_dayofweek()` in the expression layer. Added `DayOfWeek` expression support in `NativeConverters` for proper Spark → native translation. Added unit tests to verify correctness for: Spark-compatible weekday numbering (`Sunday = 1 ... Saturday = 7`) Literal date input such as `dayofweek('2009-07-30') = 5` Array and scalar input handling Null input handling # Are there any user-facing changes? No. # How was this patch tested? CI. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
