wombatu-kun commented on code in PR #18375:
URL: https://github.com/apache/hudi/pull/18375#discussion_r3179821897
##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieFileFormat.java:
##########
@@ -83,6 +99,20 @@ public static HoodieFileFormat fromFileExtension(String
extension) {
throw new IllegalArgumentException("Unknown file extension :" + extension);
}
+ /**
+ * Returns the {@link HoodieFileFormat} matching the given file extension,
or {@code null}
+ * if no match is found. Useful when the caller wants to handle unknown
extensions without
+ * exception-based control flow.
+ */
+ public static HoodieFileFormat fromFileExtensionOrNull(String extension) {
Review Comment:
Done in commit 2def3286cfa1 — `fromFileExtension` now delegates to
`fromFileExtensionOrNull` and throws on null. Kept the exception message
verbatim.
--
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]