github-actions[bot] commented on code in PR #62804:
URL: https://github.com/apache/doris/pull/62804#discussion_r3144825959


##########
fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/streaming/StreamingInsertJob.java:
##########
@@ -1045,21 +1045,24 @@ public void beforeCommitted(TransactionState txnState) 
throws TransactionExcepti
             LoadJob loadJob = loadJobs.get(0);
             LoadStatistic loadStatistic = loadJob.getLoadStatistic();
 
+            Offset runningOffset = runningStreamTask.getRunningOffset();
             String offsetJson = offsetProvider.getCommitOffsetJson(
-                    runningStreamTask.getRunningOffset(),
+                    runningOffset,
                     runningStreamTask.getTaskId(),
                     runningStreamTask.getScanBackendIds());
 
             if (StringUtils.isBlank(offsetJson)) {
                 throw new TransactionException("Cannot find offset for 
attachment, load job id is "
                         + runningStreamTask.getTaskId());
             }
+            int physicalFileNum = runningOffset.getPhysicalFileNum();
+            long numFiles = physicalFileNum >= 0 ? physicalFileNum : 
loadStatistic.getFileNumber();

Review Comment:
   This only fixes the job-level aggregate. `tasks("type"="insert")` still 
serializes `loadJob.getLoadStatistic().toJson()` in 
`StreamingInsertTask.getTvfInfo()`, and that `LoadStatistic.fileNum` is still 
populated from `FileScanNode.getSelectedSplitNum()` in 
`InsertIntoTableCommand.applyInsertPlanStatistic()`. For the same S3 batch, 
`jobs()` will now report the physical file count while `tasks()` still reports 
the split count, so `LoadStatistic.FileNumber` has inconsistent semantics 
across two public interfaces.



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