You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by vi...@apache.org on 2020/10/21 06:36:32 UTC

[hudi] branch master updated: [HUDI-1200] fixed NPE in CustomKeyGenerator (#2093)

This is an automated email from the ASF dual-hosted git repository.

vinoth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new e493174  [HUDI-1200] fixed NPE in CustomKeyGenerator (#2093)
e493174 is described below

commit e4931744ebcb6380ec967636213c406fd80a735f
Author: Pratyaksh Sharma <pr...@gmail.com>
AuthorDate: Wed Oct 21 12:06:25 2020 +0530

    [HUDI-1200] fixed NPE in CustomKeyGenerator (#2093)
    
    - config field is no longer transient in key generator
    - verified that the key generator object is shipped from the driver to executors, just the one time and reused for each record
---
 hudi-spark/src/main/java/org/apache/hudi/keygen/CustomKeyGenerator.java | 1 -
 hudi-spark/src/main/java/org/apache/hudi/keygen/KeyGenerator.java       | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/hudi-spark/src/main/java/org/apache/hudi/keygen/CustomKeyGenerator.java b/hudi-spark/src/main/java/org/apache/hudi/keygen/CustomKeyGenerator.java
index 2ac6b77..e457688 100644
--- a/hudi-spark/src/main/java/org/apache/hudi/keygen/CustomKeyGenerator.java
+++ b/hudi-spark/src/main/java/org/apache/hudi/keygen/CustomKeyGenerator.java
@@ -118,7 +118,6 @@ public class CustomKeyGenerator extends BuiltinKeyGenerator {
       partitionPath.append(DEFAULT_PARTITION_PATH_SEPARATOR);
     }
     partitionPath.deleteCharAt(partitionPath.length() - 1);
-
     return partitionPath.toString();
   }
 
diff --git a/hudi-spark/src/main/java/org/apache/hudi/keygen/KeyGenerator.java b/hudi-spark/src/main/java/org/apache/hudi/keygen/KeyGenerator.java
index 7c67f9a..3b1db08 100644
--- a/hudi-spark/src/main/java/org/apache/hudi/keygen/KeyGenerator.java
+++ b/hudi-spark/src/main/java/org/apache/hudi/keygen/KeyGenerator.java
@@ -41,7 +41,7 @@ public abstract class KeyGenerator implements Serializable, SparkKeyGeneratorInt
   private static final String STRUCT_NAME = "hoodieRowTopLevelField";
   private static final String NAMESPACE = "hoodieRow";
 
-  protected transient TypedProperties config;
+  protected TypedProperties config;
   private transient Function1<Object, Object> converterFn = null;
 
   protected KeyGenerator(TypedProperties config) {