You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2020/01/03 08:46:40 UTC

[GitHub] [incubator-hudi] bvaradar commented on a change in pull request #1154: [HUDI-406] Added default partition path in TimestampBasedKeyGenerator

bvaradar commented on a change in pull request #1154: [HUDI-406] Added default partition path in TimestampBasedKeyGenerator
URL: https://github.com/apache/incubator-hudi/pull/1154#discussion_r362736026
 
 

 ##########
 File path: hudi-spark/src/main/java/org/apache/hudi/DataSourceUtils.java
 ##########
 @@ -52,29 +52,18 @@
  */
 public class DataSourceUtils {
 
-  /**
-   * Obtain value of the provided nullable field as string, denoted by dot notation. e.g: a.b.c
-   */
-  public static String getNullableNestedFieldValAsString(GenericRecord record, String fieldName) {
-    try {
-      return getNestedFieldValAsString(record, fieldName);
-    } catch (HoodieException e) {
-      return null;
-    }
-  }
-
   /**
    * Obtain value of the provided field as string, denoted by dot notation. e.g: a.b.c
    */
-  public static String getNestedFieldValAsString(GenericRecord record, String fieldName) {
-    Object obj = getNestedFieldVal(record, fieldName);
-    return obj.toString();
+  public static String getNestedFieldValAsString(GenericRecord record, String fieldName, boolean returnNullValue) {
+    Object obj = getNestedFieldVal(record, fieldName, returnNullValue);
+    return (obj == null) ? null : obj.toString();
   }
 
   /**
    * Obtain value of the provided field, denoted by dot notation. e.g: a.b.c
    */
-  public static Object getNestedFieldVal(GenericRecord record, String fieldName) {
+  public static Object getNestedFieldVal(GenericRecord record, String fieldName, boolean returnNullValue) {
 
 Review comment:
   Can you rename to returnNullIfNotFound ?

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