/*
* Favor Broad Plans over Deep Plans.
*/
public RelOptCost getCumulativeCost(HiveJoinRel rel) {
RelOptCost cost = RelMetadataQuery.getNonCumulativeCost(rel);
List<RelNode> inputs = rel.getInputs();
RelOptCost maxICost = HiveCost.ZERO;
for (RelNode input : inputs) {
RelOptCost iCost = RelMetadataQuery.getCumulativeCost(input);
if (maxICost.isLt(iCost)) {
maxICost = iCost;
}
}
return cost.plus(maxICost);