nsivabalan commented on a change in pull request #3817:
URL: https://github.com/apache/hudi/pull/3817#discussion_r734240126
##########
File path:
hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/functional/TestHoodieDatasetBulkInsertHelper.java
##########
@@ -84,14 +84,35 @@ public TestHoodieDatasetBulkInsertHelper() throws
IOException {
}
private void init() throws IOException {
- schemaStr =
FileIOUtils.readAsUTFString(getClass().getResourceAsStream("/exampleSchema.txt"));
- schema = DataSourceTestUtils.getStructTypeExampleSchema();
+ String schemaPath = "/exampleSchema.txt";
+ schemaStr =
FileIOUtils.readAsUTFString(getClass().getResourceAsStream(schemaPath));
+ Schema schema = DataSourceTestUtils.getStructTypeExampleSchema(schemaPath);
structType = AvroConversionUtils.convertAvroSchemaToStructType(schema);
}
@Test
- public void testBulkInsertHelper() {
- HoodieWriteConfig config =
getConfigBuilder(schemaStr).withProps(getPropsAllSet()).combineInput(false,
false).build();
+ public void testBulkInsertHelperConcurrently() throws IOException {
+ String schema2Path = "/exampleSchema2.txt";
+ String schemaStr2 =
FileIOUtils.readAsUTFString(getClass().getResourceAsStream(schema2Path));
+ StructType structType2 = AvroConversionUtils
+
.convertAvroSchemaToStructType(DataSourceTestUtils.getStructTypeExampleSchema(schema2Path));
+
+ IntStream.range(0, 10).parallel().forEach(i -> {
+ if (i % 2 == 0) {
+ testBulkInsertHelperFor(schemaStr, structType, "_row_key");
+ } else {
+ testBulkInsertHelperFor(schemaStr2, structType2, "_row_key2");
Review comment:
rather than introducing a new schema, can we re-use the same schema, but
change key gen properties? may be choose "ts" as record key.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]