andygrove opened a new issue, #2215:
URL: https://github.com/apache/datafusion-comet/issues/2215
### What is the problem the feature request solves?
Spark includes the original SQL query in error messages with hints to which
part of the query failed.
```
scala> spark.sql("select cast('a' as date)").show()
org.apache.spark.SparkDateTimeException: [CAST_INVALID_INPUT] The value 'a'
of the type "STRING" cannot be cast to "DATE" because it is malformed. Correct
the value as per the syntax, or change its target type. Use `try_cast` to
tolerate malformed input and return NULL instead. SQLSTATE: 22018
== SQL (line 1, position 8) ==
select cast('a' as date)
```
Comet does not do this:
```
org.apache.comet.CometNativeException: [CAST_INVALID_INPUT] The value 'a' of
the type "STRING" cannot be cast to "DATE" because it is malformed. Correct the
value as per the syntax, or change its target type. Use `try_cast` to tolerate
malformed input and return NULL instead. If necessary set
"spark.sql.ansi.enabled" to "false" to bypass this error.
```
Therefore we see test failures such as:
```
did not contain "select cast(s as date) from t"
```
Example test (Spark 4.0.0 in ANSI mode)
```
SPARK-39175: Query context of Cast should be serialized to executors when
WSCG is off *** FAILED ***
```
### Describe the potential solution
_No response_
### Additional context
_No response_
--
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]