hudi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-hudi] n3nash commented on a change in pull request #1194: [HUDI-326] Add support to delete records with only record_key
Date Tue, 07 Jan 2020 01:14:27 GMT
n3nash 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_r363554374
 
 

 ##########
 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:
   There is a NonPartitionedKeyGenerator that you can pass and use for deletions. Since as
a client you are aware of 2 facts a) Either you are using GLOBAL_INDEX or not b) If this batch
is for Deletions, you can configure the hudi client accordingly with a correct partition generator
-> https://github.com/apache/incubator-hudi/blob/master/hudi-spark/src/main/java/org/apache/hudi/NonpartitionedKeyGenerator.java
   May be we can extend this class to reflect the correct key generation strategy for deletions
with a more reasonable explicit name 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message