diff --git a/thirdparty/auron-iceberg/src/main/scala/org/apache/iceberg/spark/source/AuronIcebergSourceUtil.scala b/thirdparty/auron-iceberg/src/main/scala/org/apache/iceberg/spark/source/AuronIcebergSourceUtil.scala new file mode 100644 index 000000000..6b04f16a3 --- /dev/null +++ b/thirdparty/auron-iceberg/src/main/scala/org/apache/iceberg/spark/source/AuronIcebergSourceUtil.scala @@ -0,0 +1,28 @@ +/* + * 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.iceberg.spark.source + +object AuronIcebergSourceUtil { + + def getClassOfSparkBatchQueryScan(): Class[SparkBatchQueryScan] = { + classOf[SparkBatchQueryScan] + } + + def getClassOfSparkInputPartition(): Class[SparkInputPartition] = { + classOf[SparkInputPartition] + } +} diff --git a/thirdparty/auron-iceberg/src/main/scala/org/apache/spark/sql/auron/iceberg/IcebergScanSupport.scala b/thirdparty/auron-iceberg/src/main/scala/org/apache/spark/sql/auron/iceberg/IcebergScanSupport.scala index 1d9efbc3b..f2820d154 100644 --- a/thirdparty/auron-iceberg/src/main/scala/org/apache/spark/sql/auron/iceberg/IcebergScanSupport.scala +++ b/thirdparty/auron-iceberg/src/main/scala/org/apache/spark/sql/auron/iceberg/IcebergScanSupport.scala @@ -21,6 +21,7 @@ import scala.util.control.NonFatal import org.apache.iceberg.{FileFormat, FileScanTask, MetadataColumns} import org.apache.iceberg.expressions.{And => IcebergAnd, BoundPredicate, Expression => IcebergExpression, Not => IcebergNot, Or => IcebergOr, UnboundPredicate} +import org.apache.iceberg.spark.source.AuronIcebergSourceUtil import org.apache.spark.internal.Logging import org.apache.spark.sql.auron.NativeConverters import org.apache.spark.sql.catalyst.expressions.{And => SparkAnd, AttributeReference, EqualTo, Expression => SparkExpression, GreaterThan, GreaterThanOrEqual, In, IsNaN, IsNotNull, IsNull, LessThan, LessThanOrEqual, Literal, Not => SparkNot, Or => SparkOr} @@ -47,12 +48,7 @@ object IcebergScanSupport extends Logging { val scan = exec.scan val scanClassName = scan.getClass.getName // Only handle Iceberg scans; other sources must stay on Spark's path. - if (!scanClassName.startsWith("org.apache.iceberg.spark.source.")) { - return None - } - - // Changelog scan carries row-level changes; not supported by native COW-only path. - if (scanClassName == "org.apache.iceberg.spark.source.SparkChangelogScan") { + if (!AuronIcebergSourceUtil.getClassOfSparkBatchQueryScan.isInstance(scan)) { return None } @@ -199,7 +195,7 @@ object IcebergScanSupport extends Logging { private def icebergPartition(partition: InputPartition): Option[IcebergPartitionView] = { val className = partition.getClass.getName // Only accept Iceberg SparkInputPartition to access task groups. - if (className != "org.apache.iceberg.spark.source.SparkInputPartition") { + if (!AuronIcebergSourceUtil.getClassOfSparkInputPartition().isInstance(partition)) { return None }