File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
spark/src/main/scala/org/apache/comet/serde Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments