presto-main/src/main/java/io/prestosql/operator/ExplainAnalyzeOperator.java/ExplainAnalyzeOperator/isFinalStageInfo
class ExplainAnalyzeOperator:    private boolean isFinalStageInfo(StageInfo stageInfo)
    {
        List<StageInfo> subStages = getSubStagesOf(operatorContext.getDriverContext().getTaskId().getStageId(), stageInfo);
        return subStages.stream().allMatch(StageInfo::isFinalStageInfo);
    }