class PlanNode {

  public Stream<ColumnName> resolveSelectStar(
      final Optional<SourceName> sourceName
  ) {
    return getSources().stream()
        .filter(s -> !sourceName.isPresent()
            || !s.getSourceName().isPresent()
            || sourceName.equals(s.getSourceName()))
        .flatMap(s -> s.resolveSelectStar(sourceName));
  }

  protected  PlanNode(
      final PlanNodeId id,
      final DataSourceType nodeOutputType,
      final Optional<SourceName> sourceName
  );

}