bschell commented on a change in pull request #1194: [HUDI-326] Add support to 
delete records with only record_key
URL: https://github.com/apache/incubator-hudi/pull/1194#discussion_r363869991
 
 

 ##########
 File path: hudi-spark/src/main/scala/org/apache/hudi/HoodieSparkSqlWriter.scala
 ##########
 @@ -161,7 +162,17 @@ private[hudi] object HoodieSparkSqlWriter {
       // Convert to RDD[HoodieKey]
       val keyGenerator = 
DataSourceUtils.createKeyGenerator(toProperties(parameters))
       val genericRecords: RDD[GenericRecord] = 
AvroConversionUtils.createRdd(df, structName, nameSpace)
-      val hoodieKeysToDelete = genericRecords.map(gr => 
keyGenerator.getKey(gr)).toJavaRDD()
+      val hoodieKeysToDelete = if 
(HoodieIndex.GLOBAL_INDICES.contains(parameters(HoodieIndexConfig.INDEX_TYPE_PROP)))
 {
 
 Review comment:
   @n3nash thanks for bringing that keyGenerator to my attention. That better 
serves my use case. Do you think extending it into a "GlobalDeleteKeyGenerator" 
would be a valid change instead? Or possibly creating an entirely new 
keyGenerator for global deletes instead, because the nonpartitionedKeyGenerator 
would not work if you are using the complex key generator.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to