From 8c04bcb876d46e953ece5b2951c9bd2f361783df Mon Sep 17 00:00:00 2001 From: Shohei Okumiya Date: Thu, 5 Dec 2024 00:41:10 +0900 Subject: [PATCH] Core: Generalize Util.blockLocations (#11053) --- .../src/main/java/org/apache/iceberg/hadoop/Util.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/apache/iceberg/hadoop/Util.java b/core/src/main/java/org/apache/iceberg/hadoop/Util.java index e7b6f299a2a1..806d3c91f408 100644 --- a/core/src/main/java/org/apache/iceberg/hadoop/Util.java +++ b/core/src/main/java/org/apache/iceberg/hadoop/Util.java @@ -59,9 +59,18 @@ public static FileSystem getFs(Path path, Configuration conf) { } } + /** + * @deprecated since 1.8.0, will be removed in 1.9.0; use {@link + * Util#blockLocations(ScanTaskGroup, Configuration)} instead. + */ + @Deprecated public static String[] blockLocations(CombinedScanTask task, Configuration conf) { + return blockLocations((ScanTaskGroup) task, conf); + } + + public static String[] blockLocations(ScanTaskGroup taskGroup, Configuration conf) { Set locationSets = Sets.newHashSet(); - for (FileScanTask f : task.files()) { + for (FileScanTask f : taskGroup.tasks()) { Path path = new Path(f.file().location()); try { FileSystem fs = path.getFileSystem(conf);