andygrove commented on code in PR #346: URL: https://github.com/apache/datafusion-comet/pull/346#discussion_r1585037634
########## spark/src/test/scala/org/apache/comet/CometCastSuite.scala: ########## @@ -176,26 +210,28 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper { // cast() should throw exception on invalid inputs when ansi mode is enabled val df = data.withColumn("converted", col("a").cast(toType)) - val (expected, actual) = checkSparkThrows(df) - - if (CometSparkSessionExtensions.isSpark34Plus) { - // We have to workaround https://github.com/apache/datafusion-comet/issues/293 here by - // removing the "Execution error: " error message prefix that is added by DataFusion - val cometMessage = actual.getMessage - .substring("Execution error: ".length) - - assert(expected.getMessage == cometMessage) - } else { - // Spark 3.2 and 3.3 have a different error message format so we can't do a direct - // comparison between Spark and Comet. - // Spark message is in format `invalid input syntax for type TYPE: VALUE` - // Comet message is in format `The value 'VALUE' of the type FROM_TYPE cannot be cast to TO_TYPE` - // We just check that the comet message contains the same invalid value as the Spark message - val sparkInvalidValue = - expected.getMessage.substring(expected.getMessage.indexOf(':') + 2) - assert(actual.getMessage.contains(sparkInvalidValue)) - } + if (testAnsiModeThrows) { Review Comment: There is an improved version of this ANSI test code in https://github.com/apache/datafusion-comet/pull/351 where it no longer assumes that an exception will be thrown -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org