Return-Path: X-Original-To: apmail-asterixdb-notifications-archive@minotaur.apache.org Delivered-To: apmail-asterixdb-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B02E19C37 for ; Wed, 6 Apr 2016 01:07:36 +0000 (UTC) Received: (qmail 68931 invoked by uid 500); 6 Apr 2016 01:07:36 -0000 Delivered-To: apmail-asterixdb-notifications-archive@asterixdb.apache.org Received: (qmail 68883 invoked by uid 500); 6 Apr 2016 01:07:36 -0000 Mailing-List: contact notifications-help@asterixdb.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.incubator.apache.org Delivered-To: mailing list notifications@asterixdb.incubator.apache.org Received: (qmail 68873 invoked by uid 99); 6 Apr 2016 01:07:36 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Apr 2016 01:07:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 9E2E2C882A for ; Wed, 6 Apr 2016 01:07:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.919 X-Spam-Level: X-Spam-Status: No, score=0.919 tagged_above=-999 required=6.31 tests=[SPF_FAIL=0.919] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id VKhtdVfY2l7p for ; Wed, 6 Apr 2016 01:07:33 +0000 (UTC) Received: from unhygienix.ics.uci.edu (unhygienix.ics.uci.edu [128.195.14.130]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id ACF285F645 for ; Wed, 6 Apr 2016 01:07:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by unhygienix.ics.uci.edu (Postfix) with ESMTP id E5DA5241DE1; Tue, 5 Apr 2016 18:02:18 -0700 (PDT) Date: Tue, 5 Apr 2016 18:02:18 -0700 From: "Yingyi Bu (Code Review)" Message-ID: Reply-To: buyingyi@gmail.com X-Gerrit-MessageType: newchange Subject: Change in asterixdb[master]: ASTERIXDB-1381: InlineColumnAliasVisitor improvements. X-Gerrit-Change-Id: I82c5bc4568c11c474bec053e9f5162927c1c15d0 X-Gerrit-ChangeURL: X-Gerrit-Commit: 499d0646419641efeba64d493763043db368a144 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.8.4 To: undisclosed-recipients:; Yingyi Bu has uploaded a new change for review. https://asterix-gerrit.ics.uci.edu/789 Change subject: ASTERIXDB-1381: InlineColumnAliasVisitor improvements. ...................................................................... ASTERIXDB-1381: InlineColumnAliasVisitor improvements. -moved mapForRecordConstructor closer to usage location; -documented the boolean argument to the visit method; -documented what happens in mapForRecordConstructor if leftExpr is not a literal. Change-Id: I82c5bc4568c11c474bec053e9f5162927c1c15d0 --- A asterix-app/src/test/resources/runtimets/queries_sqlpp/group-by/sugar-02/sugar-02.4.query.sqlpp A asterix-app/src/test/resources/runtimets/results/group-by/core-02/core-02.2.adm M asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/InlineColumnAliasVisitor.java 3 files changed, 157 insertions(+), 107 deletions(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/89/789/1 diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/group-by/sugar-02/sugar-02.4.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/group-by/sugar-02/sugar-02.4.query.sqlpp new file mode 100644 index 0000000..c86cd18 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries_sqlpp/group-by/sugar-02/sugar-02.4.query.sqlpp @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* This query tests the column alias rewriting. */ + +USE gby; + +FROM Employee e + JOIN Incentive i ON e.job_category = i.job_category + JOIN SuperStars s ON e.id = s.id +GROUP BY deptId +HAVING deptId = 'K55' +SELECT e.department_id AS deptId, coll_sum(e.salary + i.bonus) AS star_cost +ORDER BY deptId; + diff --git a/asterix-app/src/test/resources/runtimets/results/group-by/core-02/core-02.2.adm b/asterix-app/src/test/resources/runtimets/results/group-by/core-02/core-02.2.adm new file mode 100644 index 0000000..4281a7b --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/results/group-by/core-02/core-02.2.adm @@ -0,0 +1 @@ +{ "deptId": "K55", "star_cost": 3000 } diff --git a/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/InlineColumnAliasVisitor.java b/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/InlineColumnAliasVisitor.java index bb8c149..7f5d011 100644 --- a/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/InlineColumnAliasVisitor.java +++ b/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/InlineColumnAliasVisitor.java @@ -82,22 +82,22 @@ } @Override - public Void visit(WhereClause whereClause, Boolean arg) throws AsterixException { - whereClause.getWhereExpr().accept(this, arg); + public Void visit(WhereClause whereClause, Boolean overwriteWithGbyVarRefs) throws AsterixException { + whereClause.getWhereExpr().accept(this, overwriteWithGbyVarRefs); return null; } @Override - public Void visit(FromClause fromClause, Boolean arg) throws AsterixException { + public Void visit(FromClause fromClause, Boolean overwriteWithGbyVarRefs) throws AsterixException { for (FromTerm fromTerm : fromClause.getFromTerms()) { - fromTerm.accept(this, arg); + fromTerm.accept(this, overwriteWithGbyVarRefs); } return null; } @Override - public Void visit(FromTerm fromTerm, Boolean arg) throws AsterixException { - fromTerm.getLeftExpression().accept(this, arg); + public Void visit(FromTerm fromTerm, Boolean overwriteWithGbyVarRefs) throws AsterixException { + fromTerm.getLeftExpression().accept(this, overwriteWithGbyVarRefs); // A from binding variable will override the alias to substitute. scopeChecker.getCurrentScope().removeSymbolExpressionMapping(fromTerm.getLeftVariable()); if (fromTerm.hasPositionalVariable()) { @@ -105,67 +105,68 @@ } for (AbstractBinaryCorrelateClause correlate : fromTerm.getCorrelateClauses()) { - correlate.accept(this, arg); + correlate.accept(this, overwriteWithGbyVarRefs); } return null; } @Override - public Void visit(JoinClause joinClause, Boolean arg) throws AsterixException { - joinClause.getRightExpression().accept(this, arg); + public Void visit(JoinClause joinClause, Boolean overwriteWithGbyVarRefs) throws AsterixException { + joinClause.getRightExpression().accept(this, overwriteWithGbyVarRefs); removeSubsutitions(joinClause); - joinClause.getConditionExpression().accept(this, arg); + joinClause.getConditionExpression().accept(this, overwriteWithGbyVarRefs); return null; } @Override - public Void visit(NestClause nestClause, Boolean arg) throws AsterixException { - nestClause.getRightExpression().accept(this, arg); - nestClause.getConditionExpression().accept(this, arg); + public Void visit(NestClause nestClause, Boolean overwriteWithGbyVarRefs) throws AsterixException { + nestClause.getRightExpression().accept(this, overwriteWithGbyVarRefs); + nestClause.getConditionExpression().accept(this, overwriteWithGbyVarRefs); removeSubsutitions(nestClause); return null; } @Override - public Void visit(UnnestClause unnestClause, Boolean arg) throws AsterixException { - unnestClause.getRightExpression().accept(this, arg); + public Void visit(UnnestClause unnestClause, Boolean overwriteWithGbyVarRefs) throws AsterixException { + unnestClause.getRightExpression().accept(this, overwriteWithGbyVarRefs); removeSubsutitions(unnestClause); return null; } @Override - public Void visit(Projection projection, Boolean arg) throws AsterixException { - projection.getExpression().accept(this, arg); + public Void visit(Projection projection, Boolean overwriteWithGbyVarRefs) throws AsterixException { + projection.getExpression().accept(this, overwriteWithGbyVarRefs); VariableExpr columnAlias = new VariableExpr( SqlppVariableUtil.toInternalVariableIdentifier(projection.getName())); VariableSubstitutionEnvironment env = scopeChecker.getCurrentScope().getVarSubstitutionEnvironment(); Expression gbyKey = (Expression) SqlppRewriteUtil.deepCopy(env.findSubstituion(columnAlias)); - if (arg) { - scopeChecker.getCurrentScope().addSymbolExpressionMappingToScope(columnAlias, projection.getExpression()); - } else { + if (overwriteWithGbyVarRefs) { if (gbyKey != null) { projection.setExpression(gbyKey); } + } else { + scopeChecker.getCurrentScope().addSymbolExpressionMappingToScope(columnAlias, projection.getExpression()); } return null; } @Override - public Void visit(SelectBlock selectBlock, Boolean arg) throws AsterixException { + public Void visit(SelectBlock selectBlock, Boolean overwriteWithGbyVarRefs) throws AsterixException { // Traverses the select block in the order of "select", "group-by", // "group-by" lets and "having". - selectBlock.getSelectClause().accept(this, true); + // The first pass over the select clause will not overwrite projection expressions. + selectBlock.getSelectClause().accept(this, false); if (selectBlock.hasFromClause()) { - selectBlock.getFromClause().accept(this, arg); + selectBlock.getFromClause().accept(this, overwriteWithGbyVarRefs); } if (selectBlock.hasLetClauses()) { for (LetClause letClause : selectBlock.getLetList()) { - letClause.accept(this, arg); + letClause.accept(this, overwriteWithGbyVarRefs); } } if (selectBlock.hasGroupbyClause()) { - selectBlock.getGroupbyClause().accept(this, arg); + selectBlock.getGroupbyClause().accept(this, overwriteWithGbyVarRefs); } if (selectBlock.hasLetClausesAfterGroupby()) { for (LetClause letClauseAfterGby : selectBlock.getLetListAfterGroupby()) { @@ -173,75 +174,117 @@ } } if (selectBlock.hasHavingClause()) { - selectBlock.getHavingClause().accept(this, arg); + selectBlock.getHavingClause().accept(this, overwriteWithGbyVarRefs); } - // Visit select clause again to overwrite projection expressions if the group-by clause is rewritten. - selectBlock.getSelectClause().accept(this, false); + // Visit select clause again to overwrite projection expressions to group-by + // key variable references if any group-by key is the original projection + // expression. + selectBlock.getSelectClause().accept(this, true); return null; } @Override - public Void visit(SelectClause selectClause, Boolean arg) throws AsterixException { + public Void visit(SelectClause selectClause, Boolean overwriteWithGbyVarRefs) throws AsterixException { if (selectClause.selectElement()) { - selectClause.getSelectElement().accept(this, arg); + selectClause.getSelectElement().accept(this, overwriteWithGbyVarRefs); } if (selectClause.selectRegular()) { - selectClause.getSelectRegular().accept(this, arg); + selectClause.getSelectRegular().accept(this, overwriteWithGbyVarRefs); } return null; } @Override - public Void visit(SelectElement selectElement, Boolean arg) throws AsterixException { + public Void visit(SelectElement selectElement, Boolean overwriteWithGbyVarRefs) throws AsterixException { Expression expr = selectElement.getExpression(); - expr.accept(this, arg); + expr.accept(this, overwriteWithGbyVarRefs); if (expr.getKind() == Kind.RECORD_CONSTRUCTOR_EXPRESSION) { - // To be consistent with SelectRegular. - mapForRecordConstructor(arg, (RecordConstructor) expr); + // Rewrite top-level field names (aliases), in order to be consistent with SelectRegular. + mapForRecordConstructor(overwriteWithGbyVarRefs, (RecordConstructor) expr); } return null; } + /** + * Map aliases for a record constructor in SELECT ELEMENT. + * + * @param firstPass, + * whether this is the first pass over the select clause. + * @param rc, + * the RecordConstructor expression. + * @throws AsterixException + */ + private void mapForRecordConstructor(Boolean overwriteColumnAlias, RecordConstructor rc) throws AsterixException { + for (FieldBinding binding : rc.getFbList()) { + Expression leftExpr = binding.getLeftExpr(); + // We only need to deal with the case that the left expression (for a field name) is + // a string literal. Otherwise, it is different from a column alias in a projection + // (e.g., foo.name AS name) in regular SQL SELECT. + if (leftExpr.getKind() == Kind.LITERAL_EXPRESSION) { + LiteralExpr literalExpr = (LiteralExpr) leftExpr; + if (literalExpr.getValue().getLiteralType() == Literal.Type.STRING) { + String fieldName = literalExpr.getValue().getStringValue(); + VariableExpr columnAlias = new VariableExpr( + SqlppVariableUtil.toInternalVariableIdentifier(fieldName)); + VariableSubstitutionEnvironment env = scopeChecker.getCurrentScope() + .getVarSubstitutionEnvironment(); + if (overwriteColumnAlias) { + // If this is the second pass, rewrites the field value expression + // by the mapped grouping key (for the column alias) if there exists such a mapping. + Expression gbyKey = (Expression) SqlppRewriteUtil.deepCopy(env.findSubstituion(columnAlias)); + if (gbyKey != null) { + binding.setRightExpr(gbyKey); + } + } else { + // If this is the first pass, map a field name (i.e., column alias) to the field expression. + scopeChecker.getCurrentScope().addSymbolExpressionMappingToScope(columnAlias, + binding.getRightExpr()); + } + } + } + } + } + @Override - public Void visit(SelectRegular selectRegular, Boolean arg) throws AsterixException { + public Void visit(SelectRegular selectRegular, Boolean overwriteWithGbyVarRefs) throws AsterixException { for (Projection projection : selectRegular.getProjections()) { - projection.accept(this, arg); + projection.accept(this, overwriteWithGbyVarRefs); } return null; } @Override - public Void visit(SelectSetOperation selectSetOperation, Boolean arg) throws AsterixException { - selectSetOperation.getLeftInput().accept(this, arg); + public Void visit(SelectSetOperation selectSetOperation, Boolean overwriteWithGbyVarRefs) throws AsterixException { + selectSetOperation.getLeftInput().accept(this, overwriteWithGbyVarRefs); for (SetOperationRight right : selectSetOperation.getRightInputs()) { - right.getSetOperationRightInput().accept(this, arg); + right.getSetOperationRightInput().accept(this, overwriteWithGbyVarRefs); } return null; } @Override - public Void visit(SelectExpression selectExpression, Boolean arg) throws AsterixException { + public Void visit(SelectExpression selectExpression, Boolean overwriteWithGbyVarRefs) throws AsterixException { scopeChecker.createNewScope(); // Visits let bindings. if (selectExpression.hasLetClauses()) { for (LetClause lc : selectExpression.getLetList()) { - lc.accept(this, arg); + lc.accept(this, overwriteWithGbyVarRefs); } } // Visits selectSetOperation. - selectExpression.getSelectSetOperation().accept(this, arg); + selectExpression.getSelectSetOperation().accept(this, overwriteWithGbyVarRefs); // Visits order by. if (selectExpression.hasOrderby()) { - selectExpression.getOrderbyClause().accept(this, arg); + selectExpression.getOrderbyClause().accept(this, overwriteWithGbyVarRefs); } // Visits limit. if (selectExpression.hasLimit()) { - selectExpression.getLimitClause().accept(this, arg); + selectExpression.getLimitClause().accept(this, overwriteWithGbyVarRefs); } // Exits the scope that were entered within this select expression @@ -250,9 +293,9 @@ } @Override - public Void visit(LetClause letClause, Boolean rewrite) throws AsterixException { + public Void visit(LetClause letClause, Boolean overwriteColumnAlias) throws AsterixException { VariableSubstitutionEnvironment env = scopeChecker.getCurrentScope().getVarSubstitutionEnvironment(); - if (rewrite) { + if (overwriteColumnAlias) { Expression newBindExpr = (Expression) SqlppVariableSubstitutionUtil .substituteVariableWithoutContext(letClause.getBindingExpr(), env); letClause.setBindingExpr(newBindExpr); @@ -264,26 +307,26 @@ } @Override - public Void visit(OrderbyClause oc, Boolean arg) throws AsterixException { + public Void visit(OrderbyClause oc, Boolean overwriteWithGbyVarRefs) throws AsterixException { VariableSubstitutionEnvironment env = scopeChecker.getCurrentScope().getVarSubstitutionEnvironment(); List orderExprs = new ArrayList(); for (Expression orderExpr : oc.getOrderbyList()) { orderExprs.add((Expression) SqlppVariableSubstitutionUtil.substituteVariableWithoutContext(orderExpr, env)); - orderExpr.accept(this, arg); + orderExpr.accept(this, overwriteWithGbyVarRefs); } oc.setOrderbyList(orderExprs); return null; } @Override - public Void visit(GroupbyClause gc, Boolean arg) throws AsterixException { + public Void visit(GroupbyClause gc, Boolean overwriteWithGbyVarRefs) throws AsterixException { VariableSubstitutionEnvironment env = scopeChecker.getCurrentScope().getVarSubstitutionEnvironment(); Map oldGbyExprsToNewGbyVarMap = new HashMap<>(); for (GbyVariableExpressionPair gbyVarExpr : gc.getGbyPairList()) { Expression oldGbyExpr = gbyVarExpr.getExpr(); Expression newExpr = (Expression) SqlppVariableSubstitutionUtil.substituteVariableWithoutContext(oldGbyExpr, env); - newExpr.accept(this, arg); + newExpr.accept(this, overwriteWithGbyVarRefs); gbyVarExpr.setExpr(newExpr); if (gbyVarExpr.getVar() == null) { gbyVarExpr.setVar(new VariableExpr(context.newVariable())); @@ -305,50 +348,50 @@ } @Override - public Void visit(LimitClause limitClause, Boolean arg) throws AsterixException { - limitClause.getLimitExpr().accept(this, arg); + public Void visit(LimitClause limitClause, Boolean overwriteWithGbyVarRefs) throws AsterixException { + limitClause.getLimitExpr().accept(this, overwriteWithGbyVarRefs); return null; } @Override - public Void visit(HavingClause havingClause, Boolean arg) throws AsterixException { + public Void visit(HavingClause havingClause, Boolean overwriteWithGbyVarRefs) throws AsterixException { VariableSubstitutionEnvironment env = scopeChecker.getCurrentScope().getVarSubstitutionEnvironment(); Expression newFilterExpr = (Expression) SqlppVariableSubstitutionUtil .substituteVariableWithoutContext(havingClause.getFilterExpression(), env); - newFilterExpr.accept(this, arg); + newFilterExpr.accept(this, overwriteWithGbyVarRefs); havingClause.setFilterExpression(newFilterExpr); return null; } @Override - public Void visit(Query q, Boolean arg) throws AsterixException { - q.getBody().accept(this, arg); + public Void visit(Query q, Boolean overwriteWithGbyVarRefs) throws AsterixException { + q.getBody().accept(this, overwriteWithGbyVarRefs); return null; } @Override - public Void visit(FunctionDecl fd, Boolean arg) throws AsterixException { + public Void visit(FunctionDecl fd, Boolean overwriteWithGbyVarRefs) throws AsterixException { scopeChecker.createNewScope(); - fd.getFuncBody().accept(this, arg); + fd.getFuncBody().accept(this, overwriteWithGbyVarRefs); scopeChecker.removeCurrentScope(); return null; } @Override - public Void visit(LiteralExpr l, Boolean arg) throws AsterixException { + public Void visit(LiteralExpr l, Boolean overwriteWithGbyVarRefs) throws AsterixException { return null; } @Override - public Void visit(ListConstructor lc, Boolean arg) throws AsterixException { + public Void visit(ListConstructor lc, Boolean overwriteWithGbyVarRefs) throws AsterixException { for (Expression expr : lc.getExprList()) { - expr.accept(this, arg); + expr.accept(this, overwriteWithGbyVarRefs); } return null; } @Override - public Void visit(RecordConstructor rc, Boolean rewrite) throws AsterixException { + public Void visit(RecordConstructor rc, Boolean overwriteWithGbyVarRefs) throws AsterixException { for (FieldBinding binding : rc.getFbList()) { binding.getLeftExpr().accept(this, false); binding.getRightExpr().accept(this, false); @@ -356,87 +399,62 @@ return null; } - private void mapForRecordConstructor(Boolean initPhase, RecordConstructor rc) throws AsterixException { - for (FieldBinding binding : rc.getFbList()) { - Expression leftExpr = binding.getLeftExpr(); - if (leftExpr.getKind() == Kind.LITERAL_EXPRESSION) { - LiteralExpr literalExpr = (LiteralExpr) leftExpr; - if (literalExpr.getValue().getLiteralType() == Literal.Type.STRING) { - String fieldName = literalExpr.getValue().getStringValue(); - VariableExpr columnAlias = new VariableExpr( - SqlppVariableUtil.toInternalVariableIdentifier(fieldName)); - VariableSubstitutionEnvironment env = scopeChecker.getCurrentScope() - .getVarSubstitutionEnvironment(); - if (initPhase) { - scopeChecker.getCurrentScope().addSymbolExpressionMappingToScope(columnAlias, - binding.getRightExpr()); - } else { - Expression gbyKey = (Expression) SqlppRewriteUtil.deepCopy(env.findSubstituion(columnAlias)); - if (gbyKey != null) { - binding.setRightExpr(gbyKey); - } - } - } - } - } - } - @Override - public Void visit(OperatorExpr operatorExpr, Boolean arg) throws AsterixException { + public Void visit(OperatorExpr operatorExpr, Boolean overwriteWithGbyVarRefs) throws AsterixException { for (Expression expr : operatorExpr.getExprList()) { - expr.accept(this, arg); + expr.accept(this, overwriteWithGbyVarRefs); } return null; } @Override - public Void visit(IfExpr ifExpr, Boolean arg) throws AsterixException { - ifExpr.getCondExpr().accept(this, arg); - ifExpr.getThenExpr().accept(this, arg); - ifExpr.getElseExpr().accept(this, arg); + public Void visit(IfExpr ifExpr, Boolean overwriteWithGbyVarRefs) throws AsterixException { + ifExpr.getCondExpr().accept(this, overwriteWithGbyVarRefs); + ifExpr.getThenExpr().accept(this, overwriteWithGbyVarRefs); + ifExpr.getElseExpr().accept(this, overwriteWithGbyVarRefs); return null; } @Override - public Void visit(QuantifiedExpression qe, Boolean arg) throws AsterixException { + public Void visit(QuantifiedExpression qe, Boolean overwriteWithGbyVarRefs) throws AsterixException { for (QuantifiedPair pair : qe.getQuantifiedList()) { - pair.getExpr().accept(this, arg); + pair.getExpr().accept(this, overwriteWithGbyVarRefs); } - qe.getSatisfiesExpr().accept(this, arg); + qe.getSatisfiesExpr().accept(this, overwriteWithGbyVarRefs); return null; } @Override - public Void visit(CallExpr callExpr, Boolean arg) throws AsterixException { + public Void visit(CallExpr callExpr, Boolean overwriteWithGbyVarRefs) throws AsterixException { for (Expression expr : callExpr.getExprList()) { - expr.accept(this, arg); + expr.accept(this, overwriteWithGbyVarRefs); } return null; } @Override - public Void visit(VariableExpr varExpr, Boolean arg) throws AsterixException { + public Void visit(VariableExpr varExpr, Boolean overwriteWithGbyVarRefs) throws AsterixException { return null; } @Override - public Void visit(UnaryExpr u, Boolean arg) throws AsterixException { - u.getExpr().accept(this, arg); + public Void visit(UnaryExpr u, Boolean overwriteWithGbyVarRefs) throws AsterixException { + u.getExpr().accept(this, overwriteWithGbyVarRefs); return null; } @Override - public Void visit(FieldAccessor fa, Boolean arg) throws AsterixException { - fa.getExpr().accept(this, arg); + public Void visit(FieldAccessor fa, Boolean overwriteWithGbyVarRefs) throws AsterixException { + fa.getExpr().accept(this, overwriteWithGbyVarRefs); return null; } @Override - public Void visit(IndexAccessor ia, Boolean arg) throws AsterixException { - ia.getExpr().accept(this, arg); + public Void visit(IndexAccessor ia, Boolean overwriteWithGbyVarRefs) throws AsterixException { + ia.getExpr().accept(this, overwriteWithGbyVarRefs); Expression indexExpr = ia.getExpr(); if (indexExpr != null) { - indexExpr.accept(this, arg); + indexExpr.accept(this, overwriteWithGbyVarRefs); } return null; } -- To view, visit https://asterix-gerrit.ics.uci.edu/789 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I82c5bc4568c11c474bec053e9f5162927c1c15d0 Gerrit-PatchSet: 1 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Yingyi Bu