private Set<Path<?>> getRootPaths(Collection<? extends Expression<?>> exprs) {
        Set<Path<?>> paths = new HashSet<>();
        for (Expression<?> e : exprs) {
            Path<?> path = e.accept(PathExtractor.DEFAULT, null);
            if (path != null && !path.getMetadata().isRoot()) {
                paths.add(path.getMetadata().getRootPath());
            }
        }
        return paths;
    }
Creates an union expression for the given subqueries

@param <RT>
@param alias alias for union
@param sq subqueries
@return the current object
querydsl-sql/src/main/java/com/querydsl/sql/ProjectableSQLQuery.java