Quanlong Huang has uploaded a new patch set (#3). ( http://gerrit.cloudera.org:8080/25211 )
Change subject: IMPALA-14941: Fix #Rows in Subplan nodes ...................................................................... IMPALA-14941: Fix #Rows in Subplan nodes ExecSummary shows the output #Rows of each operator. However, the numbers for nodes under a SubplanNode (including itself) are usually incorrect: 1) The number of SubplanNode could be smaller than actual when the last row batch doesn't hit the limit or its capacity. 2) The number of nodes in the right subtree of a SubplanNode are usually 0. The first issue is fixed by updating num_rows_returned everytime SubplanNode::GetNext() returns, instead of updating it when hitting limit or row batch capacity. The second issue is due to SubplanNode::GetNext() resets its right child (and hence the right subtree) before getting the next new row from its left child. ExecNode::Reset() resets num_rows_returned to 0. When the left child of SubplanNode reaches eos, the right child won't be opened again so its num_rows_returned remains 0. The second issue is fixed by moving the reset of num_rows_returned from ExecNode::Reset() to ExecNode::Open(). So if SubplanNode's right child won't be opened again, it keeps its old (valid) num_rows_returned_ counter. SingularRowSrcPlanNode doesn't update num_rows_returned so it's always 0. This patch sets it to 1 if SingularRowSrcPlanNode::GetNext() ever executes. Note that the cardinality of ExecNodes under the right side of a subplan is not the cumulative number of output rows from them. The planner uses a per-iteration (for each collection) number instead. E.g. see how computeStats() sets cardinality_ in UnnestNode.java. Testing - Added e2e tests - Ran CORE tests Change-Id: I95b7bcae782e15ff5563b3c385a9d5ee07d45e6c --- M be/src/exec/exec-node.cc M be/src/exec/singular-row-src-node.cc M be/src/exec/subplan-node.cc M tests/query_test/test_observability.py 4 files changed, 46 insertions(+), 5 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/11/25211/3 -- To view, visit http://gerrit.cloudera.org:8080/25211 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I95b7bcae782e15ff5563b3c385a9d5ee07d45e6c Gerrit-Change-Number: 25211 Gerrit-PatchSet: 3 Gerrit-Owner: Quanlong Huang <[email protected]>
