From commits-return-10909-archive-asf-public=cust-asf.ponee.io@hudi.apache.org Sat Feb 1 13:48:31 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 71C0E180657 for ; Sat, 1 Feb 2020 14:48:31 +0100 (CET) Received: (qmail 69287 invoked by uid 500); 1 Feb 2020 13:48:30 -0000 Mailing-List: contact commits-help@hudi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hudi.apache.org Delivered-To: mailing list commits@hudi.apache.org Received: (qmail 69267 invoked by uid 99); 1 Feb 2020 13:48:30 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Feb 2020 13:48:30 +0000 From: GitBox To: commits@hudi.apache.org Subject: [GitHub] [incubator-hudi] yanghua commented on a change in pull request #1237: [HUDI-583] Code Cleanup, remove redundant code, and other changes Message-ID: <158056491052.13949.3337800671534825986.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Sat, 01 Feb 2020 13:48:30 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 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: users@infra.apache.org With regards, Apache Git Services