zhangyue19921010 opened a new issue #4846:
URL: https://github.com/apache/hudi/issues/4846
Here is Override function fetchLatestBaseFile(String partitionPath, String
fileId) in RocksDbBasedFileSystemView
```
@Override
protected Option<HoodieBaseFile> fetchLatestBaseFile(String partitionPath,
String fileId) {
// Retries only file-slices of the file and filters for the latest
return Option
.ofNullable(rocksDB
.<HoodieBaseFile>prefixSearch(schemaHelper.getColFamilyForView(),
schemaHelper.getPrefixForDataFileViewByPartitionFile(partitionPath, fileId))
.map(Pair::getValue).reduce(null,
(x, y) -> ((x == null) ? y
: (y == null) ? null
:
HoodieTimeline.compareTimestamps(x.getCommitTime(),
HoodieTimeline.GREATER_THAN, y.getCommitTime())
? x
: y)));
}
```
Question is Why we need to OverWrite this un-abstract function in
AbstractTableFileSystemView
```
/**
* Default implementation for fetching latest base-file.
*
* @param partitionPath Partition path
* @param fileId File Id
* @return base File if present
*/
protected Option<HoodieBaseFile> fetchLatestBaseFile(String partitionPath,
String fileId) {
return Option.fromJavaOptional(fetchLatestBaseFiles(partitionPath)
.filter(fs -> fs.getFileId().equals(fileId)).findFirst());
}
```
Is it necessary? Or Is it correctly if we don't flow this common logic.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]