private void sanityCheckFragmentedPlan(SubPlan subPlan, int maxStageCount) { subPlan.sanityCheck(); int fragmentCount = subPlan.getAllFragments().size(); if (fragmentCount > maxStageCount) { throw new PrestoException(QUERY_HAS_TOO_MANY_STAGES, format( "Number of stages in the query (%s) exceeds the allowed maximum (%s). " + "If the query contains multiple DISTINCTs, please set the use_mark_distinct session property to false. " + "If the query contains multiple CTEs that are referenced more than once, please create temporary table(s) for one or more of the CTEs.", fragmentCount, maxStageCount)); } }
private void sanityCheckFragmentedPlan(SubPlan subPlan, int maxStageCount) { subPlan.sanityCheck(); int fragmentCount = subPlan.getAllFragments().size(); if (fragmentCount > maxStageCount) { throw new PrestoException(QUERY_HAS_TOO_MANY_STAGES, format( "Number of stages in the query (%s) exceeds the allowed maximum (%s). " + "If the query contains multiple DISTINCTs, please set the use_mark_distinct session property to false. " + "If the query contains multiple CTEs that are referenced more than once, please create temporary table(s) for one or more of the CTEs.", fragmentCount, maxStageCount)); } }
public void sanityCheck() { Multiset<PlanFragmentId> exchangeIds = fragment.getRemoteSourceNodes().stream() .map(RemoteSourceNode::getSourceFragmentIds) .flatMap(List::stream) .collect(toImmutableMultiset()); Multiset<PlanFragmentId> childrenIds = children.stream() .map(SubPlan::getFragment) .map(PlanFragment::getId) .collect(toImmutableMultiset()); Preconditions.checkState(exchangeIds.equals(childrenIds), "Subplan exchange ids don't match child fragment ids (%s vs %s)", exchangeIds, childrenIds); for (SubPlan child : children) { child.sanityCheck(); } } }
public void sanityCheck() { Multiset<PlanFragmentId> exchangeIds = fragment.getRemoteSourceNodes().stream() .map(RemoteSourceNode::getSourceFragmentIds) .flatMap(List::stream) .collect(toImmutableMultiset()); Multiset<PlanFragmentId> childrenIds = children.stream() .map(SubPlan::getFragment) .map(PlanFragment::getId) .collect(toImmutableMultiset()); Preconditions.checkState(exchangeIds.equals(childrenIds), "Subplan exchange ids don't match child fragment ids (%s vs %s)", exchangeIds, childrenIds); for (SubPlan child : children) { child.sanityCheck(); } } }