virtual void getReturnType(ServerInterface &srvInterface, const SizedColumnTypes &input_types, SizedColumnTypes &output_types) { output_types.addVarchar(4000, "xstl_split_1"); output_types.addVarchar(4000, "xstl_split_2"); output_types.addVarchar(4000, "xstl_split_3"); output_types.addVarchar(4000, "xstl_split_4"); output_types.addVarchar(4000, "xstl_split_5"); }
// 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"); }
// 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"); }
// Adds the appropriately sized fields this parser creates void ApacheDelimiterParser::addFields(SizedColumnTypes &types, size_t inputLen) { for (iterator it = begin(); it != end(); it++) { size_t fldLen = it.getFieldSize(); // output can be at most the size of the input if (fldLen > inputLen) fldLen = inputLen; types.addVarchar(fldLen, it.getFieldName()); } }
// 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()); 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.addVarchar(LINE_MAX, "text"); }
virtual void getReturnType(ServerInterface &srvInterface, const SizedColumnTypes &argTypes, SizedColumnTypes &returnType) { returnType.addVarchar(1024); }
virtual void getReturnType(ServerInterface &srvInterface, const SizedColumnTypes &input_types, SizedColumnTypes &output_types) { output_types.addVarchar(4000, "xpath_result"); }
virtual void getParameterType(ServerInterface &srvInterface, SizedColumnTypes ¶meterTypes) { parameterTypes.addVarchar(65000, "cmd"); }