presto-mongodb/src/main/java/io/prestosql/plugin/mongodb/ObjectIdFunctions.java/ObjectIdFunctions/castToVarchar
class ObjectIdFunctions:    @ScalarOperator(CAST)
    @LiteralParameters("x")
    @SqlType("varchar(x)")
    public static Slice castToVarchar(@LiteralParameter("x") long x, @SqlType("ObjectId") Slice value)
    {
        String hexString = new ObjectId(value.getBytes()).toString();
        if (hexString.length() > x) {
            hexString = hexString.substring(0, toIntExact(x));
        }
        return utf8Slice(hexString);
    }