zhedoubushishi commented on a change in pull request #1869:
URL: https://github.com/apache/hudi/pull/1869#discussion_r466589474
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/bootstrap/index/HFileBootstrapIndex.java
##########
@@ -240,13 +240,21 @@ private HoodieBootstrapIndexInfo
fetchBootstrapIndexInfo() throws IOException {
@Override
public List<String> getIndexedPartitionPaths() {
HFileScanner scanner = partitionIndexReader().getScanner(true, true);
- return getAllKeys(scanner);
+ List<String> cellKeys = getAllKeys(scanner);
+ // cellKey is in this format:
+ // part=datestr=2452537//LATEST_TIMESTAMP/Put/vlen=2405/seqid=0
+ return cellKeys.stream().map(key -> key.split("//")[0].substring(5))
+ .distinct().collect(Collectors.toList());
}
@Override
public List<String> getIndexedFileIds() {
HFileScanner scanner = fileIdIndexReader().getScanner(true, true);
- return getAllKeys(scanner);
+ List<String> cellKeys = getAllKeys(scanner);
+ // cellKey is in this format:
+ //
part=datestr=2452537;fileid=baab9c50-c35e-49d1-b928-695aa7e37833//LATEST_TIMESTAMP/Put/vlen=2312/seqid=0
+ return cellKeys.stream().map(key ->
key.split("//")[0].split(";")[1].split("=")[1])
Review comment:
These two methods are only called in ```TestBootstrapIndex```. And what
it does in the test code is to check the size of the result, so that's why we
fail to catch this error before. Let me create a separate commit/pr to include
this fix and also add some test cases to cover these two methods.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]