zhangshenghang commented on code in PR #10049:
URL: https://github.com/apache/seatunnel/pull/10049#discussion_r2512569010
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/AbstractReadStrategy.java:
##########
@@ -405,9 +407,14 @@ protected SeaTunnelRowType mergePartitionTypes(String
path, SeaTunnelRowType sea
return new SeaTunnelRowType(newFieldNames, newFieldTypes);
}
- protected boolean filterFileByPattern(FileStatus fileStatus) {
+ protected boolean filterFileByPattern(String path, FileStatus fileStatus) {
if (Objects.nonNull(pattern)) {
- return pattern.matcher(fileStatus.getPath().getName()).matches();
+ if (pattern.pattern().startsWith(path)) {
+ // filter based on the file directory at the same time
+ return
pattern.matcher(fileStatus.getPath().getName()).matches();
+ }
+ // filter based on file names
+ return
pattern.matcher(fileStatus.getPath().toUri().getPath()).matches();
Review Comment:
Is the logic reversed?
pattern.pattern().startsWith(path) = true ,Is it matching the table of
contents?
--
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]