File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
spark/src/test/scala/org/apache/comet Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -1213,14 +1213,11 @@ class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper {
12131213 val cometMessage =
12141214 if (cometException.getCause != null ) cometException.getCause.getMessage
12151215 else cometException.getMessage
1216- // for comet decimal conversion throws ArrowError(string) from arrow - across spark versions the message dont match .
1216+ // this if branch should only check decimal to decimal cast and errors when output precision, scale causes overflow .
12171217 if (df.schema(" a" ).dataType.typeName.contains(" decimal" ) && toType.typeName
1218- .contains(" decimal" )) {
1219- assert(
1220- cometMessage.contains(" too large to store" ) ==
1221- sparkMessage.contains(" cannot be represented as" ))
1218+ .contains(" decimal" ) && sparkMessage.contains(" cannot be represented as" )) {
1219+ assert(cometMessage.contains(" too large to store" ))
12221220 } else {
1223-
12241221 if (CometSparkSessionExtensions .isSpark40Plus) {
12251222 // for Spark 4 we expect to sparkException carries the message
12261223 assert(
You can’t perform that action at this time.
0 commit comments