morningman commented on a change in pull request #4810:
URL: https://github.com/apache/incubator-doris/pull/4810#discussion_r519183401



##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BrokerLoadPendingTask.java
##########
@@ -77,18 +77,32 @@ private void getAllFileStatus() throws UserException {
                 for (String path : fileGroup.getFilePaths()) {
                     BrokerUtil.parseFile(path, brokerDesc, fileStatuses);
                 }
-                fileStatusList.add(fileStatuses);
+                boolean isBinaryFileFormat = fileGroup.isBinaryFileFormat();
+                int fileNum = 0;
+                List<TBrokerFileStatus> filteredFileStatuses = 
Lists.newArrayList();
                 for (TBrokerFileStatus fstatus : fileStatuses) {
-                    groupFileSize += fstatus.getSize();
-                    if (LOG.isDebugEnabled()) {
-                        LOG.debug(new LogBuilder(LogKey.LOAD_JOB, 
callback.getCallbackId())
-                                .add("file_status", fstatus).build());
+                    if (fstatus.getSize() == 0 && isBinaryFileFormat) {
+                        // For parquet or orc file, if it is an empty file, 
ignore it.
+                        // Because we can not read an empty parquet or orc 
file.
+                        if (LOG.isDebugEnabled()) {
+                            LOG.debug(new LogBuilder(LogKey.LOAD_JOB, 
callback.getCallbackId())
+                                    .add("empty file", fstatus).build());
+                        }
+                    } else {
+                        groupFileSize += fstatus.size;
+                        fileNum++;
+                        filteredFileStatuses.add(fstatus);
+                        if (LOG.isDebugEnabled()) {
+                            LOG.debug(new LogBuilder(LogKey.LOAD_JOB, 
callback.getCallbackId())
+                                    .add("file_status", fstatus).build());
+                        }
                     }
                 }
+                fileStatusList.add(filteredFileStatuses);
                 tableTotalFileSize += groupFileSize;
-                tableTotalFileNum += fileStatuses.size();
+                tableTotalFileNum += fileNum;

Review comment:
       Removed




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to