amrishlal commented on code in PR #8978:
URL: https://github.com/apache/hudi/pull/8978#discussion_r1238060345
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieSparkSqlWriter.scala:
##########
@@ -254,11 +254,26 @@ object HoodieSparkSqlWriter {
val (writeResult, writeClient: SparkRDDWriteClient[_]) =
operation match {
- case WriteOperationType.DELETE =>
+ case WriteOperationType.DELETE | WriteOperationType.DELETE_PREPPED =>
val genericRecords = HoodieSparkUtils.createRdd(df,
avroRecordName, avroRecordNamespace)
// Convert to RDD[HoodieKey]
- val keyGenerator =
HoodieSparkKeyGeneratorFactory.createKeyGenerator(new
TypedProperties(hoodieConfig.getProps))
- val hoodieKeysToDelete = genericRecords.map(gr =>
keyGenerator.getKey(gr)).toJavaRDD()
+ val isPrepped =
hoodieConfig.getBooleanOrDefault(DATASOURCE_WRITE_PREPPED_KEY, false)
+ val keyGenerator: Option[BaseKeyGenerator] = if (isPrepped) {
+ None
+ } else {
+ Some(HoodieSparkKeyGeneratorFactory.createKeyGenerator(new
TypedProperties(hoodieConfig.getProps))
+ .asInstanceOf[BaseKeyGenerator])
+ }
+
+ var validatePreppedRecord = true
Review Comment:
As far as I can tell, an `AtomicBoolean` would probably end up serializing
parallel execution here. With regular boolean, validation may occur more than
once but it probably won't occur for every record. If there is no boolean then
every record will get validated.
--
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]