Copilot commented on code in PR #62482:
URL: https://github.com/apache/doris/pull/62482#discussion_r3077578267


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/FileSplitter.java:
##########
@@ -101,6 +101,10 @@ public List<Split> splitFile(
                 List<String> partitionValues,
                 SplitCreator splitCreator)
                 throws IOException {
+        if (length <= 0) {
+            // Zero-length files contain no data; skip to avoid sending empty 
splits to BE.
+            return Lists.newArrayList();

Review Comment:
   The early return for zero-length files currently allocates a new mutable 
list on every call. Since this is a hot path when scanning many files, consider 
returning `Collections.emptyList()` (or `ImmutableList.of()`) to avoid 
unnecessary allocations and signal immutability.
   ```suggestion
               return ImmutableList.of();
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to