#include #include namespace DB { void throwExceptionForIncompletelyParsedValue( ReadBuffer & read_buffer, Block & block, size_t result) { const IDataType & to_type = *block.getByPosition(result).type; WriteBufferFromOwnString message_buf; message_buf << "Cannot parse string " << quote << String(read_buffer.buffer().begin(), read_buffer.buffer().size()) << " as " << to_type.getName() << ": syntax error"; if (read_buffer.offset()) message_buf << " at position " << read_buffer.offset() << " (parsed just " << quote << String(read_buffer.buffer().begin(), read_buffer.offset()) << ")"; else message_buf << " at begin of string"; if (to_type.isNumber()) message_buf << ". Note: there are to" << to_type.getName() << "OrZero function, which returns zero instead of throwing exception."; throw Exception(message_buf.str(), ErrorCodes::CANNOT_PARSE_TEXT); } void registerFunctionsConversion(FunctionFactory & factory) { factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); factory.registerFunction>(); factory.registerFunction>(); factory.registerFunction>(); factory.registerFunction>(); factory.registerFunction>(); factory.registerFunction>(); factory.registerFunction>(); } }