// Tell Vertica what our return string length will be, given the input
    // string length
    virtual void getReturnType(ServerInterface &srvInterface, 
                               const SizedColumnTypes &input_types, 
                               SizedColumnTypes &output_types)
    {
        // Error out if we're called with anything but 1 argument
        if (input_types.getColumnCount() != 1)
            vt_report_error(0, "Function only accepts 1 argument, but %zu provided", input_types.getColumnCount());

        // output can be wide.  Include extra space for a last ", ..."
        output_types.addVarchar(LINE_MAX+5, "list");
    }
    // Tell Vertica what our return string length will be, given the input
    // string length
    virtual void getReturnType(ServerInterface &srvInterface, 
                               const SizedColumnTypes &input_types, 
                               SizedColumnTypes &output_types)
    {
        // Error out if we're called with anything but 1 argument
        if (input_types.getColumnCount() != 1)
            vt_report_error(0, "Function only accepts 1 argument, but %zu provided", input_types.getColumnCount());

        int input_len = input_types.getColumnType(0).getStringLength();

        // Our output size will never be more than the input size
        output_types.addVarchar(input_len, "name");
        output_types.addVarchar(input_len, "value");
    }
Пример #3
0
    // Tell Vertica what our return string length will be, given the input
    // string length
    virtual void getReturnType(ServerInterface &srvInterface, 
                               const SizedColumnTypes &input_types, 
                               SizedColumnTypes &output_types)
    {
        // Error out if we're called with anything but 1 argument
        if (input_types.getColumnCount() != 1)
            vt_report_error(0, "Function only accepts 1 argument, but %zu provided", 
                            input_types.getColumnCount());

	output_types.addInt("line_num");

        // other output is a line of output from the shell command, which is
        // truncated at LINE_MAX characters
        output_types.addVarbinary(LINE_MAX, "text");
    }
    // Tell Vertica what our return string length will be, given the input
    // string length
    virtual void getReturnType(ServerInterface &srvInterface, 
                               const SizedColumnTypes &input_types, 
                               SizedColumnTypes &output_types)
    {
        // Error out if we're called with anything but 1 argument
        if (input_types.getColumnCount() != 2)
            vt_report_error(0, "Function only accepts 2 arguments, but %zu provided", input_types.getColumnCount());

        output_types.addArg(input_types.getColumnType(0), "val");
    }
    // Tell Vertica what our return string length will be, given the input
    // string length
    virtual void getReturnType(ServerInterface &srvInterface,
                               const SizedColumnTypes &input_types,
                               SizedColumnTypes &output_types)
    {
        // Error out if we're called with anything but 1 argument
        if (input_types.getColumnCount() != ARGS)
            vt_report_error(0, "Function only accepts %d arguments, but %zu provided", ARGS, input_types.getColumnCount());


        // Our output size will never be more than the input size
        output_types.addVarchar(WIDTH, "label");
        output_types.addVarchar(WIDTH, "group_label");
    }