andygrove commented on code in PR #3580:
URL: https://github.com/apache/datafusion-comet/pull/3580#discussion_r2843471451
##########
spark/src/test/scala/org/apache/comet/CometCastSuite.scala:
##########
@@ -1526,20 +1553,11 @@ class CometCastSuite extends CometTestBase with
AdaptiveSparkPlanHelper {
if (CometSparkSessionExtensions.isSpark40Plus) {
// for Spark 4 we expect to sparkException carries the
message
assert(sparkMessage.contains("SQLSTATE"))
- if
(sparkMessage.startsWith("[NUMERIC_VALUE_OUT_OF_RANGE.WITH_SUGGESTION]")) {
- assert(
- sparkMessage.replace(".WITH_SUGGESTION] ",
"]").startsWith(cometMessage))
- } else if (cometMessage.startsWith("[CAST_INVALID_INPUT]")
|| cometMessage
- .startsWith("[CAST_OVERFLOW]")) {
- assert(
- sparkMessage.startsWith(
- cometMessage
- .replace(
- "If necessary set \"spark.sql.ansi.enabled\" to
\"false\" to bypass this error.",
- "")))
- } else {
- assert(sparkMessage.startsWith(cometMessage))
- }
+ // we compare a subset of the error message. Comet grabs the
query
+ // context eagerly so it displays the call site at the
+ // line of code where the cast method was called, whereas
spark grabs the context
+ // lazily and displays the call site at the line of code
where the error is checked.
+ assert(sparkMessage.startsWith(cometMessage.substring(0,
40)))
Review Comment:
is 40 just an arbitrary number to get a decent sized chunk of the error
message or does it have a specific meaning in the context of this test?
--
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]