andygrove opened a new issue, #4449:
URL: https://github.com/apache/datafusion-comet/issues/4449

   ## Describe the bug
   
   `next_day(date, dayOfWeek)` returns `NULL` for an unrecognised `dayOfWeek` 
even when `spark.sql.ansi.enabled=true`, where Spark throws 
`SparkIllegalArgumentException` (3.5+) / `IllegalArgumentException` (3.4) 
wrapped via `QueryExecutionErrors.ansiIllegalArgumentError`.
   
   The native impl is `datafusion-spark::SparkNextDay`, which always returns 
NULL on parse failure regardless of the ANSI flag.
   
   ## Steps to reproduce
   
   ```sql
   SET spark.sql.ansi.enabled=true;
   SELECT next_day(date('2024-01-01'), 'NOT_A_DAY');
   -- Spark: throws SparkIllegalArgumentException
   -- Comet: returns NULL
   ```
   
   ## Expected behavior
   
   Match Spark: throw under ANSI; return NULL otherwise.
   
   ## Additional context
   
   Surfaced by the date/time audit (#4448). Reproducer captured as an ignored 
test in `spark/src/test/resources/sql-tests/expressions/datetime/next_day.sql`; 
remove the `ignore(...)` when this is fixed.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to