yanghua commented on a change in pull request #1237: [HUDI-583] Code Cleanup,
remove redundant code, and other changes
URL: https://github.com/apache/incubator-hudi/pull/1237#discussion_r373778785
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/versioning/compaction/CompactionV1MigrationHandler.java
##########
@@ -59,14 +59,12 @@ public HoodieCompactionPlan
downgradeFrom(HoodieCompactionPlan input) {
final Path basePath = new Path(metaClient.getBasePath());
List<HoodieCompactionOperation> v1CompactionOperationList = new
ArrayList<>();
if (null != input.getOperations()) {
- v1CompactionOperationList = input.getOperations().stream().map(inp -> {
- return
HoodieCompactionOperation.newBuilder().setBaseInstantTime(inp.getBaseInstantTime())
-
.setFileId(inp.getFileId()).setPartitionPath(inp.getPartitionPath()).setMetrics(inp.getMetrics())
- .setDataFilePath(convertToV1Path(basePath, inp.getPartitionPath(),
inp.getDataFilePath()))
- .setDeltaFilePaths(inp.getDeltaFilePaths().stream()
- .map(s -> convertToV1Path(basePath, inp.getPartitionPath(),
s)).collect(Collectors.toList()))
- .build();
- }).collect(Collectors.toList());
+ v1CompactionOperationList = input.getOperations().stream().map(inp ->
HoodieCompactionOperation.newBuilder().setBaseInstantTime(inp.getBaseInstantTime())
+
.setFileId(inp.getFileId()).setPartitionPath(inp.getPartitionPath()).setMetrics(inp.getMetrics())
Review comment:
If we let builder's each `setXXX` method one line, the readability would be
better. WDYT?
----------------------------------------------------------------
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]
With regards,
Apache Git Services