@@ -46,6 +46,7 @@ import org.apache.spark.unsafe.types.UTF8String
4646import com .google .common .primitives .UnsignedLong
4747
4848import org .apache .comet .{CometConf , CometSparkSessionExtensions }
49+ import org .apache .comet .CometConf .SCAN_NATIVE_ICEBERG_COMPAT
4950import org .apache .comet .CometSparkSessionExtensions .{isSpark40Plus , usingDataFusionParquetExec }
5051
5152abstract class ParquetReadSuite extends CometTestBase {
@@ -121,13 +122,24 @@ abstract class ParquetReadSuite extends CometTestBase {
121122 }
122123
123124 test(" unsupported Spark schema" ) {
124- Seq (
125- Seq (StructField (" f1" , IntegerType ), StructField (" f2" , BooleanType )) -> true ,
126- Seq (StructField (" f1" , IntegerType ), StructField (" f2" , ArrayType (IntegerType ))) -> false ,
127- Seq (
128- StructField (" f1" , MapType (keyType = LongType , valueType = StringType )),
129- StructField (" f2" , ArrayType (DoubleType ))) -> false ).foreach { case (schema, expected) =>
125+ val schemaDDLs =
126+ Seq (" f1 int, f2 boolean" , " f1 int, f2 array<int>" , " f1 map<long, string>, f2 array<double>" )
127+ .map(s => StructType .fromDDL(s))
128+
129+ // Arrays support for iceberg compat native and for Parquet V1
130+ val cometScanExecSupported =
131+ if (sys.env.get(" COMET_PARQUET_SCAN_IMPL" ).contains(SCAN_NATIVE_ICEBERG_COMPAT ) && this
132+ .isInstanceOf [ParquetReadV1Suite ])
133+ Seq (true , true , false )
134+ else Seq (true , false , false )
135+
136+ val cometBatchScanExecSupported = Seq (true , false , false )
137+
138+ schemaDDLs.zip(cometScanExecSupported).foreach { case (schema, expected) =>
130139 assert(CometScanExec .isSchemaSupported(StructType (schema)) == expected)
140+ }
141+
142+ schemaDDLs.zip(cometBatchScanExecSupported).foreach { case (schema, expected) =>
131143 assert(CometBatchScanExec .isSchemaSupported(StructType (schema)) == expected)
132144 }
133145 }
0 commit comments