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

xushiyan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new 6df8f88  [HUDI-1252] Remove unused class NoOpBulkInsertPartitioner in 
DataSourceTestUtils (#2054)
6df8f88 is described below

commit 6df8f88d86a20bbabeb0acc1103376ac6f461df6
Author: Mathieu <[email protected]>
AuthorDate: Mon Aug 31 18:03:10 2020 +0800

    [HUDI-1252] Remove unused class NoOpBulkInsertPartitioner in 
DataSourceTestUtils (#2054)
---
 .../apache/hudi/testutils/DataSourceTestUtils.java | 45 ----------------------
 1 file changed, 45 deletions(-)

diff --git 
a/hudi-spark/src/test/java/org/apache/hudi/testutils/DataSourceTestUtils.java 
b/hudi-spark/src/test/java/org/apache/hudi/testutils/DataSourceTestUtils.java
index 4c707f5..b0bb509 100644
--- 
a/hudi-spark/src/test/java/org/apache/hudi/testutils/DataSourceTestUtils.java
+++ 
b/hudi-spark/src/test/java/org/apache/hudi/testutils/DataSourceTestUtils.java
@@ -18,16 +18,9 @@
 
 package org.apache.hudi.testutils;
 
-import org.apache.hudi.common.model.HoodieKey;
-import org.apache.hudi.common.model.HoodieRecord;
-import org.apache.hudi.common.model.HoodieRecordPayload;
-import org.apache.hudi.common.testutils.RawTripTestPayload;
 import org.apache.hudi.common.util.FileIOUtils;
-import org.apache.hudi.common.util.Option;
-import org.apache.hudi.table.BulkInsertPartitioner;
 
 import org.apache.avro.Schema;
-import org.apache.spark.api.java.JavaRDD;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.RowFactory;
 
@@ -38,7 +31,6 @@ import java.util.Date;
 import java.util.List;
 import java.util.Random;
 import java.util.UUID;
-import java.util.stream.Collectors;
 
 import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_FIRST_PARTITION_PATH;
 import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_SECOND_PARTITION_PATH;
@@ -49,43 +41,6 @@ import static 
org.apache.hudi.common.testutils.HoodieTestDataGenerator.DEFAULT_T
  */
 public class DataSourceTestUtils {
 
-  public static Option<String> convertToString(HoodieRecord record) {
-    try {
-      String str = ((RawTripTestPayload) record.getData()).getJsonData();
-      str = "{" + str.substring(str.indexOf("\"timestamp\":"));
-      // Remove the last } bracket
-      str = str.substring(0, str.length() - 1);
-      return Option.of(str + ", \"partition\": \"" + record.getPartitionPath() 
+ "\"}");
-    } catch (IOException e) {
-      return Option.empty();
-    }
-  }
-
-  public static List<String> convertToStringList(List<HoodieRecord> records) {
-    return 
records.stream().map(DataSourceTestUtils::convertToString).filter(Option::isPresent).map(Option::get)
-        .collect(Collectors.toList());
-  }
-
-  public static List<String> convertKeysToStringList(List<HoodieKey> keys) {
-    return keys.stream()
-        .map(hr -> "{\"_row_key\":\"" + hr.getRecordKey() + 
"\",\"partition\":\"" + hr.getPartitionPath() + "\"}")
-        .collect(Collectors.toList());
-  }
-
-  public static class NoOpBulkInsertPartitioner<T extends HoodieRecordPayload>
-      implements BulkInsertPartitioner<T> {
-
-    @Override
-    public JavaRDD<HoodieRecord<T>> 
repartitionRecords(JavaRDD<HoodieRecord<T>> records, int outputSparkPartitions) 
{
-      return records;
-    }
-
-    @Override
-    public boolean arePartitionRecordsSorted() {
-      return false;
-    }
-  }
-
   public static Schema getStructTypeExampleSchema() throws IOException {
     return new 
Schema.Parser().parse(FileIOUtils.readAsUTFString(DataSourceTestUtils.class.getResourceAsStream("/exampleSchema.txt")));
   }

Reply via email to