wangxianghu commented on a change in pull request #1984:
URL: https://github.com/apache/hudi/pull/1984#discussion_r479085868



##########
File path: hudi-spark/src/main/java/org/apache/hudi/keygen/KeyGenerator.java
##########
@@ -41,7 +41,7 @@
   private static final String STRUCT_NAME = "hoodieRowTopLevelField";
   private static final String NAMESPACE = "hoodieRow";
 
-  protected transient TypedProperties config;
+  protected  TypedProperties config;

Review comment:
       > I think so too. @liujinhui1994 can you try with Hudi 0.6.0 and see if 
that helps? We fixed some serialization issues there wrt KeyGenerators.
   
   I tried Both `TimestampBasedKeyGenerator` and `CustomKeyGenerator` with 
0.6.0 (in my IDEA) `TimestampBasedKeyGenerator` is ok, while 
`CustomKeyGenerator` still has NPE. 
   Remove `transient ` can resolve this problem.
   
   `Caused by: java.lang.NullPointerException
        at 
org.apache.hudi.keygen.SimpleKeyGenerator.<init>(SimpleKeyGenerator.java:35)
        at 
org.apache.hudi.keygen.CustomKeyGenerator.getRecordKey(CustomKeyGenerator.java:128)
        at 
org.apache.hudi.keygen.BuiltinKeyGenerator.getKey(BuiltinKeyGenerator.java:75)
        at 
org.apache.hudi.HoodieSparkSqlWriter$$anonfun$1.apply(HoodieSparkSqlWriter.scala:143)
        at 
org.apache.hudi.HoodieSparkSqlWriter$$anonfun$1.apply(HoodieSparkSqlWriter.scala:139)
        at scala.collection.Iterator$$anon$11.next(Iterator.scala:410)
   `
   




----------------------------------------------------------------
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]


Reply via email to