TaoZex commented on code in PR #3842:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3842#discussion_r1059773490


##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/AbstractReadStrategy.java:
##########
@@ -115,8 +116,18 @@ public List<String> getFileNamesByPath(HadoopConf 
hadoopConf, String path) throw
             if (fileStatus.isFile()) {
                 // filter '_SUCCESS' file
                 if (!fileStatus.getPath().getName().equals("_SUCCESS")) {
-                    fileNames.add(fileStatus.getPath().toString());
-                    this.fileNames.add(fileStatus.getPath().toString());
+                    if (!readPartitions.isEmpty()) {
+                        for (String readPartition : readPartitions) {
+                            if 
(fileStatus.getPath().toString().contains(readPartition)) {
+                                fileNames.add(fileStatus.getPath().toString());
+                                
this.fileNames.add(fileStatus.getPath().toString());
+                                break;
+                            }
+                        }
+                    } else {
+                        fileNames.add(fileStatus.getPath().toString());
+                        this.fileNames.add(fileStatus.getPath().toString());
+                    }

Review Comment:
   ```suggestion
                       String fileStatusString = 
fileStatus.getPath().toString();
                       if (!readPartitions.isEmpty()) {
                           for (String readPartition : readPartitions) {
                               if (fileStatusString.contains(readPartition)) {
                                   fileNames.add(fileStatusString);
                                   this.fileNames.add(fileStatusString);
                                   break;
                               }
                           }
                       } else {
                           fileNames.add(fileStatusString);
                           this.fileNames.add(fileStatusString);
                       }
   ```



-- 
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