andygrove opened a new pull request, #4555: URL: https://github.com/apache/datafusion-comet/pull/4555
## Which issue does this PR close? N/A. This adds test coverage only. Surfaces and references #4554. ## Rationale for this change The `try_*` datetime parsing/constructor functions (`try_to_date`, `try_to_timestamp`, `try_make_timestamp`) had no Comet test coverage. They are `RuntimeReplaceable` and lower to `Cast` / `GetTimestamp` / `MakeTimestamp`, whose non-`try` forms Comet already accelerates, so it was worth checking empirically whether the `try_` forms are accelerated too. The result is mixed and worth pinning down with tests. ## What changes are included in this PR? Adds `spark/src/test/resources/sql-tests/expressions/datetime/try_datetime.sql`, covering column and literal arguments (including invalid inputs that exercise the NULL-on-error path) and NULLs. Empirical findings, encoded in the query modes: - `try_to_date` and `try_to_timestamp` currently **fall back** to Spark, so their queries use `query spark_answer_only` (result correctness is still validated against Spark). - `try_make_timestamp` runs natively for valid inputs, but returns wrong values instead of NULL for out-of-range components (`failOnError = false` is not honoured natively). Valid-input queries use `query spark_answer_only`; invalid-input queries use `query ignore(...)` referencing the bug, **#4554**. When #4554 is fixed and the `try_to_*` fallback is addressed, these queries can be promoted to the default `query` mode to assert native execution. ## How are these changes tested? This PR is test-only. The file runs under `CometSqlFileTestSuite`, executing each query through both Spark and Comet and comparing results. Verified locally: ``` ./mvnw test -Dsuites="org.apache.comet.CometSqlFileTestSuite try_datetime" -Dtest=none ``` Result: the discovered test file passes. -- 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]
