selectBlock.getGroupbyClause().accept(this, gbyFreeVars);
@Override public Expression visit(SelectBlock selectBlock, ILangExpression arg) throws CompilationException { List<Pair<Expression, VarIdentifier>> extractionList = new ArrayList<>(); stack.push(extractionList); if (selectBlock.hasFromClause()) { FromClause clause = selectBlock.getFromClause(); clause.accept(this, arg); if (!extractionList.isEmpty()) { handleUnsupportedClause(clause, extractionList); } } List<AbstractClause> letWhereList = selectBlock.getLetWhereList(); if (!letWhereList.isEmpty()) { visitLetWhereClauses(letWhereList, extractionList, arg); } if (selectBlock.hasGroupbyClause()) { selectBlock.getGroupbyClause().accept(this, arg); introduceLetClauses(extractionList, letWhereList); } List<AbstractClause> letHavingListAfterGby = selectBlock.getLetHavingListAfterGroupby(); if (!letHavingListAfterGby.isEmpty()) { visitLetWhereClauses(letHavingListAfterGby, extractionList, arg); } selectBlock.getSelectClause().accept(this, arg); introduceLetClauses(extractionList, selectBlock.hasGroupbyClause() ? letHavingListAfterGby : letWhereList); stack.pop(); return null; }
gbyClause = (GroupbyClause) selectBlock.getGroupbyClause().accept(this, arg);
groupbyClause.accept(this, arg); Collection<VariableExpr> visibleVarsInCurrentScope = SqlppVariableUtil.getBindingVariables(groupbyClause);
newGroupby = selectBlock.getGroupbyClause().accept(this, currentEnv); currentEnv = newGroupby.second; if (selectBlock.hasLetHavingClausesAfterGroupby()) {
@Override public Void visit(SelectBlock selectBlock, Void arg) throws CompilationException { if (selectBlock.hasFromClause()) { selectBlock.getFromClause().accept(this, arg); } if (selectBlock.hasLetWhereClauses()) { for (AbstractClause letWhereClause : selectBlock.getLetWhereList()) { letWhereClause.accept(this, arg); } } if (selectBlock.hasGroupbyClause()) { selectBlock.getGroupbyClause().accept(this, arg); } if (selectBlock.hasLetHavingClausesAfterGroupby()) { for (AbstractClause letHavingClause : selectBlock.getLetHavingListAfterGroupby()) { letHavingClause.accept(this, arg); } } selectBlock.getSelectClause().accept(this, arg); return null; }
@Override public Void visit(SelectBlock selectBlock, Integer step) throws CompilationException { selectBlock.getSelectClause().accept(this, step); if (selectBlock.hasFromClause()) { selectBlock.getFromClause().accept(this, step); } if (selectBlock.hasLetWhereClauses()) { for (AbstractClause letWhereClause : selectBlock.getLetWhereList()) { letWhereClause.accept(this, step); } } if (selectBlock.hasGroupbyClause()) { selectBlock.getGroupbyClause().accept(this, step); if (selectBlock.hasLetHavingClausesAfterGroupby()) { for (AbstractClause letHavingClause : selectBlock.getLetHavingListAfterGroupby()) { letHavingClause.accept(this, step); } } } return null; }
@Override public Expression visit(SelectBlock selectBlock, ILangExpression arg) throws CompilationException { // Traverses the select block in the order of "from", "let/where"s, "group by", "let/having"s and "select". if (selectBlock.hasFromClause()) { selectBlock.getFromClause().accept(this, arg); } if (selectBlock.hasLetWhereClauses()) { for (AbstractClause clause : selectBlock.getLetWhereList()) { clause.accept(this, arg); } } if (selectBlock.hasGroupbyClause()) { selectBlock.getGroupbyClause().accept(this, arg); } if (selectBlock.hasLetHavingClausesAfterGroupby()) { for (AbstractClause clause : selectBlock.getLetHavingListAfterGroupby()) { clause.accept(this, arg); } } selectBlock.getSelectClause().accept(this, arg); return null; }
@Override public Boolean visit(SelectBlock selectBlock, List<FunctionDecl> funcs) throws CompilationException { boolean changed = false; if (selectBlock.hasFromClause()) { changed |= selectBlock.getFromClause().accept(this, funcs); } if (selectBlock.hasLetWhereClauses()) { for (AbstractClause letWhereClause : selectBlock.getLetWhereList()) { changed |= letWhereClause.accept(this, funcs); } } if (selectBlock.hasGroupbyClause()) { changed |= selectBlock.getGroupbyClause().accept(this, funcs); } if (selectBlock.hasLetHavingClausesAfterGroupby()) { for (AbstractClause letHavingClause : selectBlock.getLetHavingListAfterGroupby()) { changed |= letHavingClause.accept(this, funcs); } } changed |= selectBlock.getSelectClause().accept(this, funcs); return changed; }
@Override public Void visit(SelectBlock selectBlock, Integer step) throws CompilationException { selectBlock.getSelectClause().accept(this, step); if (selectBlock.hasFromClause()) { selectBlock.getFromClause().accept(this, step); } if (selectBlock.hasLetWhereClauses()) { for (AbstractClause letWhereClause : selectBlock.getLetWhereList()) { letWhereClause.accept(this, step); } } if (selectBlock.hasGroupbyClause()) { selectBlock.getGroupbyClause().accept(this, step); if (selectBlock.hasLetHavingClausesAfterGroupby()) { for (AbstractClause letHavingClause : selectBlock.getLetHavingListAfterGroupby()) { letHavingClause.accept(this, step); } } } return null; }
@Override public Pair<ILogicalOperator, LogicalVariable> visit(SelectBlock selectBlock, Mutable<ILogicalOperator> tupSource) throws CompilationException { Mutable<ILogicalOperator> currentOpRef = tupSource; if (selectBlock.hasFromClause()) { currentOpRef = new MutableObject<>(selectBlock.getFromClause().accept(this, currentOpRef).first); } if (selectBlock.hasLetWhereClauses()) { for (AbstractClause letWhereClause : selectBlock.getLetWhereList()) { currentOpRef = new MutableObject<>(letWhereClause.accept(this, currentOpRef).first); } } if (selectBlock.hasGroupbyClause()) { currentOpRef = new MutableObject<>(selectBlock.getGroupbyClause().accept(this, currentOpRef).first); } if (selectBlock.hasLetHavingClausesAfterGroupby()) { for (AbstractClause letHavingClause : selectBlock.getLetHavingListAfterGroupby()) { currentOpRef = new MutableObject<>(letHavingClause.accept(this, currentOpRef).first); } } return processSelectClause(selectBlock, currentOpRef); }