@Override
public IScalarEvaluatorFactory createEvaluatorFactory(ILogicalExpression expr, IVariableTypeEnvironment env,
IOperatorSchema[] inputSchemas, JobGenContext context) throws AlgebricksException {
switch (expr.getExpressionTag()) {
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();