You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/10/18 09:33:26 UTC

[GitHub] [hudi] novakov-alexey commented on a change in pull request #3817: fix: HoodieDatasetBulkInsertHelper concurrently rowkey not found

novakov-alexey commented on a change in pull request #3817:
URL: https://github.com/apache/hudi/pull/3817#discussion_r730741735



##########
File path: hudi-spark-datasource/hudi-spark/src/main/java/org/apache/hudi/HoodieDatasetBulkInsertHelper.java
##########
@@ -80,17 +81,18 @@
     String keyGeneratorClass = properties.getString(DataSourceWriteOptions.KEYGENERATOR_CLASS_NAME().key());
     BuiltinKeyGenerator keyGenerator = (BuiltinKeyGenerator) ReflectionUtils.loadClass(keyGeneratorClass, properties);
     StructType structTypeForUDF = rows.schema();
-
-    sqlContext.udf().register(RECORD_KEY_UDF_FN, (UDF1<Row, String>) keyGenerator::getRecordKey, DataTypes.StringType);
-    sqlContext.udf().register(PARTITION_PATH_UDF_FN, (UDF1<Row, String>) keyGenerator::getPartitionPath, DataTypes.StringType);
+    String recordKeyUdfFnCurrent = RECORD_KEY_UDF_FN + UUID.randomUUID().toString();
+    String partitionPathUdfFnCurrent = PARTITION_PATH_UDF_FN + UUID.randomUUID().toString();
+    sqlContext.udf().register(recordKeyUdfFnCurrent, (UDF1<Row, String>) keyGenerator::getRecordKey, DataTypes.StringType);

Review comment:
       Does it mean that getRecordKey and getPartitionPath may be equal from different tables, so that adding random suffix to them help?




-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org