}
@Override
protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args)
throws AlgebricksException {
final XSDurationPointable durationp = (XSDurationPointable) XSDurationPointable.FACTORY.createPointable();
final LongPointable longp = (LongPointable) LongPointable.FACTORY.createPointable();
final IntegerPointable intp = (IntegerPointable) IntegerPointable.FACTORY.createPointable();
final SequencePointable seqp = (SequencePointable) SequencePointable.FACTORY.createPointable();
final ArrayBackedValueStorage abvsInner = new ArrayBackedValueStorage();
final DataOutput dOutInner = abvsInner.getDataOutput();
return new AbstractTaggedValueArgumentScalarEvaluator(args) {
@Override
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
TaggedValuePointable tvp1 = args[0];
long value;
long YMDuration = 0, DTDuration = 0;
switch (tvp1.getTag()) {
case ValueTag.SEQUENCE_TAG:
tvp1.getValue(seqp);
if (seqp.getEntryCount() == 0) {
XDMConstants.setEmptySequence(result);
return;
}
break;
case ValueTag.XS_DURATION_TAG:
tvp1.getValue(durationp);
YMDuration = durationp.getYearMonth();
DTDuration = durationp.getDayTime();
break;
case ValueTag.XS_DAY_TIME_DURATION_TAG:
tvp1.getValue(longp);
DTDuration = longp.getLong();
break;