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

             Summary: ProcessingCost.invalid() reports itself as valid
                 Key: IMPALA-15853
                 URL: https://issues.apache.org/jira/browse/IMPALA-15853
             Project: IMPALA
          Issue Type: Bug
          Components: Frontend
            Reporter: Zoltán Borók-Nagy


ProcessingCost.invalid() returns new BaseProcessingCost(-1, 1, 0). The 
BaseProcessingCost constructor clamps the cardinality to 0, so the total cost 
is 0, and BaseProcessingCost.isValid(), which only checks that the total cost 
is at least 0, returns true. PlanNode and DataSink start with 
ProcessingCost.invalid() as their cost. So the isValid() preconditions meant to 
catch a node or sink whose computeProcessingCost() was never called, in 
PlanNode, DataSink, CostingSegment and the composite cost classes, can never 
fail, and the cost=<invalid> branches of PlanNode.getExplainString() and 
DataSink.getExplainString() never run.

Example on master: since IMPALA-13437, Planner.createPlans() runs 
computeProcessingCost() before TupleCachePlanner.createPlans(), and 
TupleCachePlanner.buildCachingPlan() only calls init() on the TupleCacheNodes 
it adds. Their cost stays ProcessingCost.invalid(), yet the expected output of 
TpcdsTupleCachePlannerTest prints them as costed, for example in 
tpcds_tuple_cache/tpcds-q03.test:
{code}
10:TUPLE CACHE
...
|  tuple-ids=3 row-size=52B cardinality=9.00M cost=0
{code}

Fix: make invalid() return a cost whose isValid() is false while getTotalCost() 
stays 0, and cost each TupleCacheNode when TupleCachePlanner adds it.



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

Reply via email to