use of org.apache.hudi.hadoop.realtime.HoodieRealtimeBootstrapBaseFileSplit in project presto by prestodb.
the class HudiRealtimeBootstrapBaseFileSplitConverter method extractCustomSplitInfo.
@Override
public Optional<Map<String, String>> extractCustomSplitInfo(FileSplit split) {
if (split instanceof HoodieRealtimeBootstrapBaseFileSplit) {
ImmutableMap.Builder<String, String> customSplitInfo = ImmutableMap.builder();
HoodieRealtimeBootstrapBaseFileSplit hudiSplit = (HoodieRealtimeBootstrapBaseFileSplit) split;
customSplitInfo.put(CUSTOM_FILE_SPLIT_CLASS_KEY, HoodieRealtimeBootstrapBaseFileSplit.class.getName());
customSplitInfo.put(BASE_PATH_KEY, hudiSplit.getBasePath());
customSplitInfo.put(MAX_COMMIT_TIME_KEY, hudiSplit.getMaxCommitTime());
customSplitInfo.put(DELTA_FILE_PATHS_KEY, String.join(",", hudiSplit.getDeltaLogPaths()));
customSplitInfo.put(BOOTSTRAP_FILE_SPLIT_PATH, hudiSplit.getBootstrapFileSplit().getPath().toString());
customSplitInfo.put(BOOTSTRAP_FILE_SPLIT_START, String.valueOf(hudiSplit.getBootstrapFileSplit().getStart()));
customSplitInfo.put(BOOTSTRAP_FILE_SPLIT_LEN, String.valueOf(hudiSplit.getBootstrapFileSplit().getLength()));
return Optional.of(customSplitInfo.build());
}
return Optional.empty();
}
Aggregations