comphead commented on code in PR #6501:
URL: https://github.com/apache/datafusion-comet/pull/6501#discussion_r4274438233


##########
spark/src/test/scala/org/apache/comet/CometNativeCastSuite.scala:
##########
@@ -2239,6 +2239,75 @@ class CometNativeCastSuite extends CometTestBase with 
AdaptiveSparkPlanHelper {
         Unsupported(Some(expectedMessage)))
   }
 
+  // https://github.com/apache/datafusion-comet/issues/6200
+  // Nested isSupported used to return the first non-Compatible child, so an 
earlier
+  // Incompatible (negative-scale decimal → string) could mask a later 
Unsupported.
+  // Boolean → Decimal is Unsupported; that pair is used as the Unsupported 
child.
+  test("struct to struct prefers Unsupported over Incompatible regardless of 
field order") {

Review Comment:
   The three new tests repeat the same local `struct` helper and the same 
`unsupportedReason` construction, and each is a pair of asserts that differ 
only in child order. A single test that loops over both orders, or a shared 
private helper for `struct` and the expected reason, would keep the coverage 
and drop roughly 25 lines.
   
   `nestedCastSupportFixtures` also repeats the idiom of building the 
negative-scale `DecimalType` inside `withSQLConf(... "true")`, which already 
sits inline at lines 1004-1008 and 2210-2214 of this file. Could those two 
reuse it?
   
   These do need to stay as direct `CometCast.isSupported` tests, since a 
negative-scale decimal cannot be created from SQL while 
`allowNegativeScaleOfDecimal` is false.



-- 
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]

Reply via email to