danny0405 commented on code in PR #9304:
URL: https://github.com/apache/hudi/pull/9304#discussion_r1277063638
##########
hudi-common/src/main/java/org/apache/hudi/common/fs/FSUtils.java:
##########
@@ -191,10 +191,15 @@ public static String getCommitFromCommitFile(String
commitFileName) {
}
public static String getCommitTime(String fullFileName) {
- if (isLogFile(fullFileName)) {
- return fullFileName.split("_")[1].split("\\.")[0];
+ try {
+ if (isLogFile(fullFileName)) {
+ return fullFileName.split("_")[1].split("\\.")[0];
+ }
+ return fullFileName.split("_")[2].split("\\.")[0];
+ } catch (ArrayIndexOutOfBoundsException e) {
+ LOG.error("Found files with illegal filename! Full filename: " +
fullFileName);
+ throw new HoodieException("Failed to get commit time from filename,
filename is illegal: " + fullFileName, e);
Review Comment:
No need for verbose log, an exception should be enough:
```java
throw new HoodieException("Failed to get commit time from filename: " +
fullFileName, e);
```
--
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]