@Override
protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
throws AlgebricksException {
final DynamicContext dCtx = (DynamicContext) ctx.getJobletContext().getGlobalJobData();
final XSDateTimePointable datetimep = (XSDateTimePointable) XSDateTimePointable.FACTORY.createPointable();
final CastToDateOperation castToDate = new CastToDateOperation();
final ArrayBackedValueStorage abvsInner = new ArrayBackedValueStorage();
final DataOutput dOutInner = abvsInner.getDataOutput();
return new AbstractTaggedValueArgumentScalarEvaluator(args) {
@Override
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
try {
dCtx.getCurrentDateTime(datetimep);
abvsInner.reset();
castToDate.convertDatetime(datetimep, dOutInner);
result.set(abvsInner);
} catch (IOException e) {
throw new SystemException(ErrorCode.SYSE0001, e);
}
}