-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-1371] [HUDI-1893] Support metadata based listing for Spark DataSource and Spark SQL #2893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,8 +33,10 @@ | |
| import java.io.IOException; | ||
| import java.util.ArrayList; | ||
| import java.util.Arrays; | ||
| import java.util.Collections; | ||
| import java.util.LinkedList; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| public class FileSystemBackedTableMetadata implements HoodieTableMetadata { | ||
|
|
@@ -105,6 +107,24 @@ public List<String> getAllPartitionPaths() throws IOException { | |
| return partitionPaths; | ||
| } | ||
|
|
||
| @Override | ||
| public Map<String, FileStatus[]> getAllFilesInPartitions(List<String> partitionPaths) | ||
| throws IOException { | ||
| if (partitionPaths == null || partitionPaths.isEmpty()) { | ||
| return Collections.emptyMap(); | ||
| } | ||
|
|
||
| int parallelism = Math.min(DEFAULT_LISTING_PARALLELISM, partitionPaths.size()); | ||
|
|
||
| List<Pair<String, FileStatus[]>> partitionToFiles = engineContext.map(partitionPaths, partitionPathStr -> { | ||
| Path partitionPath = new Path(partitionPathStr); | ||
| FileSystem fs = partitionPath.getFileSystem(hadoopConf.get()); | ||
| return Pair.of(partitionPathStr, FSUtils.getAllDataFilesInPartition(fs, partitionPath)); | ||
|
||
| }, parallelism); | ||
|
|
||
| return partitionToFiles.stream().collect(Collectors.toMap(Pair::getLeft, Pair::getRight)); | ||
| } | ||
|
|
||
| @Override | ||
| public Option<String> getSyncedInstantTime() { | ||
| throw new UnsupportedOperationException(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.