private Scope createAndAssignScope(Node node, Optional<Scope> parentScope, RelationType relationType) { Scope scope = scopeBuilder(parentScope) .withRelationType(RelationId.of(node), relationType) .build(); analysis.setScope(node, scope); return scope; }
private Scope createAndAssignScope(Node node, Optional<Scope> parentScope, RelationType relationType) { Scope scope = scopeBuilder(parentScope) .withRelationType(RelationId.of(node), relationType) .build(); analysis.setScope(node, scope); return scope; }
.withRelationType(outputScope.getRelationId(), outputScope.getRelationType()) .build(); analysis.setScope(node, orderByScope); analysis.setOrderByAggregates(node, orderByAggregationExpressions); return orderByScope;
.withRelationType(outputScope.getRelationId(), outputScope.getRelationType()) .build(); analysis.setScope(node, orderByScope); analysis.setOrderByAggregates(node, orderByAggregationExpressions); return orderByScope;
private Scope computeAndAssignOrderByScope(OrderBy node, Scope sourceScope, Scope outputScope) { // ORDER BY should "see" both output and FROM fields during initial analysis and non-aggregation query planning Scope orderByScope = Scope.builder() .withParent(sourceScope) .withRelationType(outputScope.getRelationId(), outputScope.getRelationType()) .build(); analysis.setScope(node, orderByScope); return orderByScope; }
private Scope computeAndAssignOrderByScope(OrderBy node, Scope sourceScope, Scope outputScope) { // ORDER BY should "see" both output and FROM fields during initial analysis and non-aggregation query planning Scope orderByScope = Scope.builder() .withParent(sourceScope) .withRelationType(outputScope.getRelationId(), outputScope.getRelationType()) .build(); analysis.setScope(node, orderByScope); return orderByScope; }
@Override protected Scope visitQuery(Query node, Optional<Scope> scope) { Scope withScope = analyzeWith(node, scope); Scope queryBodyScope = process(node.getQueryBody(), withScope); if (node.getOrderBy().isPresent()) { analyzeOrderBy(node, queryBodyScope); } else { analysis.setOrderByExpressions(node, emptyList()); } // Input fields == Output fields analysis.setOutputExpressions(node, descriptorToFields(queryBodyScope)); Scope queryScope = Scope.builder() .withParent(withScope) .withRelationType(RelationId.of(node), queryBodyScope.getRelationType()) .build(); analysis.setScope(node, queryScope); return queryScope; }
analysis.setScope(with, withScope); return withScope;
analysis.setScope(with, withScope); return withScope;
@Override protected Scope visitQuery(Query node, Optional<Scope> scope) { Scope withScope = analyzeWith(node, scope); Scope queryBodyScope = process(node.getQueryBody(), withScope); if (node.getOrderBy().isPresent()) { analyzeOrderBy(node, queryBodyScope); } else { analysis.setOrderByExpressions(node, emptyList()); } // Input fields == Output fields analysis.setOutputExpressions(node, descriptorToFields(queryBodyScope)); Scope queryScope = Scope.builder() .withParent(withScope) .withRelationType(RelationId.of(node), queryBodyScope.getRelationType()) .build(); analysis.setScope(node, queryScope); return queryScope; }