Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
5.0-beta
-
None
Description
Background
When KE calls the query interface, it is found that the scan row count scanRows and scan byte count scanBytes in the response are not accurate.
Root Cause
The query interface internally calls the collectAdaptiveSparkPlanExecMetrics method of QueryMetricUtils. When iterating through exec.children.foreach, if the child is a SparkPlan, each time the results of the new child overwrite the newScanRow and newScanBytes variables without adding them up.
Dev Design
To address the issue, replace the assignment operator = with the compound addition assignment operator += to ensure that the results are properly accumulated. This change will allow for the correct aggregation of scan row count and scan byte count in each iteration.