@@ -33,8 +33,8 @@ import org.apache.spark.sql.execution.datasources.v2.parquet.ParquetScan
33
33
import org .apache .spark .sql .internal .SQLConf
34
34
35
35
import org .apache .comet .CometConf
36
- import org .apache .comet .CometConf .{ COMET_DPP_FALLBACK_ENABLED , COMET_EXEC_ENABLED , COMET_NATIVE_SCAN_IMPL , COMET_SCHEMA_EVOLUTION_ENABLED , SCAN_NATIVE_ICEBERG_COMPAT }
37
- import org .apache .comet .CometSparkSessionExtensions .{isCometLoaded , isCometScanEnabled , withInfo }
36
+ import org .apache .comet .CometConf ._
37
+ import org .apache .comet .CometSparkSessionExtensions .{isCometLoaded , isCometScanEnabled , withInfo , withInfos }
38
38
import org .apache .comet .parquet .{CometParquetScan , SupportsComet }
39
39
40
40
case class CometScanRule (session : SparkSession ) extends Rule [SparkPlan ] {
@@ -86,14 +86,21 @@ case class CometScanRule(session: SparkSession) extends Rule[SparkPlan] {
86
86
val fallbackReasons = new ListBuffer [String ]()
87
87
if (! CometScanExec .isFileFormatSupported(r.fileFormat)) {
88
88
fallbackReasons += s " Unsupported file format ${r.fileFormat}"
89
- return withInfo (scanExec, fallbackReasons.mkString( " , " ) )
89
+ return withInfos (scanExec, fallbackReasons.toSet )
90
90
}
91
91
92
92
val scanImpl = COMET_NATIVE_SCAN_IMPL .get()
93
93
if (scanImpl == CometConf .SCAN_NATIVE_DATAFUSION && ! COMET_EXEC_ENABLED .get()) {
94
94
fallbackReasons +=
95
95
s " Full native scan disabled because ${COMET_EXEC_ENABLED .key} disabled "
96
- return withInfo(scanExec, fallbackReasons.mkString(" , " ))
96
+ return withInfos(scanExec, fallbackReasons.toSet)
97
+ }
98
+
99
+ if (scanImpl == CometConf .SCAN_NATIVE_DATAFUSION && scanExec.bucketedScan) {
100
+ // https://github.com/apache/datafusion-comet/issues/1719
101
+ fallbackReasons +=
102
+ " Full native scan disabled because bucketed scan is not supported"
103
+ return withInfos(scanExec, fallbackReasons.toSet)
97
104
}
98
105
99
106
val (schemaSupported, partitionSchemaSupported) = scanImpl match {
@@ -117,7 +124,7 @@ case class CometScanRule(session: SparkSession) extends Rule[SparkPlan] {
117
124
if (schemaSupported && partitionSchemaSupported) {
118
125
CometScanExec (scanExec, session)
119
126
} else {
120
- withInfo (scanExec, fallbackReasons.mkString( " , " ) )
127
+ withInfos (scanExec, fallbackReasons.toSet )
121
128
}
122
129
123
130
case _ =>
@@ -152,7 +159,7 @@ case class CometScanRule(session: SparkSession) extends Rule[SparkPlan] {
152
159
scanExec.copy(scan = cometScan),
153
160
runtimeFilters = scanExec.runtimeFilters)
154
161
} else {
155
- withInfo (scanExec, fallbackReasons.mkString( " , " ) )
162
+ withInfos (scanExec, fallbackReasons.toSet )
156
163
}
157
164
158
165
// Iceberg scan
@@ -179,7 +186,7 @@ case class CometScanRule(session: SparkSession) extends Rule[SparkPlan] {
179
186
scanExec.clone().asInstanceOf [BatchScanExec ],
180
187
runtimeFilters = scanExec.runtimeFilters)
181
188
} else {
182
- withInfo (scanExec, fallbackReasons.mkString( " , " ) )
189
+ withInfos (scanExec, fallbackReasons.toSet )
183
190
}
184
191
185
192
case other =>
0 commit comments