Hisoka-X commented on code in PR #9526:
URL: https://github.com/apache/seatunnel/pull/9526#discussion_r2299854410
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/AbstractReadStrategy.java:
##########
@@ -144,6 +151,46 @@ public List<String> getFileNamesByPath(String path) throws
IOException {
return fileNames;
}
+ protected boolean filterFileByModificationDate(FileStatus fileStatus) {
+
+ long fileModifiedTime = fileStatus.getModificationTime();
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd
HH:mm:ss");
+ Date startTime = null;
+ Date endTime = null;
+ try {
+ if (fileModifiedStartDate != null) {
+ startTime = dateFormat.parse(fileModifiedStartDate);
+ }
+
+ if (fileModifiedEndDate != null) {
+ endTime = dateFormat.parse(fileModifiedEndDate);
+ }
+
+ } catch (ParseException e) {
+ log.warn(
+ "Failed to parse file modified date format: yyyy-MM-dd
HH:mm:ss, please check file_filter_modified_start or file_filter_modified_end
format.");
+ return false;
+ }
Review Comment:
Can we only parse time only once? Each file will parse once now.
--
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]