u70b3 opened a new pull request, #4973:
URL: https://github.com/apache/datafusion-comet/pull/4973
## Which issue does this PR close?
Closes #4556.
## Rationale for this change
Investigation of #4556 showed that the reported fallback of `try_to_date` /
`try_to_timestamp` does not exist on current `main`. All four functions
(`to_date`, `to_timestamp`, and their `try_` variants) are `RuntimeReplaceable`
and are expanded by Spark's `ReplaceExpressions` before Comet sees the plan. In
non-ANSI mode the expansions are identical between the `try_` and non-`try_`
forms:
- no format: `Cast(..., EvalMode.LEGACY)` (`EvalMode.fromBoolean(false)` is
`LEGACY`, not `TRY`)
- with format: `Cast(GetTimestamp(..., failOnError = false))`
Comet already accelerates both building blocks (native `Cast`;
`GetTimestamp` via the codegen dispatcher since #4454), so there is no serde
gap to close. The 15 `spark_answer_only` markers in `try_datetime.sql` were
conservative annotations introduced in #4555 — that mode only compares answers
without asserting native execution — and predate the `GetTimestamp` dispatch
support.
## What changes are included in this PR?
- `try_datetime.sql`: flip the 15 `try_to_date` / `try_to_timestamp` queries
from `spark_answer_only` to the default `query` mode (native coverage + answer
check). The 3 `try_make_timestamp` markers are unchanged; they belong to #4554.
- `docs/.../expressions.md`: support matrix entries for `try_to_date` /
`try_to_timestamp` 🔜 -> ✅.
- `docs/.../expression-audits/datetime_funcs.md`: add audit entries for both
functions.
## How are these changes tested?
```
./mvnw test -Pspark-4.1 -Dtest=none \
-Dsuites="org.apache.comet.CometSqlFileTestSuite try_datetime"
-DwildcardSuites=none
```
passes with all 15 queries executing fully native (the default `query` mode
asserts an all-Comet plan and compares answers against Spark). This directly
verifies the issue's acceptance criteria: native execution with
NULL-on-invalid-input behavior matching Spark.
--
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]