Search in sources :

Example 11 with FieldBinding

use of org.apache.asterix.lang.common.expression.FieldBinding in project asterixdb by apache.

the class GatherFunctionCallsVisitor method visit.

@Override
public Void visit(RecordConstructor rc, Void arg) throws CompilationException {
    for (FieldBinding fb : rc.getFbList()) {
        fb.getLeftExpr().accept(this, arg);
        fb.getRightExpr().accept(this, arg);
    }
    return null;
}
Also used : FieldBinding(org.apache.asterix.lang.common.expression.FieldBinding)

Example 12 with FieldBinding

use of org.apache.asterix.lang.common.expression.FieldBinding in project asterixdb by apache.

the class AbstractInlineUdfsVisitor method visit.

@Override
public Boolean visit(RecordConstructor rc, List<FunctionDecl> arg) throws CompilationException {
    boolean changed = false;
    for (FieldBinding b : rc.getFbList()) {
        Pair<Boolean, Expression> leftExprInlined = inlineUdfsInExpr(b.getLeftExpr(), arg);
        b.setLeftExpr(leftExprInlined.second);
        changed = changed || leftExprInlined.first;
        Pair<Boolean, Expression> rightExprInlined = inlineUdfsInExpr(b.getRightExpr(), arg);
        b.setRightExpr(rightExprInlined.second);
        changed = changed || rightExprInlined.first;
    }
    return changed;
}
Also used : ILangExpression(org.apache.asterix.lang.common.base.ILangExpression) QuantifiedExpression(org.apache.asterix.lang.common.expression.QuantifiedExpression) Expression(org.apache.asterix.lang.common.base.Expression) FieldBinding(org.apache.asterix.lang.common.expression.FieldBinding)

Example 13 with FieldBinding

use of org.apache.asterix.lang.common.expression.FieldBinding in project asterixdb by apache.

the class AbstractAqlSimpleExpressionVisitor method visit.

@Override
public Expression visit(RecordConstructor rc, ILangExpression arg) throws CompilationException {
    for (FieldBinding binding : rc.getFbList()) {
        binding.setLeftExpr(visit(binding.getLeftExpr(), rc));
        binding.setRightExpr(visit(binding.getRightExpr(), rc));
    }
    return rc;
}
Also used : FieldBinding(org.apache.asterix.lang.common.expression.FieldBinding)

Example 14 with FieldBinding

use of org.apache.asterix.lang.common.expression.FieldBinding in project asterixdb by apache.

the class DeepCopyVisitor method visit.

@Override
public RecordConstructor visit(RecordConstructor rc, Void arg) throws CompilationException {
    List<FieldBinding> bindings = new ArrayList<>();
    for (FieldBinding binding : rc.getFbList()) {
        FieldBinding fb = new FieldBinding((Expression) binding.getLeftExpr().accept(this, arg), (Expression) binding.getRightExpr().accept(this, arg));
        bindings.add(fb);
    }
    return new RecordConstructor(bindings);
}
Also used : ArrayList(java.util.ArrayList) FieldBinding(org.apache.asterix.lang.common.expression.FieldBinding) RecordConstructor(org.apache.asterix.lang.common.expression.RecordConstructor)

Aggregations

FieldBinding (org.apache.asterix.lang.common.expression.FieldBinding)14 ILangExpression (org.apache.asterix.lang.common.base.ILangExpression)4 ArrayList (java.util.ArrayList)3 RecordConstructor (org.apache.asterix.lang.common.expression.RecordConstructor)3 Expression (org.apache.asterix.lang.common.base.Expression)2 GbyVariableExpressionPair (org.apache.asterix.lang.common.expression.GbyVariableExpressionPair)2 LiteralExpr (org.apache.asterix.lang.common.expression.LiteralExpr)2 QuantifiedPair (org.apache.asterix.lang.common.struct.QuantifiedPair)2 Pair (org.apache.hyracks.algebricks.common.utils.Pair)2 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 RecordBuilder (org.apache.asterix.builders.RecordBuilder)1 QuantifiedExpression (org.apache.asterix.lang.common.expression.QuantifiedExpression)1 VariableExpr (org.apache.asterix.lang.common.expression.VariableExpr)1 StringLiteral (org.apache.asterix.lang.common.literal.StringLiteral)1 VariableSubstitutionEnvironment (org.apache.asterix.lang.common.rewrites.VariableSubstitutionEnvironment)1 VarIdentifier (org.apache.asterix.lang.common.struct.VarIdentifier)1 Projection (org.apache.asterix.lang.sqlpp.clause.Projection)1 SelectRegular (org.apache.asterix.lang.sqlpp.clause.SelectRegular)1 SelectExpression (org.apache.asterix.lang.sqlpp.expression.SelectExpression)1