use of io.trino.sql.InterpretedFunctionInvoker in project trino by trinodb.
the class ValuePrinter method castToVarcharOrFail.
public String castToVarcharOrFail(Type type, Object value) throws OperatorNotFoundException {
if (value == null) {
return "NULL";
}
ResolvedFunction coercion = metadata.getCoercion(session, type, VARCHAR);
Slice coerced = (Slice) new InterpretedFunctionInvoker(functionManager).invoke(coercion, session.toConnectorSession(), value);
return coerced.toStringUtf8();
}
Aggregations