Skip to content

Commit c44973b

Browse files
committed
Remove old path() code path.
1 parent 970b692 commit c44973b

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,19 +1272,10 @@ object QueryPlanSerde extends Logging with CometExprShim {
12721272
fileMethod.setAccessible(true)
12731273
val dataFile = fileMethod.invoke(task)
12741274

1275-
// Get path from DataFile - use location() (or path())
1275+
// Get path from DataFile using location() (added in Iceberg 1.7.0)
12761276
val dataFileClass = dataFile.getClass
1277-
val filePath =
1278-
try {
1279-
// Try location() first (newer API)
1280-
val locationMethod = dataFileClass.getMethod("location")
1281-
locationMethod.invoke(dataFile).asInstanceOf[String]
1282-
} catch {
1283-
case _: NoSuchMethodException =>
1284-
// Fall back to path() (older API, returns CharSequence)
1285-
val pathMethod = dataFileClass.getMethod("path")
1286-
pathMethod.invoke(dataFile).asInstanceOf[CharSequence].toString
1287-
}
1277+
val locationMethod = dataFileClass.getMethod("location")
1278+
val filePath = locationMethod.invoke(dataFile).asInstanceOf[String]
12881279
taskBuilder.setDataFilePath(filePath)
12891280

12901281
// Get start offset

0 commit comments

Comments
 (0)