Source:
<code>private SubPlan analyzeGroupedExecution(Session session, SubPlan subPlan, boolean parentContainsTableFinish) { PlanFragment fragment = subPlan.getFragment(); GroupedExecutionProperties properties = fragment.getRoot().accept(new GroupedExecutionTagger(session, metadata, nodePartitioningManager), null); if (properties.isSubTreeUseful()) { boolean preferDynamic = fragment.getRemoteSourceNodes().stream().allMatch(node -> node.getExchangeType() == REPLICATE) && isDynamicScheduleForGroupedExecution(session); BucketNodeMap bucketNodeMap = nodePartitioningManager.getBucketNodeMap(session, fragment.getPartitioning(), preferDynamic); if (bucketNodeMap.isDynamic()) { boolean recoverable = isRecoverableGroupedExecutionEnabled(session) && parentContainsTableFinish && fragment.getRoot() instanceof TableWriterNode && <START> properties.isPreferRecoverable(); <END> if (recoverable) { fragment = fragment.withRecoverableGroupedExecution(properties.getCapableTableScanNodes()); } else { fragment = fragment.withDynamicLifespanScheduleGroupedExecution(properties.getCapableTableScanNodes()); } } else { fragment = fragment.withFixedLifespanScheduleGroupedExecution(properties.getCapableTableScanNodes()); } } ImmutableList.Builder<SubPlan> result = ImmutableList.builder(); boolean containsTableFinishNode = containsTableFinishNode(fragment); for (SubPlan child : subPlan.getChildren()) { result.add(analyzeGroupedExecution(session, child, containsTableFinishNode)); } return new SubPlan(fragment, result.build()); }</code><technical_language>nit: isRecoveryEligible Is this checks input? -- isRecoveryEligibleForTableScans</technical_language>

Target:
private SubPlan analyzeGroupedExecution(Session session, SubPlan subPlan, boolean parentContainsTableFinish) { PlanFragment fragment = subPlan.getFragment(); GroupedExecutionProperties properties = fragment.getRoot().accept(new GroupedExecutionTagger(session, metadata, nodePartitioningManager), null); if (properties.isSubTreeUseful()) { boolean preferDynamic = fragment.getRemoteSourceNodes().stream().allMatch(node -> node.getExchangeType() == REPLICATE) && isDynamicScheduleForGroupedExecution(session); BucketNodeMap bucketNodeMap = nodePartitioningManager.getBucketNodeMap(session, fragment.getPartitioning(), preferDynamic); if (bucketNodeMap.isDynamic()) { boolean recoverable = isRecoverableGroupedExecutionEnabled(session) && parentContainsTableFinish && fragment.getRoot() instanceof TableWriterNode && properties.isRecoveryEligible(); if (recoverable) { fragment = fragment.withRecoverableGroupedExecution(properties.getCapableTableScanNodes(), properties.getTotalLifespans()); } else { fragment = fragment.withDynamicLifespanScheduleGroupedExecution(properties.getCapableTableScanNodes(), properties.getTotalLifespans()); } } else { fragment = fragment.withFixedLifespanScheduleGroupedExecution(properties.getCapableTableScanNodes(), properties.getTotalLifespans()); } } ImmutableList.Builder<SubPlan> result = ImmutableList.builder(); boolean containsTableFinishNode = containsTableFinishNode(fragment); for (SubPlan child : subPlan.getChildren()) { result.add(analyzeGroupedExecution(session, child, containsTableFinishNode)); } return new SubPlan(fragment, result.build()); }