@@ -23,11 +23,11 @@ import org.apache.hadoop.fs.Path
2323import org .apache .spark .sql .SparkSession
2424import org .apache .spark .sql .connector .catalog .SupportsWrite
2525import org .apache .spark .sql .delta .{DeltaLog , DeltaParquetFileFormat }
26- import org .apache .spark .sql .delta .DeltaParquetFileFormat .{ IS_ROW_DELETED_COLUMN_NAME , ROW_INDEX_COLUMN_NAME }
26+ import org .apache .spark .sql .delta .DeltaParquetFileFormat .IS_ROW_DELETED_COLUMN_NAME
2727import org .apache .spark .sql .delta .catalog .{DeltaCatalog , DeltaTableV2 }
2828import org .apache .spark .sql .delta .commands .{DeleteCommand , MergeIntoCommand , OptimizeTableCommand , UpdateCommand }
2929import org .apache .spark .sql .delta .rapids .DeltaRuntimeShim
30- import org .apache .spark .sql .delta .sources .DeltaDataSource
30+ import org .apache .spark .sql .delta .sources .{ DeltaDataSource , DeltaSQLConf }
3131import org .apache .spark .sql .execution .FileSourceScanExec
3232import org .apache .spark .sql .execution .command .RunnableCommand
3333import org .apache .spark .sql .execution .datasources .{FileFormat , HadoopFsRelation , SaveIntoDataSourceCommand }
@@ -54,6 +54,10 @@ object Delta33xProvider extends DeltaIOProvider {
5454 write == classOf [DeltaTableV2 ] || write == classOf [GpuDeltaCatalog # GpuStagedDeltaTableV2 ]
5555 }
5656
57+ override def isSupportedFormat (format : Class [_ <: FileFormat ]): Boolean = {
58+ super .isSupportedFormat(format) || format == classOf [GpuDelta33xParquetFileFormat ]
59+ }
60+
5761 override def tagForGpu (
5862 cpuExec : AppendDataExecV1 ,
5963 meta : AppendDataExecV1Meta ): Unit = {
@@ -90,20 +94,14 @@ object Delta33xProvider extends DeltaIOProvider {
9094 override def tagSupportForGpuFileSourceScan (meta : SparkPlanMeta [FileSourceScanExec ]): Unit = {
9195 val format = meta.wrapped.relation.fileFormat
9296 if (format.getClass == classOf [DeltaParquetFileFormat ]) {
97+ val session = meta.wrapped.session
98+ val useMetadataRowIndex =
99+ session.sessionState.conf.getConf(DeltaSQLConf .DELETION_VECTORS_USE_METADATA_ROW_INDEX )
93100 val requiredSchema = meta.wrapped.requiredSchema
94- if (! meta.conf.isParquetPerFileReadEnabled) {
95- if (requiredSchema.exists(_.name == IS_ROW_DELETED_COLUMN_NAME )) {
96- meta.willNotWorkOnGpu(
97- s " reading metadata column $IS_ROW_DELETED_COLUMN_NAME is supported for PERFILE and " +
98- " not supported for " +
99- s " ${RapidsReaderType .withName(meta.conf.get(RapidsConf .PARQUET_READER_TYPE ))}" )
100- }
101- if (requiredSchema.exists(_.name == ROW_INDEX_COLUMN_NAME )) {
102- meta.willNotWorkOnGpu(
103- s " reading metadata column $ROW_INDEX_COLUMN_NAME is supported for PERFILE and " +
104- " not supported for " +
105- s " ${RapidsReaderType .withName(meta.conf.get(RapidsConf .PARQUET_READER_TYPE ))}" )
106- }
101+ val isRowDeletedCol = requiredSchema.exists(_.name == IS_ROW_DELETED_COLUMN_NAME )
102+ if (useMetadataRowIndex && isRowDeletedCol) {
103+ meta.willNotWorkOnGpu(" we don't support generating metadata row index for " +
104+ s " ${meta.wrapped.getClass.getSimpleName}" )
107105 }
108106 GpuReadParquetFileFormat .tagSupport(meta)
109107 } else {
0 commit comments