Zoltán Borók-Nagy created IMPALA-15856:
------------------------------------------

             Summary: COMPUTE_PROCESSING_COST caps scan and union fragments by 
the node count of their first child fragment
                 Key: IMPALA-15856
                 URL: https://issues.apache.org/jira/browse/IMPALA-15856
             Project: IMPALA
          Issue Type: Bug
          Components: Frontend
            Reporter: Zoltán Borók-Nagy


PlanFragment.traverseEffectiveParallelism() caps a fragment that has a child 
fragment at maxThreadPerNode times getChild(0).getNumNodes(), unless its 
verdict is FIXED_BY_PLAN_NODE, FIXED_BY_PARTITIONED_JOIN_BUILD or 
CTE_FRAGMENT_BOUNDED. IMPALA-14006 added this cap because 
Scheduler::CreateInputCollocatedInstances() places an interior fragment on the 
hosts of its first input fragment. The cap also applies to fragments with a 
scan or union node, but Scheduler::ComputeFragmentExecParams() schedules those 
with CreateCollocatedAndScanInstances(), which places them on the hosts of 
their scans and, for a union, of its input fragments. A union fragment whose 
first child fragment is unpartitioned is therefore capped at maxThreadPerNode 
instances in total, however many scan ranges its scans have.

Example on master, with 16 cores per executor: in the query below the union 
fragment holds the store_sales scan and reads the aggregate over date_dim from 
an unpartitioned fragment through an exchange. That child has one node, so the 
union fragment is capped at 16 instances for the whole cluster. With "select 
d_date_sk k from date_dim" as the second operand, the union fragment scans both 
tables, has no child fragment and is not capped.
{code:sql}
select count(*) from (
  select ss_item_sk k from store_sales
  union all
  select count(*) k from date_dim) v;
{code}

Fix: skip the cap for fragments with a scan or union node, because the 
scheduler does not place them on the hosts of their first input fragment.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to