This is an automated email from the ASF dual-hosted git repository.

chengchengjin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new dc14a15802 [GLUTEN-11341][VL] Add iceberg shim to fix deprecated 
method (#11367)
dc14a15802 is described below

commit dc14a15802219b45187c097e1bc9e76cdac78c1d
Author: Jin Chengcheng <[email protected]>
AuthorDate: Fri Jan 9 12:15:53 2026 +0800

    [GLUTEN-11341][VL] Add iceberg shim to fix deprecated method (#11367)
---
 .../java/org/apache/gluten/ContentFileUtil.java    | 25 ++++++++++++++++++++++
 .../java/org/apache/gluten/ContentFileUtil.java    | 25 ++++++++++++++++++++++
 .../java/org/apache/gluten/ContentFileUtil.java    | 25 ++++++++++++++++++++++
 .../spark/source/GlutenIcebergSourceUtil.scala     |  5 ++---
 pom.xml                                            |  8 +++++++
 5 files changed, 85 insertions(+), 3 deletions(-)

diff --git 
a/gluten-iceberg/src-iceberg10/main/java/org/apache/gluten/ContentFileUtil.java 
b/gluten-iceberg/src-iceberg10/main/java/org/apache/gluten/ContentFileUtil.java
new file mode 100644
index 0000000000..39a13ca20d
--- /dev/null
+++ 
b/gluten-iceberg/src-iceberg10/main/java/org/apache/gluten/ContentFileUtil.java
@@ -0,0 +1,25 @@
+/*
+ * 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.gluten;
+
+import org.apache.iceberg.ContentFile;
+
+public class ContentFileUtil {
+  public static String getFilePath(ContentFile<?> file) {
+    return file.location();
+  }
+}
diff --git 
a/gluten-iceberg/src-iceberg3/main/java/org/apache/gluten/ContentFileUtil.java 
b/gluten-iceberg/src-iceberg3/main/java/org/apache/gluten/ContentFileUtil.java
new file mode 100644
index 0000000000..52c168aa79
--- /dev/null
+++ 
b/gluten-iceberg/src-iceberg3/main/java/org/apache/gluten/ContentFileUtil.java
@@ -0,0 +1,25 @@
+/*
+ * 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.gluten;
+
+import org.apache.iceberg.ContentFile;
+
+public class ContentFileUtil {
+  public static String getFilePath(ContentFile<?> file) {
+    return file.path().toString();
+  }
+}
diff --git 
a/gluten-iceberg/src-iceberg5/main/java/org/apache/gluten/ContentFileUtil.java 
b/gluten-iceberg/src-iceberg5/main/java/org/apache/gluten/ContentFileUtil.java
new file mode 100644
index 0000000000..52c168aa79
--- /dev/null
+++ 
b/gluten-iceberg/src-iceberg5/main/java/org/apache/gluten/ContentFileUtil.java
@@ -0,0 +1,25 @@
+/*
+ * 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.gluten;
+
+import org.apache.iceberg.ContentFile;
+
+public class ContentFileUtil {
+  public static String getFilePath(ContentFile<?> file) {
+    return file.path().toString();
+  }
+}
diff --git 
a/gluten-iceberg/src/main/scala/org/apache/iceberg/spark/source/GlutenIcebergSourceUtil.scala
 
b/gluten-iceberg/src/main/scala/org/apache/iceberg/spark/source/GlutenIcebergSourceUtil.scala
index f1122280c1..72617f4594 100644
--- 
a/gluten-iceberg/src/main/scala/org/apache/iceberg/spark/source/GlutenIcebergSourceUtil.scala
+++ 
b/gluten-iceberg/src/main/scala/org/apache/iceberg/spark/source/GlutenIcebergSourceUtil.scala
@@ -16,6 +16,7 @@
  */
 package org.apache.iceberg.spark.source
 
+import org.apache.gluten.ContentFileUtil
 import org.apache.gluten.backendsapi.BackendsApiManager
 import org.apache.gluten.exception.GlutenNotSupportException
 import org.apache.gluten.execution.SparkDataSourceRDDPartition
@@ -33,7 +34,6 @@ import org.apache.iceberg.spark.SparkSchemaUtil
 import java.lang.{Class, Long => JLong}
 import java.util.{ArrayList => JArrayList, HashMap => JHashMap, List => JList, 
Map => JMap}
 
-import scala.annotation.nowarn
 import scala.collection.JavaConverters._
 
 object GlutenIcebergSourceUtil {
@@ -51,7 +51,6 @@ object GlutenIcebergSourceUtil {
     }
   }
 
-  @nowarn
   def genSplitInfo(
       partition: SparkDataSourceRDDPartition,
       readPartitionSchema: StructType): SplitInfo = {
@@ -69,7 +68,7 @@ object GlutenIcebergSourceUtil {
           task =>
             paths.add(
               BackendsApiManager.getTransformerApiInstance
-                .encodeFilePathIfNeed(task.file().path().toString))
+                
.encodeFilePathIfNeed(ContentFileUtil.getFilePath(task.file())))
             starts.add(task.start())
             lengths.add(task.length())
             partitionColumns.add(getPartitionColumns(task, 
readPartitionSchema))
diff --git a/pom.xml b/pom.xml
index b88fa8dfee..5bd520a462 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,6 +73,7 @@
     <spark.version>3.5.5</spark.version>
     
<sparkshim.artifactId>spark-sql-columnar-shims-spark35</sparkshim.artifactId>
     <iceberg.version>1.10.0</iceberg.version>
+    <iceberg.binary.version>10</iceberg.binary.version>
     <paimon.version>1.2.0</paimon.version>
     <delta.package.name>delta-spark</delta.package.name>
     <delta.version>3.3.2</delta.version>
@@ -1077,6 +1078,7 @@
         
<sparkshim.artifactId>spark-sql-columnar-shims-spark32</sparkshim.artifactId>
         <spark.version>3.2.2</spark.version>
         <iceberg.version>1.3.1</iceberg.version>
+        <iceberg.binary.version>3</iceberg.binary.version>
         <delta.package.name>delta-core</delta.package.name>
         <delta.version>2.0.1</delta.version>
         <delta.binary.version>20</delta.binary.version>
@@ -1109,6 +1111,7 @@
         
<sparkshim.artifactId>spark-sql-columnar-shims-spark33</sparkshim.artifactId>
         <spark.version>3.3.1</spark.version>
         <iceberg.version>1.5.0</iceberg.version>
+        <iceberg.binary.version>5</iceberg.binary.version>
         <delta.package.name>delta-core</delta.package.name>
         <delta.version>2.3.0</delta.version>
         <delta.binary.version>23</delta.binary.version>
@@ -1708,6 +1711,8 @@
                   <sources>
                     <source>${project.basedir}/src-iceberg/main/scala</source>
                     <source>${project.basedir}/src-iceberg/main/java</source>
+                    
<source>${project.basedir}/src-iceberg${iceberg.binary.version}/main/scala</source>
+                    
<source>${project.basedir}/src-iceberg${iceberg.binary.version}/main/java</source>
                     
<source>${project.basedir}/src-iceberg-spark${spark.plain.version}/main/scala</source>
                     
<source>${project.basedir}/src-iceberg-spark${spark.plain.version}/main/java</source>
                   </sources>
@@ -1737,6 +1742,8 @@
                   <sources>
                     <source>${project.basedir}/src-iceberg/test/scala</source>
                     <source>${project.basedir}/src-iceberg/test/java</source>
+                    
<source>${project.basedir}/src-iceberg${iceberg.binary.version}/test/scala</source>
+                    
<source>${project.basedir}/src-iceberg${iceberg.binary.version}/test/java</source>
                   </sources>
                 </configuration>
               </execution>
@@ -1750,6 +1757,7 @@
                   <resources>
                     <resource>
                       
<directory>${project.basedir}/src-iceberg/test/resources</directory>
+                      
<directory>${project.basedir}/src-iceberg${iceberg.binary.version}/test/resources</directory>
                     </resource>
                   </resources>
                 </configuration>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to