@@ -332,108 +332,102 @@ class VeloxParquetDataTypeValidationSuite extends VeloxWholeStageTransformerSuit
332332 }
333333
334334 test(" Array type" ) {
335- withSQLConf((" spark.gluten.sql.complexType.scan.fallback.enabled" , " false" )) {
336- // Validation: BatchScan.
337- runQueryAndCompare(" select array from type1" ) {
338- checkGlutenPlan[BatchScanExecTransformer ]
339- }
335+ // Validation: BatchScan.
336+ runQueryAndCompare(" select array from type1" ) {
337+ checkGlutenPlan[BatchScanExecTransformer ]
338+ }
340339
341- // Validation: BatchScan Project Aggregate Expand Sort Limit
342- runQueryAndCompare(
343- " select int, array from type1 " +
344- " group by grouping sets(int, array) sort by array, int limit 1" ) {
345- df =>
346- {
347- val executedPlan = getExecutedPlan(df)
348- assert(executedPlan.exists(plan => plan.isInstanceOf [BatchScanExecTransformer ]))
349- }
350- }
340+ // Validation: BatchScan Project Aggregate Expand Sort Limit
341+ runQueryAndCompare(
342+ " select int, array from type1 " +
343+ " group by grouping sets(int, array) sort by array, int limit 1" ) {
344+ df =>
345+ {
346+ val executedPlan = getExecutedPlan(df)
347+ assert(executedPlan.exists(plan => plan.isInstanceOf [BatchScanExecTransformer ]))
348+ }
349+ }
351350
352- // Validation: BroadHashJoin, Filter, Project
353- super .sparkConf.set(" spark.sql.autoBroadcastJoinThreshold" , " 10M" )
354- runQueryAndCompare(
355- " select type1.array from type1," +
356- " type2 where type1.array = type2.array" ) { _ => }
351+ // Validation: BroadHashJoin, Filter, Project
352+ super .sparkConf.set(" spark.sql.autoBroadcastJoinThreshold" , " 10M" )
353+ runQueryAndCompare(
354+ " select type1.array from type1," +
355+ " type2 where type1.array = type2.array" ) { _ => }
357356
358- // Validation: ShuffledHashJoin, Filter, Project
359- super .sparkConf.set(" spark.sql.autoBroadcastJoinThreshold" , " -1" )
360- runQueryAndCompare(
361- " select type1.array from type1," +
362- " type2 where type1.array = type2.array" ) { _ => }
363- }
357+ // Validation: ShuffledHashJoin, Filter, Project
358+ super .sparkConf.set(" spark.sql.autoBroadcastJoinThreshold" , " -1" )
359+ runQueryAndCompare(
360+ " select type1.array from type1," +
361+ " type2 where type1.array = type2.array" ) { _ => }
364362 }
365363
366364 test(" Map type" ) {
367- withSQLConf((" spark.gluten.sql.complexType.scan.fallback.enabled" , " false" )) {
368- // Validation: BatchScan Project Limit
369- runQueryAndCompare(" select map from type1 limit 1" ) {
370- df =>
371- {
372- val executedPlan = getExecutedPlan(df)
373- assert(executedPlan.exists(plan => plan.isInstanceOf [BatchScanExecTransformer ]))
374- }
375- }
376- // Validation: BatchScan Project Aggregate Sort Limit
377- // TODO validate Expand operator support map type ?
378- runQueryAndCompare(
379- " select map['key'] from type1 group by map['key']" +
380- " sort by map['key'] limit 1" ) {
381- df =>
382- {
383- val executedPlan = getExecutedPlan(df)
384- assert(executedPlan.exists(plan => plan.isInstanceOf [BatchScanExecTransformer ]))
385- }
386- }
365+ // Validation: BatchScan Project Limit
366+ runQueryAndCompare(" select map from type1 limit 1" ) {
367+ df =>
368+ {
369+ val executedPlan = getExecutedPlan(df)
370+ assert(executedPlan.exists(plan => plan.isInstanceOf [BatchScanExecTransformer ]))
371+ }
372+ }
373+ // Validation: BatchScan Project Aggregate Sort Limit
374+ // TODO validate Expand operator support map type ?
375+ runQueryAndCompare(
376+ " select map['key'] from type1 group by map['key']" +
377+ " sort by map['key'] limit 1" ) {
378+ df =>
379+ {
380+ val executedPlan = getExecutedPlan(df)
381+ assert(executedPlan.exists(plan => plan.isInstanceOf [BatchScanExecTransformer ]))
382+ }
383+ }
387384
388- // Validation: BroadHashJoin, Filter, Project
389- super .sparkConf.set(" spark.sql.autoBroadcastJoinThreshold" , " 10M" )
390- runQueryAndCompare(
391- " select type1.map['key'] from type1," +
392- " type2 where type1.map['key'] = type2.map['key']" ) { _ => }
385+ // Validation: BroadHashJoin, Filter, Project
386+ super .sparkConf.set(" spark.sql.autoBroadcastJoinThreshold" , " 10M" )
387+ runQueryAndCompare(
388+ " select type1.map['key'] from type1," +
389+ " type2 where type1.map['key'] = type2.map['key']" ) { _ => }
393390
394- // Validation: ShuffledHashJoin, Filter, Project
395- super .sparkConf.set(" spark.sql.autoBroadcastJoinThreshold" , " -1" )
396- runQueryAndCompare(
397- " select type1.map['key'] from type1," +
398- " type2 where type1.map['key'] = type2.map['key']" ) { _ => }
399- }
391+ // Validation: ShuffledHashJoin, Filter, Project
392+ super .sparkConf.set(" spark.sql.autoBroadcastJoinThreshold" , " -1" )
393+ runQueryAndCompare(
394+ " select type1.map['key'] from type1," +
395+ " type2 where type1.map['key'] = type2.map['key']" ) { _ => }
400396 }
401397
402398 test(" Struct type" ) {
403- withSQLConf((" spark.gluten.sql.complexType.scan.fallback.enabled" , " false" )) {
404- // Validation: BatchScan Project Limit
405- runQueryAndCompare(" select struct from type1" ) {
406- df =>
407- {
408- val executedPlan = getExecutedPlan(df)
409- assert(executedPlan.exists(plan => plan.isInstanceOf [BatchScanExecTransformer ]))
410- }
411- }
412- // Validation: BatchScan Project Aggregate Sort Limit
413- // TODO validate Expand operator support Struct type ?
414- runQueryAndCompare(
415- " select int, struct.struct_1 from type1 " +
416- " sort by struct.struct_1 limit 1" ) {
417- df =>
418- {
419- val executedPlan = getExecutedPlan(df)
420- assert(executedPlan.exists(plan => plan.isInstanceOf [BatchScanExecTransformer ]))
421- assert(executedPlan.exists(plan => plan.isInstanceOf [ProjectExecTransformer ]))
422- }
423- }
399+ // Validation: BatchScan Project Limit
400+ runQueryAndCompare(" select struct from type1" ) {
401+ df =>
402+ {
403+ val executedPlan = getExecutedPlan(df)
404+ assert(executedPlan.exists(plan => plan.isInstanceOf [BatchScanExecTransformer ]))
405+ }
406+ }
407+ // Validation: BatchScan Project Aggregate Sort Limit
408+ // TODO validate Expand operator support Struct type ?
409+ runQueryAndCompare(
410+ " select int, struct.struct_1 from type1 " +
411+ " sort by struct.struct_1 limit 1" ) {
412+ df =>
413+ {
414+ val executedPlan = getExecutedPlan(df)
415+ assert(executedPlan.exists(plan => plan.isInstanceOf [BatchScanExecTransformer ]))
416+ assert(executedPlan.exists(plan => plan.isInstanceOf [ProjectExecTransformer ]))
417+ }
418+ }
424419
425- // Validation: BroadHashJoin, Filter, Project
426- super .sparkConf.set(" spark.sql.autoBroadcastJoinThreshold" , " 10M" )
427- runQueryAndCompare(
428- " select type1.struct.struct_1 from type1," +
429- " type2 where type1.struct.struct_1 = type2.struct.struct_1" ) { _ => }
420+ // Validation: BroadHashJoin, Filter, Project
421+ super .sparkConf.set(" spark.sql.autoBroadcastJoinThreshold" , " 10M" )
422+ runQueryAndCompare(
423+ " select type1.struct.struct_1 from type1," +
424+ " type2 where type1.struct.struct_1 = type2.struct.struct_1" ) { _ => }
430425
431- // Validation: ShuffledHashJoin, Filter, Project
432- super .sparkConf.set(" spark.sql.autoBroadcastJoinThreshold" , " -1" )
433- runQueryAndCompare(
434- " select type1.struct.struct_1 from type1," +
435- " type2 where type1.struct.struct_1 = type2.struct.struct_1" ) { _ => }
436- }
426+ // Validation: ShuffledHashJoin, Filter, Project
427+ super .sparkConf.set(" spark.sql.autoBroadcastJoinThreshold" , " -1" )
428+ runQueryAndCompare(
429+ " select type1.struct.struct_1 from type1," +
430+ " type2 where type1.struct.struct_1 = type2.struct.struct_1" ) { _ => }
437431 }
438432
439433 test(" Decimal type" ) {
0 commit comments