andygrove commented on code in PR #1376:
URL: https://github.com/apache/datafusion-comet/pull/1376#discussion_r1953540948
##########
spark/src/test/scala/org/apache/comet/CometCastSuite.scala:
##########
@@ -145,88 +145,134 @@ class CometCastSuite extends CometTestBase with
AdaptiveSparkPlanHelper {
// CAST from ByteType
test("cast ByteType to BooleanType") {
- castTest(generateBytes(), DataTypes.BooleanType)
+ val hasIncompatibleType =
CometSparkSessionExtensions.isComplexTypeReaderEnabled(
+ conf) && !CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.get()
Review Comment:
This code block is repeated many times. Maybe it could be moved out to a val
in the class instead? Perhaps something like:
```scala
lazy val usingDataFusionParquetReader: Boolean = {
CometSparkSessionExtensions.isComplexTypeReaderEnabled(
conf) && !CometConf.COMET_SCAN_ALLOW_INCOMPATIBLE.get()
}
test("cast ByteType to BooleanType") {
castTest(generateBytes(), DataTypes.BooleanType, hasIncompatibleType =
usingDataFusionParquetReader)
}
```
--
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]