use of org.apache.asterix.runtime.evaluators.functions.utils.StringTrimmer in project asterixdb by apache.
the class StringTrim2Descriptor method createEvaluatorFactory.
@Override
public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
return new IScalarEvaluatorFactory() {
private static final long serialVersionUID = 1L;
@Override
public IScalarEvaluator createScalarEvaluator(IHyracksTaskContext ctx) throws HyracksDataException {
return new AbstractBinaryStringStringEval(ctx, args[0], args[1], StringTrim2Descriptor.this.getIdentifier()) {
private StringTrimmer stringTrimmer = new StringTrimmer(resultBuilder, resultArray);
@Override
protected void compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr, UTF8StringPointable resultStrPtr) throws IOException {
stringTrimmer.build(patternPtr);
stringTrimmer.trim(srcPtr, resultStrPtr, true, true);
}
};
}
};
}
use of org.apache.asterix.runtime.evaluators.functions.utils.StringTrimmer in project asterixdb by apache.
the class StringRTrim2Descriptor method createEvaluatorFactory.
@Override
public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
return new IScalarEvaluatorFactory() {
private static final long serialVersionUID = 1L;
@Override
public IScalarEvaluator createScalarEvaluator(IHyracksTaskContext ctx) throws HyracksDataException {
return new AbstractBinaryStringStringEval(ctx, args[0], args[1], StringRTrim2Descriptor.this.getIdentifier()) {
private StringTrimmer stringTrimmer = new StringTrimmer(resultBuilder, resultArray);
@Override
protected void compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr, UTF8StringPointable resultStrPtr) throws IOException {
stringTrimmer.build(patternPtr);
stringTrimmer.trim(srcPtr, resultStrPtr, false, true);
}
};
}
};
}
use of org.apache.asterix.runtime.evaluators.functions.utils.StringTrimmer in project asterixdb by apache.
the class StringLTrim2Descriptor method createEvaluatorFactory.
@Override
public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
return new IScalarEvaluatorFactory() {
private static final long serialVersionUID = 1L;
@Override
public IScalarEvaluator createScalarEvaluator(IHyracksTaskContext ctx) throws HyracksDataException {
return new AbstractBinaryStringStringEval(ctx, args[0], args[1], StringLTrim2Descriptor.this.getIdentifier()) {
private StringTrimmer stringTrimmer = new StringTrimmer(resultBuilder, resultArray);
@Override
protected void compute(UTF8StringPointable srcPtr, UTF8StringPointable patternPtr, UTF8StringPointable resultStrPtr) throws IOException {
stringTrimmer.build(patternPtr);
stringTrimmer.trim(srcPtr, resultStrPtr, true, false);
}
};
}
};
}
Aggregations