|
27 | 27 | import java.util.Set;
|
28 | 28 | import java.util.function.BiFunction;
|
29 | 29 | import java.util.function.Function;
|
| 30 | +import java.util.stream.Collectors; |
30 | 31 | import org.apache.iceberg.BaseTable;
|
31 | 32 | import org.apache.iceberg.CatalogProperties;
|
32 | 33 | import org.apache.iceberg.CatalogUtil;
|
|
54 | 55 | import org.apache.iceberg.io.CloseableGroup;
|
55 | 56 | import org.apache.iceberg.io.FileIO;
|
56 | 57 | import org.apache.iceberg.io.FileIOTracker;
|
| 58 | +import org.apache.iceberg.io.ImmutableStorageCredential; |
| 59 | +import org.apache.iceberg.io.StorageCredential; |
57 | 60 | import org.apache.iceberg.metrics.MetricsReporter;
|
58 | 61 | import org.apache.iceberg.metrics.MetricsReporters;
|
59 | 62 | import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
|
@@ -972,7 +975,16 @@ private FileIO newFileIO(
|
972 | 975 | return ioBuilder.apply(context, properties);
|
973 | 976 | } else {
|
974 | 977 | String ioImpl = properties.getOrDefault(CatalogProperties.FILE_IO_IMPL, DEFAULT_FILE_IO_IMPL);
|
975 |
| - return CatalogUtil.loadFileIO(ioImpl, properties, conf, storageCredentials); |
| 978 | + List<StorageCredential> credentials = |
| 979 | + storageCredentials.stream() |
| 980 | + .map( |
| 981 | + c -> |
| 982 | + ImmutableStorageCredential.builder() |
| 983 | + .prefix(c.prefix()) |
| 984 | + .config(c.config()) |
| 985 | + .build()) |
| 986 | + .collect(Collectors.toList()); |
| 987 | + return CatalogUtil.loadFileIO(ioImpl, properties, conf, credentials); |
976 | 988 | }
|
977 | 989 | }
|
978 | 990 |
|
|
0 commit comments