use of org.apache.asterix.lang.common.expression.IndexAccessor in project asterixdb by apache.
the class DeepCopyVisitor method visit.
@Override
public Expression visit(IndexAccessor ia, Void arg) throws CompilationException {
Expression expr = (Expression) ia.getExpr().accept(this, arg);
Expression indexExpr = null;
if (ia.getIndexExpr() != null) {
indexExpr = (Expression) ia.getIndexExpr().accept(this, arg);
}
return new IndexAccessor(expr, indexExpr);
}
use of org.apache.asterix.lang.common.expression.IndexAccessor in project asterixdb by apache.
the class CloneAndSubstituteVariablesVisitor method visit.
@Override
public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(IndexAccessor ia, VariableSubstitutionEnvironment env) throws CompilationException {
Pair<ILangExpression, VariableSubstitutionEnvironment> p1 = ia.getExpr().accept(this, env);
Expression indexExpr = null;
if (!ia.isAny()) {
Pair<ILangExpression, VariableSubstitutionEnvironment> p2 = ia.getIndexExpr().accept(this, env);
indexExpr = (Expression) p2.first;
}
IndexAccessor i = new IndexAccessor((Expression) p1.first, indexExpr);
i.setAny(ia.isAny());
return new Pair<>(i, env);
}
Aggregations