nsivabalan commented on code in PR #10095:
URL: https://github.com/apache/hudi/pull/10095#discussion_r1402767000


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/S3EventsHoodieIncrSource.java:
##########
@@ -70,6 +72,7 @@
 public class S3EventsHoodieIncrSource extends HoodieIncrSource {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(S3EventsHoodieIncrSource.class);
+  private static final String EMPTY_STRING = "";

Review Comment:
   StringUtils already contains EMPTY_STRING



##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/S3EventsHoodieIncrSource.java:
##########
@@ -133,7 +136,13 @@ public S3EventsHoodieIncrSource(
     this.srcPath = getStringWithAltKeys(props, HOODIE_SRC_BASE_PATH);
     this.numInstantsPerFetch = getIntWithAltKeys(props, 
NUM_INSTANTS_PER_FETCH);
     this.checkIfFileExists = getBooleanWithAltKeys(props, ENABLE_EXISTS_CHECK);
-    this.fileFormat = getStringWithAltKeys(props, DATAFILE_FORMAT, true);
+
+    // This is to ensure backward compatibility where we were using the
+    // config SOURCE_FILE_FORMAT for file format in previous versions.
+    this.fileFormat = Strings.isNullOrEmpty(getStringWithAltKeys(props, 
DATAFILE_FORMAT, EMPTY_STRING))
+        ? getStringWithAltKeys(props, SOURCE_FILE_FORMAT, true)
+        : getStringWithAltKeys(props, DATAFILE_FORMAT, EMPTY_STRING);

Review Comment:
   for last one
   ```
   getStringWithAltKeys(props, DATAFILE_FORMAT, EMPTY_STRING);
   ```
   you can ignore the last arg. 
   ```
   getStringWithAltKeys(props, DATAFILE_FORMAT);
   ```
   
   default value will not be picked. 
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to