private final NamedExpression[] selections;
@JsonCreator
public Project(@JsonProperty("projections") NamedExpression[] selections) {
this.selections = selections;
if(selections == null || selections.length == 0) throw new ExpressionParsingException("Project did not provide any projection selections. At least one projection must be provided.");
for (int i = 0; i < selections.length; i++) {
PathSegment segment = selections[i].getRef().getRootSegment();
CharSequence path = segment.getNameSegment().getPath();
if (!segment.isNamed() || !path.equals("output"))
throw new ExpressionParsingException(String.format(
"Outputs for projections always have to start with named path of output. First segment was named '%s' or was named [%s]", path, segment.isNamed()));
}
}