use of io.questdb.griffin.engine.functions.constants.StrConstant in project questdb by bluestreak01.
the class CastByteToStrFunctionFactory method newInstance.
@Override
public Function newInstance(int position, ObjList<Function> args, IntList argPositions, CairoConfiguration configuration, SqlExecutionContext sqlExecutionContext) {
Function intFunc = args.getQuick(0);
if (intFunc.isConstant()) {
StringSink sink = Misc.getThreadLocalBuilder();
sink.put(intFunc.getByte(null));
return new StrConstant(Chars.toString(sink));
}
return new Func(args.getQuick(0));
}
use of io.questdb.griffin.engine.functions.constants.StrConstant in project questdb by bluestreak01.
the class CastDateToStrFunctionFactory method newInstance.
@Override
public Function newInstance(int position, ObjList<Function> args, IntList argPositions, CairoConfiguration configuration, SqlExecutionContext sqlExecutionContext) {
Function func = args.getQuick(0);
if (func.isConstant()) {
StringSink sink = Misc.getThreadLocalBuilder();
sink.put(func.getDate(null));
return new StrConstant(Chars.toString(sink));
}
return new Func(args.getQuick(0));
}
Aggregations