prathit06 commented on code in PR #10313:
URL: https://github.com/apache/hudi/pull/10313#discussion_r1423664817


##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HoodieRealtimeInputFormatUtils.java:
##########
@@ -86,7 +86,7 @@ private static Configuration addProjectionField(Configuration 
conf, String field
 
   public static void addProjectionField(Configuration conf, String[] 
fieldName) {
     if (fieldName.length > 0) {
-      List<String> columnNameList = 
Arrays.stream(conf.get(serdeConstants.LIST_COLUMNS).split(",")).collect(Collectors.toList());
+      List<String> columnNameList = 
Arrays.stream(conf.get(serdeConstants.LIST_COLUMNS, 
"").split(",")).collect(Collectors.toList());
       Arrays.stream(fieldName).forEach(field -> {

Review Comment:
   `LIST_COLUMNS` 
   - will be used when columns list is passed in Job Configuration 
   - wont be used in cases where Configuration is created with empty params 
such as `val jobConf = new JobConf()`  ( this is what we are doing currently in 
our Flink job to read a hoodie table) , due to this when 
`conf.get(serdeConstants.LIST_COLUMNS)` is invoked, it returns NPE so this 
particular fix will handle such cases



##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HoodieRealtimeInputFormatUtils.java:
##########
@@ -86,7 +86,7 @@ private static Configuration addProjectionField(Configuration 
conf, String field
 
   public static void addProjectionField(Configuration conf, String[] 
fieldName) {
     if (fieldName.length > 0) {
-      List<String> columnNameList = 
Arrays.stream(conf.get(serdeConstants.LIST_COLUMNS).split(",")).collect(Collectors.toList());
+      List<String> columnNameList = 
Arrays.stream(conf.get(serdeConstants.LIST_COLUMNS, 
"").split(",")).collect(Collectors.toList());
       Arrays.stream(fieldName).forEach(field -> {

Review Comment:
   `LIST_COLUMNS` 
   - It will be used when columns list is passed in Job Configuration 
   - It wont be used in cases where Configuration is created with empty params 
such as `val jobConf = new JobConf()`  ( this is what we are doing currently in 
our Flink job to read a hoodie table) , due to this when 
`conf.get(serdeConstants.LIST_COLUMNS)` is invoked, it returns NPE so this 
particular fix will handle such cases



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

To unsubscribe, e-mail: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to