use of com.yahoo.elide.datastores.aggregation.query.DimensionProjection in project elide by yahoo.
the class EntityProjectionTranslator method resolveNonTimeDimensions.
/**
* Gets dimensions except time dimensions based on relationships and attributes from {@link EntityProjection}.
*/
private Set<DimensionProjection> resolveNonTimeDimensions() {
Set<DimensionProjection> attributes = entityProjection.getAttributes().stream().filter(attribute -> queriedTable.getTimeDimension(attribute.getName()) == null).map(dimAttr -> {
Dimension dimension = queriedTable.getDimension(dimAttr.getName());
return dimension == null ? null : engine.constructDimensionProjection(dimension, dimAttr.getAlias(), getArgumentMapFromArgumentSet(dimAttr.getArguments()));
}).filter(Objects::nonNull).collect(Collectors.toSet());
Set<DimensionProjection> relationships = entityProjection.getRelationships().stream().map(dimAttr -> {
Dimension dimension = queriedTable.getDimension(dimAttr.getName());
return dimension == null ? null : engine.constructDimensionProjection(dimension, dimAttr.getAlias(), Collections.emptyMap());
}).filter(Objects::nonNull).collect(Collectors.toSet());
return Sets.union(attributes, relationships);
}
Aggregations