This is an automated email from the ASF dual-hosted git repository.

sivabalan pushed a commit to branch release-0.5.3
in repository https://gitbox.apache.org/repos/asf/hudi.git

commit 0a77a3bbaba64d9b5930429d465b5f4071d494f8
Author: Sivabalan Narayanan <[email protected]>
AuthorDate: Mon May 25 09:54:02 2020 -0400

    Fixing test failures for TestRepairsCommand
---
 .../apache/hudi/cli/commands/RepairsCommand.java   |  6 +++---
 .../hudi/cli/commands/TestRepairsCommand.java      |  2 +-
 .../src/test/resources/log4j-surefire.properties   | 25 ++++++++++++++++++++++
 .../src/test/resources/table-config.properties     | 21 ++++++++++++++++++
 4 files changed, 50 insertions(+), 4 deletions(-)

diff --git 
a/hudi-cli/src/main/java/org/apache/hudi/cli/commands/RepairsCommand.java 
b/hudi-cli/src/main/java/org/apache/hudi/cli/commands/RepairsCommand.java
index 7feebed..d1d9e5e 100644
--- a/hudi-cli/src/main/java/org/apache/hudi/cli/commands/RepairsCommand.java
+++ b/hudi-cli/src/main/java/org/apache/hudi/cli/commands/RepairsCommand.java
@@ -108,6 +108,7 @@ public class RepairsCommand implements CommandMarker {
           HoodiePartitionMetadata partitionMetadata =
               new HoodiePartitionMetadata(HoodieCLI.fs, latestCommit, 
basePath, partitionPath);
           partitionMetadata.trySave(0);
+          row[2] = "Repaired";
         }
       }
       rows[ind++] = row;
@@ -118,8 +119,7 @@ public class RepairsCommand implements CommandMarker {
 
   @CliCommand(value = "repair overwrite-hoodie-props", help = "Overwrite 
hoodie.properties with provided file. Risky operation. Proceed with caution!")
   public String overwriteHoodieProperties(
-      @CliOption(key = {"new-props-file"}, help = "Path to a properties file 
on local filesystem to overwrite the table's hoodie.properties with")
-      final String overwriteFilePath) throws IOException {
+      @CliOption(key = {"new-props-file"}, help = "Path to a properties file 
on local filesystem to overwrite the table's hoodie.properties with") final 
String overwriteFilePath) throws IOException {
 
     HoodieTableMetaClient client = HoodieCLI.getTableMetaClient();
     Properties newProps = new Properties();
@@ -135,7 +135,7 @@ public class RepairsCommand implements CommandMarker {
     String[][] rows = new String[allPropKeys.size()][];
     int ind = 0;
     for (String propKey : allPropKeys) {
-      String[] row = new String[]{
+      String[] row = new String[] {
           propKey,
           oldProps.getOrDefault(propKey, "null"),
           newProps.getOrDefault(propKey, "null").toString()
diff --git 
a/hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestRepairsCommand.java 
b/hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestRepairsCommand.java
index 1192915..9e78ac7 100644
--- 
a/hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestRepairsCommand.java
+++ 
b/hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestRepairsCommand.java
@@ -188,7 +188,7 @@ public class TestRepairsCommand extends 
AbstractShellIntegrationTest {
     for (int i = 100; i < 104; i++) {
       String timestamp = String.valueOf(i);
       // Write corrupted requested Compaction
-      
HoodieTestCommitMetadataGenerator.createCompactionRequestedFile(tablePath, 
timestamp, conf);
+      
HoodieTestCommitMetadataGenerator.createEmptyCleanRequestedFile(tablePath, 
timestamp, conf);
     }
 
     // reload meta client
diff --git a/hudi-cli/src/test/resources/log4j-surefire.properties 
b/hudi-cli/src/test/resources/log4j-surefire.properties
new file mode 100644
index 0000000..11d2f28
--- /dev/null
+++ b/hudi-cli/src/test/resources/log4j-surefire.properties
@@ -0,0 +1,25 @@
+###
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###
+log4j.rootLogger=WARN, A1
+log4j.category.org.apache=INFO
+log4j.category.org.apache.parquet.hadoop=WARN
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
\ No newline at end of file
diff --git a/hudi-cli/src/test/resources/table-config.properties 
b/hudi-cli/src/test/resources/table-config.properties
new file mode 100644
index 0000000..78170f9
--- /dev/null
+++ b/hudi-cli/src/test/resources/table-config.properties
@@ -0,0 +1,21 @@
+###
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###
+hoodie.table.name=test_table
+hoodie.table.type=COPY_ON_WRITE
+hoodie.archivelog.folder=archive
+hoodie.timeline.layout.version=1
\ No newline at end of file

Reply via email to