[HUDI-402]: code clean up in test cases
This commit is contained in:
committed by
vinoth chandar
parent
98c0d8cf60
commit
dde21e7315
@@ -41,7 +41,7 @@ public class DataSourceTestUtils {
|
||||
}
|
||||
|
||||
public static List<String> convertToStringList(List<HoodieRecord> records) {
|
||||
return records.stream().map(hr -> convertToString(hr)).filter(os -> os.isPresent()).map(os -> os.get())
|
||||
return records.stream().map(DataSourceTestUtils::convertToString).filter(Option::isPresent).map(Option::get)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
@@ -114,13 +114,12 @@ public class HoodieJavaApp {
|
||||
} else {
|
||||
dataGen = new HoodieTestDataGenerator();
|
||||
}
|
||||
List<HoodieRecord> recordsSoFar = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Commit with only inserts
|
||||
*/
|
||||
// Generate some input..
|
||||
recordsSoFar.addAll(dataGen.generateInserts("001"/* ignore */, 100));
|
||||
List<HoodieRecord> recordsSoFar = new ArrayList<>(dataGen.generateInserts("001"/* ignore */, 100));
|
||||
List<String> records1 = DataSourceTestUtils.convertToStringList(recordsSoFar);
|
||||
Dataset<Row> inputDF1 = spark.read().json(jssc.parallelize(records1, 2));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user