case CONSTANT:
IAlgebricksConstantValue constantValue = (IAlgebricksConstantValue) ((ConstantExpression) expr).getValue();
if (constantValue.isFalse()) {
IPointable p = (BooleanPointable) BooleanPointable.FACTORY.createPointable();
XDMConstants.setFalse(p);
return new ConstantEvaluatorFactory(p.getByteArray());
} else if (constantValue.isNull()) {
IPointable p = (VoidPointable) VoidPointable.FACTORY.createPointable();
XDMConstants.setEmptySequence(p);
return new ConstantEvaluatorFactory(p.getByteArray());
} else if (constantValue.isTrue()) {
IPointable p = (BooleanPointable) BooleanPointable.FACTORY.createPointable();
XDMConstants.setTrue(p);
return new ConstantEvaluatorFactory(p.getByteArray());
}
VXQueryConstantValue cv = (VXQueryConstantValue) ((ConstantExpression) expr).getValue();
return new ConstantEvaluatorFactory(cv.getValue());
case VARIABLE:
VariableReferenceExpression vrExpr = (VariableReferenceExpression) expr;
int tupleFieldIndex = inputSchemas[0].findVariable(vrExpr.getVariableReference());
return new TupleFieldEvaluatorFactory(tupleFieldIndex);