This is an automated email from the ASF dual-hosted git repository.
agrove pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-comet.git
The following commit(s) were added to refs/heads/main by this push:
new d7a228c4b chore: Remove `SupportsComet` interface (#3818)
d7a228c4b is described below
commit d7a228c4b37f4d8164813f2fbd55ea0e7e2ca0d0
Author: Andy Grove <[email protected]>
AuthorDate: Fri Mar 27 17:45:39 2026 -0600
chore: Remove `SupportsComet` interface (#3818)
---
.../org/apache/comet/parquet/SupportsComet.java | 25 ----------------
.../org/apache/comet/rules/CometExecRule.scala | 2 +-
.../org/apache/comet/rules/CometScanRule.scala | 33 ++--------------------
3 files changed, 3 insertions(+), 57 deletions(-)
diff --git a/common/src/main/java/org/apache/comet/parquet/SupportsComet.java
b/common/src/main/java/org/apache/comet/parquet/SupportsComet.java
deleted file mode 100644
index b95c31ce9..000000000
--- a/common/src/main/java/org/apache/comet/parquet/SupportsComet.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.comet.parquet;
-
-/** This is implemented in Apache Iceberg */
-public interface SupportsComet {
- boolean isCometEnabled();
-}
diff --git a/spark/src/main/scala/org/apache/comet/rules/CometExecRule.scala
b/spark/src/main/scala/org/apache/comet/rules/CometExecRule.scala
index 76e741e3b..70983b059 100644
--- a/spark/src/main/scala/org/apache/comet/rules/CometExecRule.scala
+++ b/spark/src/main/scala/org/apache/comet/rules/CometExecRule.scala
@@ -185,7 +185,7 @@ case class CometExecRule(session: SparkSession) extends
Rule[SparkPlan] {
convertToComet(scan, CometNativeScan).getOrElse(scan)
// Fully native Iceberg scan for V2 (iceberg-rust path)
- // Only handle scans with native metadata; SupportsComet scans fall
through to isCometScan
+ // Only handle scans with native metadata; other scans fall through to
isCometScan
// Config checks (COMET_ICEBERG_NATIVE_ENABLED, COMET_EXEC_ENABLED) are
done in CometScanRule
case scan: CometBatchScanExec if
scan.nativeIcebergScanMetadata.isDefined =>
convertToComet(scan, CometIcebergNativeScan).getOrElse(scan)
diff --git a/spark/src/main/scala/org/apache/comet/rules/CometScanRule.scala
b/spark/src/main/scala/org/apache/comet/rules/CometScanRule.scala
index c004d7728..863126397 100644
--- a/spark/src/main/scala/org/apache/comet/rules/CometScanRule.scala
+++ b/spark/src/main/scala/org/apache/comet/rules/CometScanRule.scala
@@ -47,8 +47,8 @@ import
org.apache.comet.CometSparkSessionExtensions.{isCometLoaded, withInfo, wi
import org.apache.comet.DataTypeSupport.isComplexType
import org.apache.comet.iceberg.{CometIcebergNativeScanMetadata,
IcebergReflection}
import org.apache.comet.objectstore.NativeConfig
-import org.apache.comet.parquet.{Native, SupportsComet}
import org.apache.comet.parquet.CometParquetUtils.{encryptionEnabled,
isEncryptionConfigSupported}
+import org.apache.comet.parquet.Native
import org.apache.comet.serde.operator.{CometIcebergNativeScan,
CometNativeScan}
import org.apache.comet.shims.{CometTypeShim, ShimFileFormat,
ShimSubqueryBroadcast}
@@ -303,36 +303,7 @@ case class CometScanRule(session: SparkSession)
withInfos(scanExec, fallbackReasons.toSet)
}
- // Iceberg scan - patched version implementing SupportsComet interface
- case s: SupportsComet if !COMET_ICEBERG_NATIVE_ENABLED.get() =>
- val fallbackReasons = new ListBuffer[String]()
-
- if (!s.isCometEnabled) {
- fallbackReasons += "Comet extension is not enabled for " +
- s"${scanExec.scan.getClass.getSimpleName}: not enabled on data
source side"
- }
-
- val schemaSupported =
- CometBatchScanExec.isSchemaSupported(scanExec.scan.readSchema(),
fallbackReasons)
-
- if (!schemaSupported) {
- fallbackReasons += "Comet extension is not enabled for " +
- s"${scanExec.scan.getClass.getSimpleName}: Schema not supported"
- }
-
- if (s.isCometEnabled && schemaSupported) {
- // When reading from Iceberg, we automatically enable type promotion
- SQLConf.get.setConfString(COMET_SCHEMA_EVOLUTION_ENABLED.key, "true")
- // When reading from Iceberg, we automatically disable native
columnar to row
- SQLConf.get.setConfString(COMET_NATIVE_COLUMNAR_TO_ROW_ENABLED.key,
"false")
- CometBatchScanExec(
- scanExec.clone().asInstanceOf[BatchScanExec],
- runtimeFilters = scanExec.runtimeFilters)
- } else {
- withInfos(scanExec, fallbackReasons.toSet)
- }
-
- // Iceberg scan - detected by class name (works with unpatched Iceberg)
+ // Iceberg scan - detected by class name
case _
if scanExec.scan.getClass.getName ==
"org.apache.iceberg.spark.source.SparkBatchQueryScan" =>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]