You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by ki...@apache.org on 2022/07/22 01:50:56 UTC

[incubator-seatunnel] branch dev updated: [Bug][connector-hive] filter '_SUCCESS' file in file list (#2235) (#2236)

This is an automated email from the ASF dual-hosted git repository.

kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new db0465152 [Bug][connector-hive] filter '_SUCCESS' file in file list (#2235) (#2236)
db0465152 is described below

commit db04651523dd14468509167d354faab75b63cf2c
Author: TyrantLucifer <Ty...@gmail.com>
AuthorDate: Fri Jul 22 09:50:50 2022 +0800

    [Bug][connector-hive] filter '_SUCCESS' file in file list (#2235) (#2236)
---
 .../hive/source/file/reader/format/AbstractReadStrategy.java        | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/source/file/reader/format/AbstractReadStrategy.java b/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/source/file/reader/format/AbstractReadStrategy.java
index 50163235c..2df0a21f7 100644
--- a/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/source/file/reader/format/AbstractReadStrategy.java
+++ b/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/source/file/reader/format/AbstractReadStrategy.java
@@ -72,8 +72,10 @@ public abstract class AbstractReadStrategy implements ReadStrategy {
                 continue;
             }
             if (fileStatus.isFile()) {
-
-                fileNames.add(fileStatus.getPath().toString());
+                // filter '_SUCCESS' file
+                if (!fileStatus.getPath().getName().equals("_SUCCESS")) {
+                    fileNames.add(fileStatus.getPath().toString());
+                }
             }
         }
         return fileNames;