mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
dbms: cutting dependency [#METR-2944].
This commit is contained in:
parent
13c7d0983a
commit
c062fc1ce0
@ -17,6 +17,11 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int TOO_LARGE_ARRAY_SIZE;
|
||||
}
|
||||
|
||||
|
||||
/// Частный случай - реализация для числовых типов.
|
||||
template <typename T>
|
||||
|
@ -15,6 +15,14 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int TOO_SLOW;
|
||||
extern const int TOO_LESS_ARGUMENTS_FOR_FUNCTION;
|
||||
extern const int TOO_MUCH_ARGUMENTS_FOR_FUNCTION;
|
||||
extern const int SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
/// helper type for comparing `std::pair`s using solely the .first member
|
||||
template <template <typename> class Comparator>
|
||||
struct ComparePairFirst final
|
||||
|
@ -16,6 +16,7 @@ namespace ErrorCodes
|
||||
{
|
||||
extern const int AGGREGATE_FUNCTION_DOESNT_ALLOW_PARAMETERS;
|
||||
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
|
||||
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
|
||||
}
|
||||
|
||||
using AggregateDataPtr = char *;
|
||||
|
@ -20,6 +20,16 @@
|
||||
/// Вызов quantile занимает O(sample_count log sample_count), если после предыдущего вызова quantile был хотя бы один вызов insert. Иначе, O(1).
|
||||
/// То есть, имеет смысл сначала добавлять, потом получать квантили, не добавляя.
|
||||
|
||||
|
||||
namespace DB
|
||||
{
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int MEMORY_LIMIT_EXCEEDED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace detail
|
||||
{
|
||||
const size_t DEFAULT_SAMPLE_COUNT = 8192;
|
||||
|
@ -12,6 +12,12 @@ namespace DB
|
||||
{
|
||||
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int UNSUPPORTED_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
/// Performs case-sensitive and case-insensitive search of UTF-8 strings
|
||||
template <bool CaseSensitive, bool ASCII> class StringSearcher;
|
||||
|
||||
|
@ -23,6 +23,14 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int TYPE_MISMATCH;
|
||||
extern const int BAD_ARGUMENTS;
|
||||
extern const int UNSUPPORTED_METHOD;
|
||||
}
|
||||
|
||||
|
||||
class CacheDictionary final : public IDictionary
|
||||
{
|
||||
public:
|
||||
|
@ -14,6 +14,12 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int UNSUPPORTED_METHOD;
|
||||
}
|
||||
|
||||
|
||||
const auto max_connections = 16;
|
||||
|
||||
/** Allows loading dictionaries from local or remote ClickHouse instance
|
||||
|
@ -26,6 +26,14 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int TYPE_MISMATCH;
|
||||
extern const int BAD_ARGUMENTS;
|
||||
extern const int UNSUPPORTED_METHOD;
|
||||
}
|
||||
|
||||
|
||||
class ComplexKeyCacheDictionary final : public IDictionaryBase
|
||||
{
|
||||
public:
|
||||
|
@ -16,6 +16,14 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int TYPE_MISMATCH;
|
||||
extern const int ARGUMENT_OUT_OF_BOUND;
|
||||
extern const int BAD_ARGUMENTS;
|
||||
extern const int DICTIONARY_IS_EMPTY;
|
||||
}
|
||||
|
||||
class ComplexKeyHashedDictionary final : public IDictionaryBase
|
||||
{
|
||||
public:
|
||||
|
@ -15,6 +15,13 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int UNKNOWN_ELEMENT_IN_CONFIG;
|
||||
extern const int EXCESSIVE_ELEMENT_IN_CONFIG;
|
||||
extern const int LOGICAL_ERROR;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -19,6 +19,7 @@ namespace ErrorCodes
|
||||
{
|
||||
extern const int UNKNOWN_TYPE;
|
||||
extern const int ARGUMENT_OUT_OF_BOUND;
|
||||
extern const int TYPE_MISMATCH;
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,6 +15,15 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int TYPE_MISMATCH;
|
||||
extern const int ARGUMENT_OUT_OF_BOUND;
|
||||
extern const int BAD_ARGUMENTS;
|
||||
extern const int DICTIONARY_IS_EMPTY;
|
||||
}
|
||||
|
||||
|
||||
const auto initial_array_size = 1024;
|
||||
const auto max_array_size = 500000;
|
||||
|
||||
|
@ -14,6 +14,15 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int TYPE_MISMATCH;
|
||||
extern const int ARGUMENT_OUT_OF_BOUND;
|
||||
extern const int BAD_ARGUMENTS;
|
||||
extern const int DICTIONARY_IS_EMPTY;
|
||||
}
|
||||
|
||||
|
||||
class HashedDictionary final : public IDictionary
|
||||
{
|
||||
public:
|
||||
|
@ -12,6 +12,14 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int UNSUPPORTED_METHOD;
|
||||
extern const int WRONG_PASSWORD;
|
||||
extern const int MONGODB_INIT_FAILED;
|
||||
}
|
||||
|
||||
|
||||
/// Allows loading dictionaries from a MongoDB collection
|
||||
class MongoDBDictionarySource final : public IDictionarySource
|
||||
{
|
||||
|
@ -16,6 +16,11 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int NUMBER_OF_COLUMNS_DOESNT_MATCH;
|
||||
}
|
||||
|
||||
/// Allows processing results of a MySQL query as a sequence of Blocks, simplifies chaining
|
||||
class MySQLBlockInputStream final : public IProfilingBlockInputStream
|
||||
{
|
||||
|
@ -11,6 +11,11 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int UNSUPPORTED_METHOD;
|
||||
}
|
||||
|
||||
/// Allows loading dictionaries from a MySQL database
|
||||
class MySQLDictionarySource final : public IDictionarySource
|
||||
{
|
||||
|
@ -11,6 +11,12 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int ILLEGAL_DIVISION;
|
||||
}
|
||||
|
||||
|
||||
/** Арифметические функции: +, -, *, /, %,
|
||||
* intDiv (целочисленное деление), унарный минус.
|
||||
* Битовые функции: |, &, ^, ~.
|
||||
|
@ -28,6 +28,11 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int CANNOT_PARSE_NUMBER;
|
||||
}
|
||||
|
||||
/** Функции преобразования типов.
|
||||
* toType - преобразование "естественным образом";
|
||||
*/
|
||||
|
@ -29,6 +29,11 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int DICTIONARIES_WAS_NOT_LOADED;
|
||||
}
|
||||
|
||||
/** Функции, использующие словари Яндекс.Метрики
|
||||
* - словари регионов, операционных систем, поисковых систем.
|
||||
*
|
||||
|
@ -14,6 +14,11 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int SIZES_OF_ARRAYS_DOESNT_MATCH;
|
||||
}
|
||||
|
||||
/** Функции высшего порядка для массивов:
|
||||
*
|
||||
* arrayMap(x1,...,xn -> expression, array1,...,arrayn) - применить выражение к каждому элементу массива (или набора параллельных массивов).
|
||||
|
@ -10,6 +10,11 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int CANNOT_CLOCK_GETTIME;
|
||||
}
|
||||
|
||||
/** Функции генерации псевдослучайных чисел.
|
||||
* Функция может быть вызвана без аргументов или с одним аргументом.
|
||||
* Аргумент игнорируется и служит лишь для того, чтобы несколько вызовов одной функции считались разными и не склеивались.
|
||||
|
@ -17,6 +17,7 @@ namespace ErrorCodes
|
||||
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
|
||||
extern const int ILLEGAL_COLUMN;
|
||||
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
|
||||
extern const int TOO_LESS_ARGUMENTS_FOR_FUNCTION;
|
||||
}
|
||||
|
||||
class ExpressionAction;
|
||||
|
@ -21,6 +21,12 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int CANNOT_WRITE_TO_OSTREAM;
|
||||
extern const int RECEIVED_ERROR_FROM_REMOTE_IO_SERVER;
|
||||
}
|
||||
|
||||
/** Позволяет писать файл на удалённый сервер.
|
||||
*/
|
||||
class RemoteWriteBuffer : public WriteBuffer
|
||||
@ -63,7 +69,7 @@ public:
|
||||
{
|
||||
Poco::URI::encode(path, "&#", encoded_path);
|
||||
Poco::URI::encode(tmp_path, "&#", encoded_tmp_path);
|
||||
|
||||
|
||||
std::stringstream uri;
|
||||
uri << "http://" << host << ":" << port
|
||||
<< "/?action=write"
|
||||
@ -76,14 +82,14 @@ public:
|
||||
session.setHost(host);
|
||||
session.setPort(port);
|
||||
session.setKeepAlive(true);
|
||||
|
||||
|
||||
/// устанавливаем таймаут
|
||||
session.setTimeout(connection_timeout, send_timeout, receive_timeout);
|
||||
|
||||
|
||||
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, uri_str, Poco::Net::HTTPRequest::HTTP_1_1);
|
||||
|
||||
|
||||
request.setChunkedTransferEncoding(true);
|
||||
|
||||
|
||||
for (unsigned i = 0; i < connection_retries; ++i)
|
||||
{
|
||||
LOG_TRACE((&Logger::get("RemoteWriteBuffer")), "Sending write request to " << host << ":" << port << uri_str);
|
||||
@ -126,7 +132,7 @@ public:
|
||||
|
||||
/// Для корректной работы с AsynchronousWriteBuffer, который подменяет буферы.
|
||||
impl->set(buffer().begin(), buffer().size());
|
||||
|
||||
|
||||
impl->position() = pos;
|
||||
|
||||
try
|
||||
@ -145,7 +151,7 @@ public:
|
||||
{
|
||||
if (finalized)
|
||||
return;
|
||||
|
||||
|
||||
next();
|
||||
checkStatus();
|
||||
|
||||
@ -193,7 +199,7 @@ private:
|
||||
throw Exception(error_message.str(), ErrorCodes::RECEIVED_ERROR_FROM_REMOTE_IO_SERVER);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void rename()
|
||||
{
|
||||
std::stringstream uri;
|
||||
@ -203,9 +209,9 @@ private:
|
||||
<< "&to=" << encoded_path;
|
||||
|
||||
uri_str = Poco::URI(uri.str()).getPathAndQuery();
|
||||
|
||||
|
||||
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, uri_str, Poco::Net::HTTPRequest::HTTP_1_1);
|
||||
|
||||
|
||||
for (unsigned i = 0; i < connection_retries; ++i)
|
||||
{
|
||||
LOG_TRACE((&Logger::get("RemoteWriteBuffer")), "Sending rename request to " << host << ":" << port << uri_str);
|
||||
@ -219,7 +225,7 @@ private:
|
||||
{
|
||||
if (i + 1 == connection_retries)
|
||||
throw;
|
||||
|
||||
|
||||
LOG_WARNING((&Logger::get("RemoteWriteBuffer")), e.what() << ", message: " << e.displayText()
|
||||
<< ", URL: " << host << ":" << port << uri_str << ", try No " << i + 1 << ".");
|
||||
session.reset();
|
||||
@ -229,7 +235,7 @@ private:
|
||||
{
|
||||
if (i + 1 == connection_retries)
|
||||
throw;
|
||||
|
||||
|
||||
LOG_WARNING((&Logger::get("RemoteWriteBuffer")), "Connection timeout from " << host << ":" << port << uri_str << ", try No " << i + 1 << ".");
|
||||
session.reset();
|
||||
continue;
|
||||
|
@ -7,6 +7,14 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int UNKNOWN_AGGREGATE_FUNCTION;
|
||||
extern const int LOGICAL_ERROR;
|
||||
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
|
||||
}
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -78,8 +78,24 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int POCO_EXCEPTION;
|
||||
extern const int STD_EXCEPTION;
|
||||
extern const int UNKNOWN_EXCEPTION;
|
||||
extern const int NETWORK_ERROR;
|
||||
extern const int NO_DATA_TO_INSERT;
|
||||
extern const int BAD_ARGUMENTS;
|
||||
extern const int CANNOT_READ_HISTORY;
|
||||
extern const int CANNOT_APPEND_HISTORY;
|
||||
extern const int UNKNOWN_PACKET_FROM_SERVER;
|
||||
extern const int UNEXPECTED_PACKET_FROM_SERVER;
|
||||
extern const int CLIENT_OUTPUT_FORMAT_SPECIFIED;
|
||||
}
|
||||
|
||||
using Poco::SharedPtr;
|
||||
|
||||
|
||||
class Client : public Poco::Util::Application
|
||||
{
|
||||
public:
|
||||
|
@ -3,6 +3,15 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int LOGICAL_ERROR;
|
||||
extern const int MISMATCH_REPLICAS_DATA_SOURCES;
|
||||
extern const int NO_AVAILABLE_REPLICA;
|
||||
extern const int TIMEOUT_EXCEEDED;
|
||||
}
|
||||
|
||||
|
||||
MultiplexedConnections::MultiplexedConnections(Connection * connection_, const Settings * settings_, ThrottlerPtr throttler_)
|
||||
: settings(settings_), throttler(throttler_), supports_parallel_execution(false)
|
||||
{
|
||||
|
@ -3,312 +3,312 @@ namespace DB
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
const int UNSUPPORTED_METHOD = 1;
|
||||
const int UNSUPPORTED_PARAMETER = 2;
|
||||
const int UNEXPECTED_END_OF_FILE = 3;
|
||||
const int EXPECTED_END_OF_FILE = 4;
|
||||
const int CANNOT_PARSE_TEXT = 6;
|
||||
const int INCORRECT_NUMBER_OF_COLUMNS = 7;
|
||||
const int THERE_IS_NO_COLUMN = 8;
|
||||
const int SIZES_OF_COLUMNS_DOESNT_MATCH = 9;
|
||||
const int NOT_FOUND_COLUMN_IN_BLOCK = 10;
|
||||
const int POSITION_OUT_OF_BOUND = 11;
|
||||
const int PARAMETER_OUT_OF_BOUND = 12;
|
||||
const int SIZES_OF_COLUMNS_IN_TUPLE_DOESNT_MATCH = 13;
|
||||
const int DUPLICATE_COLUMN = 15;
|
||||
const int NO_SUCH_COLUMN_IN_TABLE = 16;
|
||||
const int DELIMITER_IN_STRING_LITERAL_DOESNT_MATCH = 17;
|
||||
const int CANNOT_INSERT_ELEMENT_INTO_CONSTANT_COLUMN = 18;
|
||||
const int SIZE_OF_ARRAY_DOESNT_MATCH_SIZE_OF_FIXEDARRAY_COLUMN = 19;
|
||||
const int NUMBER_OF_COLUMNS_DOESNT_MATCH = 20;
|
||||
const int CANNOT_READ_ALL_DATA_FROM_TAB_SEPARATED_INPUT = 21;
|
||||
const int CANNOT_PARSE_ALL_VALUE_FROM_TAB_SEPARATED_INPUT = 22;
|
||||
const int CANNOT_READ_FROM_ISTREAM = 23;
|
||||
const int CANNOT_WRITE_TO_OSTREAM = 24;
|
||||
const int CANNOT_PARSE_ESCAPE_SEQUENCE = 25;
|
||||
const int CANNOT_PARSE_QUOTED_STRING = 26;
|
||||
const int CANNOT_PARSE_INPUT_ASSERTION_FAILED = 27;
|
||||
const int CANNOT_PRINT_FLOAT_OR_DOUBLE_NUMBER = 28;
|
||||
const int CANNOT_PRINT_INTEGER = 29;
|
||||
const int CANNOT_READ_SIZE_OF_COMPRESSED_CHUNK = 30;
|
||||
const int CANNOT_READ_COMPRESSED_CHUNK = 31;
|
||||
const int ATTEMPT_TO_READ_AFTER_EOF = 32;
|
||||
const int CANNOT_READ_ALL_DATA = 33;
|
||||
const int TOO_MUCH_ARGUMENTS_FOR_FUNCTION = 34;
|
||||
const int TOO_LESS_ARGUMENTS_FOR_FUNCTION = 35;
|
||||
const int BAD_ARGUMENTS = 36;
|
||||
const int UNKNOWN_ELEMENT_IN_AST = 37;
|
||||
const int CANNOT_PARSE_DATE = 38;
|
||||
const int TOO_LARGE_SIZE_COMPRESSED = 39;
|
||||
const int CHECKSUM_DOESNT_MATCH = 40;
|
||||
const int CANNOT_PARSE_DATETIME = 41;
|
||||
const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH = 42;
|
||||
const int ILLEGAL_TYPE_OF_ARGUMENT = 43;
|
||||
const int ILLEGAL_COLUMN = 44;
|
||||
const int ILLEGAL_NUMBER_OF_RESULT_COLUMNS = 45;
|
||||
const int UNKNOWN_FUNCTION = 46;
|
||||
const int UNKNOWN_IDENTIFIER = 47;
|
||||
const int NOT_IMPLEMENTED = 48;
|
||||
const int LOGICAL_ERROR = 49;
|
||||
const int UNKNOWN_TYPE = 50;
|
||||
const int EMPTY_LIST_OF_COLUMNS_QUERIED = 51;
|
||||
const int COLUMN_QUERIED_MORE_THAN_ONCE = 52;
|
||||
const int TYPE_MISMATCH = 53;
|
||||
const int STORAGE_DOESNT_ALLOW_PARAMETERS = 54;
|
||||
const int STORAGE_REQUIRES_PARAMETER = 55;
|
||||
const int UNKNOWN_STORAGE = 56;
|
||||
const int TABLE_ALREADY_EXISTS = 57;
|
||||
const int TABLE_METADATA_ALREADY_EXISTS = 58;
|
||||
const int ILLEGAL_TYPE_OF_COLUMN_FOR_FILTER = 59;
|
||||
const int UNKNOWN_TABLE = 60;
|
||||
const int ONLY_FILTER_COLUMN_IN_BLOCK = 61;
|
||||
const int SYNTAX_ERROR = 62;
|
||||
const int UNKNOWN_AGGREGATE_FUNCTION = 63;
|
||||
const int CANNOT_READ_AGGREGATE_FUNCTION_FROM_TEXT = 64;
|
||||
const int CANNOT_WRITE_AGGREGATE_FUNCTION_AS_TEXT = 65;
|
||||
const int NOT_A_COLUMN = 66;
|
||||
const int ILLEGAL_KEY_OF_AGGREGATION = 67;
|
||||
const int CANNOT_GET_SIZE_OF_FIELD = 68;
|
||||
const int ARGUMENT_OUT_OF_BOUND = 69;
|
||||
const int CANNOT_CONVERT_TYPE = 70;
|
||||
const int CANNOT_WRITE_AFTER_END_OF_BUFFER = 71;
|
||||
const int CANNOT_PARSE_NUMBER = 72;
|
||||
const int UNKNOWN_FORMAT = 73;
|
||||
const int CANNOT_READ_FROM_FILE_DESCRIPTOR = 74;
|
||||
const int CANNOT_WRITE_TO_FILE_DESCRIPTOR = 75;
|
||||
const int CANNOT_OPEN_FILE = 76;
|
||||
const int CANNOT_CLOSE_FILE = 77;
|
||||
const int UNKNOWN_TYPE_OF_QUERY = 78;
|
||||
const int INCORRECT_FILE_NAME = 79;
|
||||
const int INCORRECT_QUERY = 80;
|
||||
const int UNKNOWN_DATABASE = 81;
|
||||
const int DATABASE_ALREADY_EXISTS = 82;
|
||||
const int DIRECTORY_DOESNT_EXIST = 83;
|
||||
const int DIRECTORY_ALREADY_EXISTS = 84;
|
||||
const int FORMAT_IS_NOT_SUITABLE_FOR_INPUT = 85;
|
||||
const int RECEIVED_ERROR_FROM_REMOTE_IO_SERVER = 86;
|
||||
const int CANNOT_SEEK_THROUGH_FILE = 87;
|
||||
const int CANNOT_TRUNCATE_FILE = 88;
|
||||
const int UNKNOWN_COMPRESSION_METHOD = 89;
|
||||
const int EMPTY_LIST_OF_COLUMNS_PASSED = 90;
|
||||
const int SIZES_OF_MARKS_FILES_ARE_INCONSISTENT = 91;
|
||||
const int EMPTY_DATA_PASSED = 92;
|
||||
const int UNKNOWN_AGGREGATED_DATA_VARIANT = 93;
|
||||
const int CANNOT_MERGE_DIFFERENT_AGGREGATED_DATA_VARIANTS = 94;
|
||||
const int CANNOT_READ_FROM_SOCKET = 95;
|
||||
const int CANNOT_WRITE_TO_SOCKET = 96;
|
||||
const int CANNOT_READ_ALL_DATA_FROM_CHUNKED_INPUT = 97;
|
||||
const int CANNOT_WRITE_TO_EMPTY_BLOCK_OUTPUT_STREAM = 98;
|
||||
const int UNKNOWN_PACKET_FROM_CLIENT = 99;
|
||||
const int UNKNOWN_PACKET_FROM_SERVER = 100;
|
||||
const int UNEXPECTED_PACKET_FROM_CLIENT = 101;
|
||||
const int UNEXPECTED_PACKET_FROM_SERVER = 102;
|
||||
const int RECEIVED_DATA_FOR_WRONG_QUERY_ID = 103;
|
||||
const int TOO_SMALL_BUFFER_SIZE = 104;
|
||||
const int CANNOT_READ_HISTORY = 105;
|
||||
const int CANNOT_APPEND_HISTORY = 106;
|
||||
const int FILE_DOESNT_EXIST = 107;
|
||||
const int NO_DATA_TO_INSERT = 108;
|
||||
const int CANNOT_BLOCK_SIGNAL = 109;
|
||||
const int CANNOT_UNBLOCK_SIGNAL = 110;
|
||||
const int CANNOT_MANIPULATE_SIGSET = 111;
|
||||
const int CANNOT_WAIT_FOR_SIGNAL = 112;
|
||||
const int THERE_IS_NO_SESSION = 113;
|
||||
const int CANNOT_CLOCK_GETTIME = 114;
|
||||
const int UNKNOWN_SETTING = 115;
|
||||
const int THERE_IS_NO_DEFAULT_VALUE = 116;
|
||||
const int INCORRECT_DATA = 117;
|
||||
const int TABLE_METADATA_DOESNT_EXIST = 118;
|
||||
const int ENGINE_REQUIRED = 119;
|
||||
const int CANNOT_INSERT_VALUE_OF_DIFFERENT_SIZE_INTO_TUPLE = 120;
|
||||
const int UNKNOWN_SET_DATA_VARIANT = 121;
|
||||
const int INCOMPATIBLE_COLUMNS = 122;
|
||||
const int UNKNOWN_TYPE_OF_AST_NODE = 123;
|
||||
const int INCORRECT_ELEMENT_OF_SET = 124;
|
||||
const int INCORRECT_RESULT_OF_SCALAR_SUBQUERY = 125;
|
||||
const int CANNOT_GET_RETURN_TYPE = 126;
|
||||
const int ILLEGAL_INDEX = 127;
|
||||
const int TOO_LARGE_ARRAY_SIZE = 128;
|
||||
const int FUNCTION_IS_SPECIAL = 129;
|
||||
const int CANNOT_READ_ARRAY_FROM_TEXT = 130;
|
||||
const int TOO_LARGE_STRING_SIZE = 131;
|
||||
const int CANNOT_CREATE_TABLE_FROM_METADATA = 132;
|
||||
const int AGGREGATE_FUNCTION_DOESNT_ALLOW_PARAMETERS = 133;
|
||||
const int PARAMETERS_TO_AGGREGATE_FUNCTIONS_MUST_BE_LITERALS = 134;
|
||||
const int ZERO_ARRAY_OR_TUPLE_INDEX = 135;
|
||||
const int UNKNOWN_ELEMENT_IN_CONFIG = 137;
|
||||
const int EXCESSIVE_ELEMENT_IN_CONFIG = 138;
|
||||
const int NO_ELEMENTS_IN_CONFIG = 139;
|
||||
const int ALL_REQUESTED_COLUMNS_ARE_MISSING = 140;
|
||||
const int SAMPLING_NOT_SUPPORTED = 141;
|
||||
const int NOT_FOUND_NODE = 142;
|
||||
const int FOUND_MORE_THAN_ONE_NODE = 143;
|
||||
const int FIRST_DATE_IS_BIGGER_THAN_LAST_DATE = 144;
|
||||
const int UNKNOWN_OVERFLOW_MODE = 145;
|
||||
const int QUERY_SECTION_DOESNT_MAKE_SENSE = 146;
|
||||
const int NOT_FOUND_FUNCTION_ELEMENT_FOR_AGGREGATE = 147;
|
||||
const int NOT_FOUND_RELATION_ELEMENT_FOR_CONDITION = 148;
|
||||
const int NOT_FOUND_RHS_ELEMENT_FOR_CONDITION = 149;
|
||||
const int NO_ATTRIBUTES_LISTED = 150;
|
||||
const int INDEX_OF_COLUMN_IN_SORT_CLAUSE_IS_OUT_OF_RANGE = 151;
|
||||
const int UNKNOWN_DIRECTION_OF_SORTING = 152;
|
||||
const int ILLEGAL_DIVISION = 153;
|
||||
const int AGGREGATE_FUNCTION_NOT_APPLICABLE = 154;
|
||||
const int UNKNOWN_RELATION = 155;
|
||||
const int DICTIONARIES_WAS_NOT_LOADED = 156;
|
||||
const int ILLEGAL_OVERFLOW_MODE = 157;
|
||||
const int TOO_MUCH_ROWS = 158;
|
||||
const int TIMEOUT_EXCEEDED = 159;
|
||||
const int TOO_SLOW = 160;
|
||||
const int TOO_MUCH_COLUMNS = 161;
|
||||
const int TOO_DEEP_SUBQUERIES = 162;
|
||||
const int TOO_DEEP_PIPELINE = 163;
|
||||
const int READONLY = 164;
|
||||
const int TOO_MUCH_TEMPORARY_COLUMNS = 165;
|
||||
const int TOO_MUCH_TEMPORARY_NON_CONST_COLUMNS = 166;
|
||||
const int TOO_DEEP_AST = 167;
|
||||
const int TOO_BIG_AST = 168;
|
||||
const int BAD_TYPE_OF_FIELD = 169;
|
||||
const int BAD_GET = 170;
|
||||
const int BLOCKS_HAS_DIFFERENT_STRUCTURE = 171;
|
||||
const int CANNOT_CREATE_DIRECTORY = 172;
|
||||
const int CANNOT_ALLOCATE_MEMORY = 173;
|
||||
const int CYCLIC_ALIASES = 174;
|
||||
const int CHUNK_NOT_FOUND = 176;
|
||||
const int DUPLICATE_CHUNK_NAME = 177;
|
||||
const int MULTIPLE_ALIASES_FOR_EXPRESSION = 178;
|
||||
const int MULTIPLE_EXPRESSIONS_FOR_ALIAS = 179;
|
||||
const int THERE_IS_NO_PROFILE = 180;
|
||||
const int ILLEGAL_FINAL = 181;
|
||||
const int ILLEGAL_PREWHERE = 182;
|
||||
const int UNEXPECTED_EXPRESSION = 183;
|
||||
const int ILLEGAL_AGGREGATION = 184;
|
||||
const int UNSUPPORTED_MYISAM_BLOCK_TYPE = 185;
|
||||
const int UNSUPPORTED_COLLATION_LOCALE = 186;
|
||||
const int COLLATION_COMPARISON_FAILED = 187;
|
||||
const int UNKNOWN_ACTION = 188;
|
||||
const int TABLE_MUST_NOT_BE_CREATED_MANUALLY = 189;
|
||||
const int SIZES_OF_ARRAYS_DOESNT_MATCH = 190;
|
||||
const int SET_SIZE_LIMIT_EXCEEDED = 191;
|
||||
const int UNKNOWN_USER = 192;
|
||||
const int WRONG_PASSWORD = 193;
|
||||
const int REQUIRED_PASSWORD = 194;
|
||||
const int IP_ADDRESS_NOT_ALLOWED = 195;
|
||||
const int UNKNOWN_ADDRESS_PATTERN_TYPE = 196;
|
||||
const int SERVER_REVISION_IS_TOO_OLD = 197;
|
||||
const int DNS_ERROR = 198;
|
||||
const int UNKNOWN_QUOTA = 199;
|
||||
const int QUOTA_DOESNT_ALLOW_KEYS = 200;
|
||||
const int QUOTA_EXPIRED = 201;
|
||||
const int TOO_MUCH_SIMULTANEOUS_QUERIES = 202;
|
||||
const int NO_FREE_CONNECTION = 203;
|
||||
const int CANNOT_FSYNC = 204;
|
||||
const int NESTED_TYPE_TOO_DEEP = 205;
|
||||
const int ALIAS_REQUIRED = 206;
|
||||
const int AMBIGUOUS_IDENTIFIER = 207;
|
||||
const int EMPTY_NESTED_TABLE = 208;
|
||||
const int SOCKET_TIMEOUT = 209;
|
||||
const int NETWORK_ERROR = 210;
|
||||
const int EMPTY_QUERY = 211;
|
||||
const int UNKNOWN_LOAD_BALANCING = 212;
|
||||
const int UNKNOWN_TOTALS_MODE = 213;
|
||||
const int CANNOT_STATVFS = 214;
|
||||
const int NOT_AN_AGGREGATE = 215;
|
||||
const int QUERY_WITH_SAME_ID_IS_ALREADY_RUNNING = 216;
|
||||
const int CLIENT_HAS_CONNECTED_TO_WRONG_PORT = 217;
|
||||
const int TABLE_IS_DROPPED = 218;
|
||||
const int DATABASE_NOT_EMPTY = 219;
|
||||
const int DUPLICATE_INTERSERVER_IO_ENDPOINT = 220;
|
||||
const int NO_SUCH_INTERSERVER_IO_ENDPOINT = 221;
|
||||
const int ADDING_REPLICA_TO_NON_EMPTY_TABLE = 222;
|
||||
const int UNEXPECTED_AST_STRUCTURE = 223;
|
||||
const int REPLICA_IS_ALREADY_ACTIVE = 224;
|
||||
const int NO_ZOOKEEPER = 225;
|
||||
const int NO_FILE_IN_DATA_PART = 226;
|
||||
const int UNEXPECTED_FILE_IN_DATA_PART = 227;
|
||||
const int BAD_SIZE_OF_FILE_IN_DATA_PART = 228;
|
||||
const int QUERY_IS_TOO_LARGE = 229;
|
||||
const int NOT_FOUND_EXPECTED_DATA_PART = 230;
|
||||
const int TOO_MANY_UNEXPECTED_DATA_PARTS = 231;
|
||||
const int NO_SUCH_DATA_PART = 232;
|
||||
const int BAD_DATA_PART_NAME = 233;
|
||||
const int NO_REPLICA_HAS_PART = 234;
|
||||
const int DUPLICATE_DATA_PART = 235;
|
||||
const int ABORTED = 236;
|
||||
const int NO_REPLICA_NAME_GIVEN = 237;
|
||||
const int FORMAT_VERSION_TOO_OLD = 238;
|
||||
const int CANNOT_MUNMAP = 239;
|
||||
const int CANNOT_MREMAP = 240;
|
||||
const int MEMORY_LIMIT_EXCEEDED = 241;
|
||||
const int TABLE_IS_READ_ONLY = 242;
|
||||
const int NOT_ENOUGH_SPACE = 243;
|
||||
const int UNEXPECTED_ZOOKEEPER_ERROR = 244;
|
||||
const int INVALID_NESTED_NAME = 245;
|
||||
const int CORRUPTED_DATA = 246;
|
||||
const int INCORRECT_MARK = 247;
|
||||
const int INVALID_PARTITION_NAME = 248;
|
||||
const int NOT_ENOUGH_BLOCK_NUMBERS = 250;
|
||||
const int NO_SUCH_REPLICA = 251;
|
||||
const int TOO_MUCH_PARTS = 252;
|
||||
const int REPLICA_IS_ALREADY_EXIST = 253;
|
||||
const int NO_ACTIVE_REPLICAS = 254;
|
||||
const int TOO_MUCH_RETRIES_TO_FETCH_PARTS = 255;
|
||||
const int PARTITION_ALREADY_EXISTS = 256;
|
||||
const int PARTITION_DOESNT_EXIST = 257;
|
||||
const int UNION_ALL_RESULT_STRUCTURES_MISMATCH = 258;
|
||||
const int UNION_ALL_COLUMN_ALIAS_MISMATCH = 259;
|
||||
const int CLIENT_OUTPUT_FORMAT_SPECIFIED = 260;
|
||||
const int UNKNOWN_BLOCK_INFO_FIELD = 261;
|
||||
const int BAD_COLLATION = 262;
|
||||
const int CANNOT_COMPILE_CODE = 263;
|
||||
const int INCOMPATIBLE_TYPE_OF_JOIN = 264;
|
||||
const int NO_AVAILABLE_REPLICA = 265;
|
||||
const int MISMATCH_REPLICAS_DATA_SOURCES = 266;
|
||||
const int STORAGE_DOESNT_SUPPORT_PARALLEL_REPLICAS = 267;
|
||||
const int CPUID_ERROR = 268;
|
||||
const int INFINITE_LOOP = 269;
|
||||
const int CANNOT_COMPRESS = 270;
|
||||
const int CANNOT_DECOMPRESS = 271;
|
||||
const int AIO_SUBMIT_ERROR = 272;
|
||||
const int AIO_COMPLETION_ERROR = 273;
|
||||
const int AIO_READ_ERROR = 274;
|
||||
const int AIO_WRITE_ERROR = 275;
|
||||
const int INDEX_NOT_USED = 277;
|
||||
const int LEADERSHIP_LOST = 278;
|
||||
const int ALL_CONNECTION_TRIES_FAILED = 279;
|
||||
const int NO_AVAILABLE_DATA = 280;
|
||||
const int DICTIONARY_IS_EMPTY = 281;
|
||||
const int INCORRECT_INDEX = 282;
|
||||
const int UNKNOWN_DISTRIBUTED_PRODUCT_MODE = 283;
|
||||
const int UNKNOWN_GLOBAL_SUBQUERIES_METHOD = 284;
|
||||
const int TOO_LESS_LIVE_REPLICAS = 285;
|
||||
const int UNSATISFIED_QUORUM_FOR_PREVIOUS_WRITE = 286;
|
||||
const int UNKNOWN_FORMAT_VERSION = 287;
|
||||
const int DISTRIBUTED_IN_JOIN_SUBQUERY_DENIED = 288;
|
||||
const int REPLICA_IS_NOT_IN_QUORUM = 289;
|
||||
const int LIMIT_EXCEEDED = 290;
|
||||
const int DATABASE_ACCESS_DENIED = 291;
|
||||
const int LEADERSHIP_CHANGED = 292;
|
||||
const int MONGODB_INIT_FAILED = 293;
|
||||
const int INVALID_BLOCK_EXTRA_INFO = 294;
|
||||
const int RECEIVED_EMPTY_DATA = 295;
|
||||
const int NO_REMOTE_SHARD_FOUND = 296;
|
||||
const int SHARD_HAS_NO_CONNECTIONS = 297;
|
||||
const int CANNOT_PIPE = 298;
|
||||
const int CANNOT_FORK = 299;
|
||||
const int CANNOT_DLSYM = 300;
|
||||
const int CANNOT_CREATE_CHILD_PROCESS = 301;
|
||||
const int CHILD_WAS_NOT_EXITED_NORMALLY = 302;
|
||||
const int CANNOT_SELECT = 303;
|
||||
const int CANNOT_WAITPID = 304;
|
||||
const int TABLE_WAS_NOT_DROPPED = 305;
|
||||
const int TOO_DEEP_RECURSION = 306;
|
||||
const int TOO_MUCH_BYTES = 307;
|
||||
extern const int UNSUPPORTED_METHOD = 1;
|
||||
extern const int UNSUPPORTED_PARAMETER = 2;
|
||||
extern const int UNEXPECTED_END_OF_FILE = 3;
|
||||
extern const int EXPECTED_END_OF_FILE = 4;
|
||||
extern const int CANNOT_PARSE_TEXT = 6;
|
||||
extern const int INCORRECT_NUMBER_OF_COLUMNS = 7;
|
||||
extern const int THERE_IS_NO_COLUMN = 8;
|
||||
extern const int SIZES_OF_COLUMNS_DOESNT_MATCH = 9;
|
||||
extern const int NOT_FOUND_COLUMN_IN_BLOCK = 10;
|
||||
extern const int POSITION_OUT_OF_BOUND = 11;
|
||||
extern const int PARAMETER_OUT_OF_BOUND = 12;
|
||||
extern const int SIZES_OF_COLUMNS_IN_TUPLE_DOESNT_MATCH = 13;
|
||||
extern const int DUPLICATE_COLUMN = 15;
|
||||
extern const int NO_SUCH_COLUMN_IN_TABLE = 16;
|
||||
extern const int DELIMITER_IN_STRING_LITERAL_DOESNT_MATCH = 17;
|
||||
extern const int CANNOT_INSERT_ELEMENT_INTO_CONSTANT_COLUMN = 18;
|
||||
extern const int SIZE_OF_ARRAY_DOESNT_MATCH_SIZE_OF_FIXEDARRAY_COLUMN = 19;
|
||||
extern const int NUMBER_OF_COLUMNS_DOESNT_MATCH = 20;
|
||||
extern const int CANNOT_READ_ALL_DATA_FROM_TAB_SEPARATED_INPUT = 21;
|
||||
extern const int CANNOT_PARSE_ALL_VALUE_FROM_TAB_SEPARATED_INPUT = 22;
|
||||
extern const int CANNOT_READ_FROM_ISTREAM = 23;
|
||||
extern const int CANNOT_WRITE_TO_OSTREAM = 24;
|
||||
extern const int CANNOT_PARSE_ESCAPE_SEQUENCE = 25;
|
||||
extern const int CANNOT_PARSE_QUOTED_STRING = 26;
|
||||
extern const int CANNOT_PARSE_INPUT_ASSERTION_FAILED = 27;
|
||||
extern const int CANNOT_PRINT_FLOAT_OR_DOUBLE_NUMBER = 28;
|
||||
extern const int CANNOT_PRINT_INTEGER = 29;
|
||||
extern const int CANNOT_READ_SIZE_OF_COMPRESSED_CHUNK = 30;
|
||||
extern const int CANNOT_READ_COMPRESSED_CHUNK = 31;
|
||||
extern const int ATTEMPT_TO_READ_AFTER_EOF = 32;
|
||||
extern const int CANNOT_READ_ALL_DATA = 33;
|
||||
extern const int TOO_MUCH_ARGUMENTS_FOR_FUNCTION = 34;
|
||||
extern const int TOO_LESS_ARGUMENTS_FOR_FUNCTION = 35;
|
||||
extern const int BAD_ARGUMENTS = 36;
|
||||
extern const int UNKNOWN_ELEMENT_IN_AST = 37;
|
||||
extern const int CANNOT_PARSE_DATE = 38;
|
||||
extern const int TOO_LARGE_SIZE_COMPRESSED = 39;
|
||||
extern const int CHECKSUM_DOESNT_MATCH = 40;
|
||||
extern const int CANNOT_PARSE_DATETIME = 41;
|
||||
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH = 42;
|
||||
extern const int ILLEGAL_TYPE_OF_ARGUMENT = 43;
|
||||
extern const int ILLEGAL_COLUMN = 44;
|
||||
extern const int ILLEGAL_NUMBER_OF_RESULT_COLUMNS = 45;
|
||||
extern const int UNKNOWN_FUNCTION = 46;
|
||||
extern const int UNKNOWN_IDENTIFIER = 47;
|
||||
extern const int NOT_IMPLEMENTED = 48;
|
||||
extern const int LOGICAL_ERROR = 49;
|
||||
extern const int UNKNOWN_TYPE = 50;
|
||||
extern const int EMPTY_LIST_OF_COLUMNS_QUERIED = 51;
|
||||
extern const int COLUMN_QUERIED_MORE_THAN_ONCE = 52;
|
||||
extern const int TYPE_MISMATCH = 53;
|
||||
extern const int STORAGE_DOESNT_ALLOW_PARAMETERS = 54;
|
||||
extern const int STORAGE_REQUIRES_PARAMETER = 55;
|
||||
extern const int UNKNOWN_STORAGE = 56;
|
||||
extern const int TABLE_ALREADY_EXISTS = 57;
|
||||
extern const int TABLE_METADATA_ALREADY_EXISTS = 58;
|
||||
extern const int ILLEGAL_TYPE_OF_COLUMN_FOR_FILTER = 59;
|
||||
extern const int UNKNOWN_TABLE = 60;
|
||||
extern const int ONLY_FILTER_COLUMN_IN_BLOCK = 61;
|
||||
extern const int SYNTAX_ERROR = 62;
|
||||
extern const int UNKNOWN_AGGREGATE_FUNCTION = 63;
|
||||
extern const int CANNOT_READ_AGGREGATE_FUNCTION_FROM_TEXT = 64;
|
||||
extern const int CANNOT_WRITE_AGGREGATE_FUNCTION_AS_TEXT = 65;
|
||||
extern const int NOT_A_COLUMN = 66;
|
||||
extern const int ILLEGAL_KEY_OF_AGGREGATION = 67;
|
||||
extern const int CANNOT_GET_SIZE_OF_FIELD = 68;
|
||||
extern const int ARGUMENT_OUT_OF_BOUND = 69;
|
||||
extern const int CANNOT_CONVERT_TYPE = 70;
|
||||
extern const int CANNOT_WRITE_AFTER_END_OF_BUFFER = 71;
|
||||
extern const int CANNOT_PARSE_NUMBER = 72;
|
||||
extern const int UNKNOWN_FORMAT = 73;
|
||||
extern const int CANNOT_READ_FROM_FILE_DESCRIPTOR = 74;
|
||||
extern const int CANNOT_WRITE_TO_FILE_DESCRIPTOR = 75;
|
||||
extern const int CANNOT_OPEN_FILE = 76;
|
||||
extern const int CANNOT_CLOSE_FILE = 77;
|
||||
extern const int UNKNOWN_TYPE_OF_QUERY = 78;
|
||||
extern const int INCORRECT_FILE_NAME = 79;
|
||||
extern const int INCORRECT_QUERY = 80;
|
||||
extern const int UNKNOWN_DATABASE = 81;
|
||||
extern const int DATABASE_ALREADY_EXISTS = 82;
|
||||
extern const int DIRECTORY_DOESNT_EXIST = 83;
|
||||
extern const int DIRECTORY_ALREADY_EXISTS = 84;
|
||||
extern const int FORMAT_IS_NOT_SUITABLE_FOR_INPUT = 85;
|
||||
extern const int RECEIVED_ERROR_FROM_REMOTE_IO_SERVER = 86;
|
||||
extern const int CANNOT_SEEK_THROUGH_FILE = 87;
|
||||
extern const int CANNOT_TRUNCATE_FILE = 88;
|
||||
extern const int UNKNOWN_COMPRESSION_METHOD = 89;
|
||||
extern const int EMPTY_LIST_OF_COLUMNS_PASSED = 90;
|
||||
extern const int SIZES_OF_MARKS_FILES_ARE_INCONSISTENT = 91;
|
||||
extern const int EMPTY_DATA_PASSED = 92;
|
||||
extern const int UNKNOWN_AGGREGATED_DATA_VARIANT = 93;
|
||||
extern const int CANNOT_MERGE_DIFFERENT_AGGREGATED_DATA_VARIANTS = 94;
|
||||
extern const int CANNOT_READ_FROM_SOCKET = 95;
|
||||
extern const int CANNOT_WRITE_TO_SOCKET = 96;
|
||||
extern const int CANNOT_READ_ALL_DATA_FROM_CHUNKED_INPUT = 97;
|
||||
extern const int CANNOT_WRITE_TO_EMPTY_BLOCK_OUTPUT_STREAM = 98;
|
||||
extern const int UNKNOWN_PACKET_FROM_CLIENT = 99;
|
||||
extern const int UNKNOWN_PACKET_FROM_SERVER = 100;
|
||||
extern const int UNEXPECTED_PACKET_FROM_CLIENT = 101;
|
||||
extern const int UNEXPECTED_PACKET_FROM_SERVER = 102;
|
||||
extern const int RECEIVED_DATA_FOR_WRONG_QUERY_ID = 103;
|
||||
extern const int TOO_SMALL_BUFFER_SIZE = 104;
|
||||
extern const int CANNOT_READ_HISTORY = 105;
|
||||
extern const int CANNOT_APPEND_HISTORY = 106;
|
||||
extern const int FILE_DOESNT_EXIST = 107;
|
||||
extern const int NO_DATA_TO_INSERT = 108;
|
||||
extern const int CANNOT_BLOCK_SIGNAL = 109;
|
||||
extern const int CANNOT_UNBLOCK_SIGNAL = 110;
|
||||
extern const int CANNOT_MANIPULATE_SIGSET = 111;
|
||||
extern const int CANNOT_WAIT_FOR_SIGNAL = 112;
|
||||
extern const int THERE_IS_NO_SESSION = 113;
|
||||
extern const int CANNOT_CLOCK_GETTIME = 114;
|
||||
extern const int UNKNOWN_SETTING = 115;
|
||||
extern const int THERE_IS_NO_DEFAULT_VALUE = 116;
|
||||
extern const int INCORRECT_DATA = 117;
|
||||
extern const int TABLE_METADATA_DOESNT_EXIST = 118;
|
||||
extern const int ENGINE_REQUIRED = 119;
|
||||
extern const int CANNOT_INSERT_VALUE_OF_DIFFERENT_SIZE_INTO_TUPLE = 120;
|
||||
extern const int UNKNOWN_SET_DATA_VARIANT = 121;
|
||||
extern const int INCOMPATIBLE_COLUMNS = 122;
|
||||
extern const int UNKNOWN_TYPE_OF_AST_NODE = 123;
|
||||
extern const int INCORRECT_ELEMENT_OF_SET = 124;
|
||||
extern const int INCORRECT_RESULT_OF_SCALAR_SUBQUERY = 125;
|
||||
extern const int CANNOT_GET_RETURN_TYPE = 126;
|
||||
extern const int ILLEGAL_INDEX = 127;
|
||||
extern const int TOO_LARGE_ARRAY_SIZE = 128;
|
||||
extern const int FUNCTION_IS_SPECIAL = 129;
|
||||
extern const int CANNOT_READ_ARRAY_FROM_TEXT = 130;
|
||||
extern const int TOO_LARGE_STRING_SIZE = 131;
|
||||
extern const int CANNOT_CREATE_TABLE_FROM_METADATA = 132;
|
||||
extern const int AGGREGATE_FUNCTION_DOESNT_ALLOW_PARAMETERS = 133;
|
||||
extern const int PARAMETERS_TO_AGGREGATE_FUNCTIONS_MUST_BE_LITERALS = 134;
|
||||
extern const int ZERO_ARRAY_OR_TUPLE_INDEX = 135;
|
||||
extern const int UNKNOWN_ELEMENT_IN_CONFIG = 137;
|
||||
extern const int EXCESSIVE_ELEMENT_IN_CONFIG = 138;
|
||||
extern const int NO_ELEMENTS_IN_CONFIG = 139;
|
||||
extern const int ALL_REQUESTED_COLUMNS_ARE_MISSING = 140;
|
||||
extern const int SAMPLING_NOT_SUPPORTED = 141;
|
||||
extern const int NOT_FOUND_NODE = 142;
|
||||
extern const int FOUND_MORE_THAN_ONE_NODE = 143;
|
||||
extern const int FIRST_DATE_IS_BIGGER_THAN_LAST_DATE = 144;
|
||||
extern const int UNKNOWN_OVERFLOW_MODE = 145;
|
||||
extern const int QUERY_SECTION_DOESNT_MAKE_SENSE = 146;
|
||||
extern const int NOT_FOUND_FUNCTION_ELEMENT_FOR_AGGREGATE = 147;
|
||||
extern const int NOT_FOUND_RELATION_ELEMENT_FOR_CONDITION = 148;
|
||||
extern const int NOT_FOUND_RHS_ELEMENT_FOR_CONDITION = 149;
|
||||
extern const int NO_ATTRIBUTES_LISTED = 150;
|
||||
extern const int INDEX_OF_COLUMN_IN_SORT_CLAUSE_IS_OUT_OF_RANGE = 151;
|
||||
extern const int UNKNOWN_DIRECTION_OF_SORTING = 152;
|
||||
extern const int ILLEGAL_DIVISION = 153;
|
||||
extern const int AGGREGATE_FUNCTION_NOT_APPLICABLE = 154;
|
||||
extern const int UNKNOWN_RELATION = 155;
|
||||
extern const int DICTIONARIES_WAS_NOT_LOADED = 156;
|
||||
extern const int ILLEGAL_OVERFLOW_MODE = 157;
|
||||
extern const int TOO_MUCH_ROWS = 158;
|
||||
extern const int TIMEOUT_EXCEEDED = 159;
|
||||
extern const int TOO_SLOW = 160;
|
||||
extern const int TOO_MUCH_COLUMNS = 161;
|
||||
extern const int TOO_DEEP_SUBQUERIES = 162;
|
||||
extern const int TOO_DEEP_PIPELINE = 163;
|
||||
extern const int READONLY = 164;
|
||||
extern const int TOO_MUCH_TEMPORARY_COLUMNS = 165;
|
||||
extern const int TOO_MUCH_TEMPORARY_NON_CONST_COLUMNS = 166;
|
||||
extern const int TOO_DEEP_AST = 167;
|
||||
extern const int TOO_BIG_AST = 168;
|
||||
extern const int BAD_TYPE_OF_FIELD = 169;
|
||||
extern const int BAD_GET = 170;
|
||||
extern const int BLOCKS_HAS_DIFFERENT_STRUCTURE = 171;
|
||||
extern const int CANNOT_CREATE_DIRECTORY = 172;
|
||||
extern const int CANNOT_ALLOCATE_MEMORY = 173;
|
||||
extern const int CYCLIC_ALIASES = 174;
|
||||
extern const int CHUNK_NOT_FOUND = 176;
|
||||
extern const int DUPLICATE_CHUNK_NAME = 177;
|
||||
extern const int MULTIPLE_ALIASES_FOR_EXPRESSION = 178;
|
||||
extern const int MULTIPLE_EXPRESSIONS_FOR_ALIAS = 179;
|
||||
extern const int THERE_IS_NO_PROFILE = 180;
|
||||
extern const int ILLEGAL_FINAL = 181;
|
||||
extern const int ILLEGAL_PREWHERE = 182;
|
||||
extern const int UNEXPECTED_EXPRESSION = 183;
|
||||
extern const int ILLEGAL_AGGREGATION = 184;
|
||||
extern const int UNSUPPORTED_MYISAM_BLOCK_TYPE = 185;
|
||||
extern const int UNSUPPORTED_COLLATION_LOCALE = 186;
|
||||
extern const int COLLATION_COMPARISON_FAILED = 187;
|
||||
extern const int UNKNOWN_ACTION = 188;
|
||||
extern const int TABLE_MUST_NOT_BE_CREATED_MANUALLY = 189;
|
||||
extern const int SIZES_OF_ARRAYS_DOESNT_MATCH = 190;
|
||||
extern const int SET_SIZE_LIMIT_EXCEEDED = 191;
|
||||
extern const int UNKNOWN_USER = 192;
|
||||
extern const int WRONG_PASSWORD = 193;
|
||||
extern const int REQUIRED_PASSWORD = 194;
|
||||
extern const int IP_ADDRESS_NOT_ALLOWED = 195;
|
||||
extern const int UNKNOWN_ADDRESS_PATTERN_TYPE = 196;
|
||||
extern const int SERVER_REVISION_IS_TOO_OLD = 197;
|
||||
extern const int DNS_ERROR = 198;
|
||||
extern const int UNKNOWN_QUOTA = 199;
|
||||
extern const int QUOTA_DOESNT_ALLOW_KEYS = 200;
|
||||
extern const int QUOTA_EXPIRED = 201;
|
||||
extern const int TOO_MUCH_SIMULTANEOUS_QUERIES = 202;
|
||||
extern const int NO_FREE_CONNECTION = 203;
|
||||
extern const int CANNOT_FSYNC = 204;
|
||||
extern const int NESTED_TYPE_TOO_DEEP = 205;
|
||||
extern const int ALIAS_REQUIRED = 206;
|
||||
extern const int AMBIGUOUS_IDENTIFIER = 207;
|
||||
extern const int EMPTY_NESTED_TABLE = 208;
|
||||
extern const int SOCKET_TIMEOUT = 209;
|
||||
extern const int NETWORK_ERROR = 210;
|
||||
extern const int EMPTY_QUERY = 211;
|
||||
extern const int UNKNOWN_LOAD_BALANCING = 212;
|
||||
extern const int UNKNOWN_TOTALS_MODE = 213;
|
||||
extern const int CANNOT_STATVFS = 214;
|
||||
extern const int NOT_AN_AGGREGATE = 215;
|
||||
extern const int QUERY_WITH_SAME_ID_IS_ALREADY_RUNNING = 216;
|
||||
extern const int CLIENT_HAS_CONNECTED_TO_WRONG_PORT = 217;
|
||||
extern const int TABLE_IS_DROPPED = 218;
|
||||
extern const int DATABASE_NOT_EMPTY = 219;
|
||||
extern const int DUPLICATE_INTERSERVER_IO_ENDPOINT = 220;
|
||||
extern const int NO_SUCH_INTERSERVER_IO_ENDPOINT = 221;
|
||||
extern const int ADDING_REPLICA_TO_NON_EMPTY_TABLE = 222;
|
||||
extern const int UNEXPECTED_AST_STRUCTURE = 223;
|
||||
extern const int REPLICA_IS_ALREADY_ACTIVE = 224;
|
||||
extern const int NO_ZOOKEEPER = 225;
|
||||
extern const int NO_FILE_IN_DATA_PART = 226;
|
||||
extern const int UNEXPECTED_FILE_IN_DATA_PART = 227;
|
||||
extern const int BAD_SIZE_OF_FILE_IN_DATA_PART = 228;
|
||||
extern const int QUERY_IS_TOO_LARGE = 229;
|
||||
extern const int NOT_FOUND_EXPECTED_DATA_PART = 230;
|
||||
extern const int TOO_MANY_UNEXPECTED_DATA_PARTS = 231;
|
||||
extern const int NO_SUCH_DATA_PART = 232;
|
||||
extern const int BAD_DATA_PART_NAME = 233;
|
||||
extern const int NO_REPLICA_HAS_PART = 234;
|
||||
extern const int DUPLICATE_DATA_PART = 235;
|
||||
extern const int ABORTED = 236;
|
||||
extern const int NO_REPLICA_NAME_GIVEN = 237;
|
||||
extern const int FORMAT_VERSION_TOO_OLD = 238;
|
||||
extern const int CANNOT_MUNMAP = 239;
|
||||
extern const int CANNOT_MREMAP = 240;
|
||||
extern const int MEMORY_LIMIT_EXCEEDED = 241;
|
||||
extern const int TABLE_IS_READ_ONLY = 242;
|
||||
extern const int NOT_ENOUGH_SPACE = 243;
|
||||
extern const int UNEXPECTED_ZOOKEEPER_ERROR = 244;
|
||||
extern const int INVALID_NESTED_NAME = 245;
|
||||
extern const int CORRUPTED_DATA = 246;
|
||||
extern const int INCORRECT_MARK = 247;
|
||||
extern const int INVALID_PARTITION_NAME = 248;
|
||||
extern const int NOT_ENOUGH_BLOCK_NUMBERS = 250;
|
||||
extern const int NO_SUCH_REPLICA = 251;
|
||||
extern const int TOO_MUCH_PARTS = 252;
|
||||
extern const int REPLICA_IS_ALREADY_EXIST = 253;
|
||||
extern const int NO_ACTIVE_REPLICAS = 254;
|
||||
extern const int TOO_MUCH_RETRIES_TO_FETCH_PARTS = 255;
|
||||
extern const int PARTITION_ALREADY_EXISTS = 256;
|
||||
extern const int PARTITION_DOESNT_EXIST = 257;
|
||||
extern const int UNION_ALL_RESULT_STRUCTURES_MISMATCH = 258;
|
||||
extern const int UNION_ALL_COLUMN_ALIAS_MISMATCH = 259;
|
||||
extern const int CLIENT_OUTPUT_FORMAT_SPECIFIED = 260;
|
||||
extern const int UNKNOWN_BLOCK_INFO_FIELD = 261;
|
||||
extern const int BAD_COLLATION = 262;
|
||||
extern const int CANNOT_COMPILE_CODE = 263;
|
||||
extern const int INCOMPATIBLE_TYPE_OF_JOIN = 264;
|
||||
extern const int NO_AVAILABLE_REPLICA = 265;
|
||||
extern const int MISMATCH_REPLICAS_DATA_SOURCES = 266;
|
||||
extern const int STORAGE_DOESNT_SUPPORT_PARALLEL_REPLICAS = 267;
|
||||
extern const int CPUID_ERROR = 268;
|
||||
extern const int INFINITE_LOOP = 269;
|
||||
extern const int CANNOT_COMPRESS = 270;
|
||||
extern const int CANNOT_DECOMPRESS = 271;
|
||||
extern const int AIO_SUBMIT_ERROR = 272;
|
||||
extern const int AIO_COMPLETION_ERROR = 273;
|
||||
extern const int AIO_READ_ERROR = 274;
|
||||
extern const int AIO_WRITE_ERROR = 275;
|
||||
extern const int INDEX_NOT_USED = 277;
|
||||
extern const int LEADERSHIP_LOST = 278;
|
||||
extern const int ALL_CONNECTION_TRIES_FAILED = 279;
|
||||
extern const int NO_AVAILABLE_DATA = 280;
|
||||
extern const int DICTIONARY_IS_EMPTY = 281;
|
||||
extern const int INCORRECT_INDEX = 282;
|
||||
extern const int UNKNOWN_DISTRIBUTED_PRODUCT_MODE = 283;
|
||||
extern const int UNKNOWN_GLOBAL_SUBQUERIES_METHOD = 284;
|
||||
extern const int TOO_LESS_LIVE_REPLICAS = 285;
|
||||
extern const int UNSATISFIED_QUORUM_FOR_PREVIOUS_WRITE = 286;
|
||||
extern const int UNKNOWN_FORMAT_VERSION = 287;
|
||||
extern const int DISTRIBUTED_IN_JOIN_SUBQUERY_DENIED = 288;
|
||||
extern const int REPLICA_IS_NOT_IN_QUORUM = 289;
|
||||
extern const int LIMIT_EXCEEDED = 290;
|
||||
extern const int DATABASE_ACCESS_DENIED = 291;
|
||||
extern const int LEADERSHIP_CHANGED = 292;
|
||||
extern const int MONGODB_INIT_FAILED = 293;
|
||||
extern const int INVALID_BLOCK_EXTRA_INFO = 294;
|
||||
extern const int RECEIVED_EMPTY_DATA = 295;
|
||||
extern const int NO_REMOTE_SHARD_FOUND = 296;
|
||||
extern const int SHARD_HAS_NO_CONNECTIONS = 297;
|
||||
extern const int CANNOT_PIPE = 298;
|
||||
extern const int CANNOT_FORK = 299;
|
||||
extern const int CANNOT_DLSYM = 300;
|
||||
extern const int CANNOT_CREATE_CHILD_PROCESS = 301;
|
||||
extern const int CHILD_WAS_NOT_EXITED_NORMALLY = 302;
|
||||
extern const int CANNOT_SELECT = 303;
|
||||
extern const int CANNOT_WAITPID = 304;
|
||||
extern const int TABLE_WAS_NOT_DROPPED = 305;
|
||||
extern const int TOO_DEEP_RECURSION = 306;
|
||||
extern const int TOO_MUCH_BYTES = 307;
|
||||
|
||||
const int KEEPER_EXCEPTION = 999;
|
||||
const int POCO_EXCEPTION = 1000;
|
||||
const int STD_EXCEPTION = 1001;
|
||||
const int UNKNOWN_EXCEPTION = 1002;
|
||||
extern const int KEEPER_EXCEPTION = 999;
|
||||
extern const int POCO_EXCEPTION = 1000;
|
||||
extern const int STD_EXCEPTION = 1001;
|
||||
extern const int UNKNOWN_EXCEPTION = 1002;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,12 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int UNKNOWN_FUNCTION;
|
||||
}
|
||||
|
||||
|
||||
/** Эти функции определены в отдельных translation unit-ах.
|
||||
* Это сделано для того, чтобы уменьшить потребление оперативки при сборке, и ускорить параллельную сборку.
|
||||
*/
|
||||
|
@ -8,6 +8,14 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int UNKNOWN_ELEMENT_IN_CONFIG;
|
||||
extern const int EXCESSIVE_ELEMENT_IN_CONFIG;
|
||||
extern const int LOGICAL_ERROR;
|
||||
extern const int SHARD_HAS_NO_CONNECTIONS;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -13,6 +13,14 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int EXCESSIVE_ELEMENT_IN_CONFIG;
|
||||
extern const int UNKNOWN_ELEMENT_IN_CONFIG;
|
||||
extern const int UNSUPPORTED_METHOD;
|
||||
extern const int TOO_SMALL_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
|
||||
DictionaryPtr DictionaryFactory::create(const std::string & name, Poco::Util::AbstractConfiguration & config,
|
||||
const std::string & config_prefix, Context & context) const
|
||||
|
@ -6,13 +6,19 @@
|
||||
#include <DB/DataStreams/IProfilingBlockInputStream.h>
|
||||
#include <DB/Core/ColumnNumbers.h>
|
||||
|
||||
/*#include <DB/DataStreams/TabSeparatedBlockOutputStream.h>
|
||||
*#include <DB/IO/WriteBufferFromFileDescriptor.h>*/
|
||||
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int UNKNOWN_SET_DATA_VARIANT;
|
||||
extern const int LOGICAL_ERROR;
|
||||
extern const int SET_SIZE_LIMIT_EXCEEDED;
|
||||
extern const int TYPE_MISMATCH;
|
||||
extern const int ILLEGAL_COLUMN;
|
||||
}
|
||||
|
||||
|
||||
Join::Type Join::chooseMethod(const ConstColumnPlainPtrs & key_columns, bool & keys_fit_128_bits, Sizes & key_sizes)
|
||||
{
|
||||
@ -67,7 +73,7 @@ static void initImpl(Maps & maps, Join::Type type)
|
||||
case Join::Type::CROSS: break;
|
||||
|
||||
default:
|
||||
throw Exception("Unknown JOIN keys variant.", ErrorCodes::UNKNOWN_AGGREGATED_DATA_VARIANT);
|
||||
throw Exception("Unknown JOIN keys variant.", ErrorCodes::UNKNOWN_SET_DATA_VARIANT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,18 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int UNKNOWN_SET_DATA_VARIANT;
|
||||
extern const int LOGICAL_ERROR;
|
||||
extern const int SET_SIZE_LIMIT_EXCEEDED;
|
||||
extern const int TYPE_MISMATCH;
|
||||
extern const int BAD_ARGUMENTS;
|
||||
extern const int INCORRECT_ELEMENT_OF_SET;
|
||||
extern const int NUMBER_OF_COLUMNS_DOESNT_MATCH;
|
||||
}
|
||||
|
||||
|
||||
void SetVariants::init(Type type_)
|
||||
{
|
||||
type = type_;
|
||||
@ -42,7 +54,7 @@ void SetVariants::init(Type type_)
|
||||
#undef M
|
||||
|
||||
default:
|
||||
throw Exception("Unknown Set variant.", ErrorCodes::UNKNOWN_AGGREGATED_DATA_VARIANT);
|
||||
throw Exception("Unknown Set variant.", ErrorCodes::UNKNOWN_SET_DATA_VARIANT);
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,7 +71,7 @@ size_t SetVariants::getTotalRowCount() const
|
||||
#undef M
|
||||
|
||||
default:
|
||||
throw Exception("Unknown Set variant.", ErrorCodes::UNKNOWN_AGGREGATED_DATA_VARIANT);
|
||||
throw Exception("Unknown Set variant.", ErrorCodes::UNKNOWN_SET_DATA_VARIANT);
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,7 +88,7 @@ size_t SetVariants::getTotalByteCount() const
|
||||
#undef M
|
||||
|
||||
default:
|
||||
throw Exception("Unknown Set variant.", ErrorCodes::UNKNOWN_AGGREGATED_DATA_VARIANT);
|
||||
throw Exception("Unknown Set variant.", ErrorCodes::UNKNOWN_SET_DATA_VARIANT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,14 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int UNKNOWN_SETTING;
|
||||
extern const int THERE_IS_NO_PROFILE;
|
||||
extern const int NO_ELEMENTS_IN_CONFIG;
|
||||
}
|
||||
|
||||
|
||||
/// Установить настройку по имени.
|
||||
void Settings::set(const String & name, const Field & value)
|
||||
{
|
||||
|
@ -7,6 +7,14 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int ABORTED;
|
||||
extern const int POCO_EXCEPTION;
|
||||
extern const int STD_EXCEPTION;
|
||||
extern const int UNKNOWN_EXCEPTION;
|
||||
}
|
||||
|
||||
|
||||
void InterserverIOHTTPHandler::processQuery(Poco::Net::HTTPServerRequest & request, Poco::Net::HTTPServerResponse & response)
|
||||
{
|
||||
|
@ -19,6 +19,14 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int POCO_EXCEPTION;
|
||||
extern const int STD_EXCEPTION;
|
||||
extern const int UNKNOWN_EXCEPTION;
|
||||
}
|
||||
|
||||
|
||||
void OLAPHTTPHandler::processQuery(Poco::Net::HTTPServerRequest & request, Poco::Net::HTTPServerResponse & response)
|
||||
{
|
||||
HTMLForm params(request);
|
||||
|
@ -5,6 +5,15 @@
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int UNSUPPORTED_PARAMETER;
|
||||
extern const int UNKNOWN_IDENTIFIER;
|
||||
extern const int UNKNOWN_RELATION;
|
||||
}
|
||||
|
||||
|
||||
namespace OLAP
|
||||
{
|
||||
|
||||
@ -12,7 +21,7 @@ QueryConverter::QueryConverter(Poco::Util::AbstractConfiguration & config)
|
||||
{
|
||||
table_for_single_counter = config.getString("olap_compatibility.table_for_single_counter");
|
||||
table_for_all_counters = config.getString("olap_compatibility.table_for_all_counters");
|
||||
|
||||
|
||||
fillFormattedAttributeMap();
|
||||
fillNumericAttributeMap();
|
||||
fillFormattingAggregatedAttributeMap();
|
||||
@ -47,20 +56,20 @@ void QueryConverter::OLAPServerQueryToClickHouse(const QueryParseResult & query,
|
||||
/// Проверим, умеем ли мы выполнять такой запрос.
|
||||
if (query.format != FORMAT_TAB)
|
||||
throw Exception("Only tab-separated output format is supported", ErrorCodes::UNSUPPORTED_PARAMETER);
|
||||
|
||||
|
||||
/// Учтем некоторые настройки (далеко не все).
|
||||
|
||||
|
||||
Settings new_settings = inout_context.getSettings();
|
||||
|
||||
|
||||
if (query.concurrency != 0)
|
||||
new_settings.max_threads = query.concurrency;
|
||||
|
||||
|
||||
if (query.max_execution_time != 0)
|
||||
new_settings.limits.max_execution_time = Poco::Timespan(query.max_execution_time, 0);
|
||||
|
||||
|
||||
if (query.max_result_size != 0)
|
||||
new_settings.limits.max_rows_to_group_by = query.max_result_size;
|
||||
|
||||
|
||||
if (query.has_overflow_mode)
|
||||
{
|
||||
switch (query.overflow_mode)
|
||||
@ -76,54 +85,54 @@ void QueryConverter::OLAPServerQueryToClickHouse(const QueryParseResult & query,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inout_context.setSettings(new_settings);
|
||||
|
||||
|
||||
/// Составим запрос.
|
||||
out_query = "SELECT ";
|
||||
|
||||
|
||||
std::vector<std::string> selected_expressions;
|
||||
|
||||
|
||||
/// Что выбирать: ключи агрегации и агрегированные значения.
|
||||
for (size_t i = 0; i < query.key_attributes.size(); ++i)
|
||||
{
|
||||
const QueryParseResult::KeyAttribute & key = query.key_attributes[i];
|
||||
std::string s = convertAttributeFormatted(key.attribute, key.parameter, regions_point_of_view_formatted);
|
||||
|
||||
|
||||
if (i > 0)
|
||||
out_query += ", ";
|
||||
out_query += s + " AS _" + firstWord(key.attribute) + (key.parameter ? "_" + toString(key.parameter) : "");
|
||||
selected_expressions.push_back(s);
|
||||
}
|
||||
|
||||
|
||||
for (size_t i = 0; i < query.aggregates.size(); ++i)
|
||||
{
|
||||
const QueryParseResult::Aggregate & aggregate = query.aggregates[i];
|
||||
std::string s = convertAggregateFunction(aggregate.attribute, aggregate.parameter, aggregate.function, query, regions_point_of_view_formatted);
|
||||
|
||||
|
||||
if (query.key_attributes.size() + i > 0)
|
||||
out_query += ", ";
|
||||
out_query += s + " AS _" + firstWord(aggregate.function) + "_" + firstWord(aggregate.attribute) + (aggregate.parameter ? "_" + toString(aggregate.parameter) : "");
|
||||
selected_expressions.push_back(s);
|
||||
}
|
||||
|
||||
|
||||
/// Из какой таблицы.
|
||||
out_query += " FROM " + getTableName(query.CounterID, query.local);
|
||||
|
||||
/// Добавляем сэмплирование.
|
||||
if (query.sample != 1)
|
||||
out_query += " SAMPLE " + toString(query.sample);
|
||||
|
||||
|
||||
/// Условия.
|
||||
out_query += " WHERE ";
|
||||
|
||||
|
||||
/// Диапазон дат.
|
||||
out_query += convertDateRange(query.date_first, query.date_last);
|
||||
|
||||
|
||||
/// Счетчик.
|
||||
if (query.CounterID != 0)
|
||||
out_query += " AND " + convertCounterID(query.CounterID);
|
||||
|
||||
|
||||
/// Произвольные условия.
|
||||
for (size_t i = 0; i < query.where_conditions.size(); ++i)
|
||||
{
|
||||
@ -131,7 +140,7 @@ void QueryConverter::OLAPServerQueryToClickHouse(const QueryParseResult & query,
|
||||
out_query += " AND " + convertCondition(
|
||||
condition.attribute, condition.parameter, condition.relation, condition.rhs, regions_point_of_view_formatted);
|
||||
}
|
||||
|
||||
|
||||
/// Группировка.
|
||||
if (!query.key_attributes.empty())
|
||||
{
|
||||
@ -143,10 +152,10 @@ void QueryConverter::OLAPServerQueryToClickHouse(const QueryParseResult & query,
|
||||
out_query += selected_expressions[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Условие для групп.
|
||||
out_query += " " + getHavingSection();
|
||||
|
||||
|
||||
/// Сортировка.
|
||||
if (!query.sort_columns.empty())
|
||||
{
|
||||
@ -154,14 +163,14 @@ void QueryConverter::OLAPServerQueryToClickHouse(const QueryParseResult & query,
|
||||
for (size_t i = 0; i < query.sort_columns.size(); ++i)
|
||||
{
|
||||
const QueryParseResult::SortColumn & column = query.sort_columns[i];
|
||||
|
||||
|
||||
if (i > 0)
|
||||
out_query += ", ";
|
||||
out_query += selected_expressions[column.index - 1];
|
||||
out_query += " " + convertSortDirection(column.direction);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Ограничение на количество выводимых строк.
|
||||
if (query.limit != 0)
|
||||
out_query += " LIMIT " + toString(query.limit);
|
||||
@ -172,7 +181,7 @@ std::string QueryConverter::convertAttributeFormatted(const std::string & attrib
|
||||
{
|
||||
if (formatted_attribute_map.count(attribute))
|
||||
return Poco::format(formatted_attribute_map.at(attribute), parameter);
|
||||
|
||||
|
||||
/** Для атрибутов по регионам, выражение содержит подстановку %s,
|
||||
* куда должна быть подставлена regions_point_of_view_formatted.
|
||||
*/
|
||||
@ -182,13 +191,13 @@ std::string QueryConverter::convertAttributeFormatted(const std::string & attrib
|
||||
if (numeric_attribute_map.count(attribute))
|
||||
{
|
||||
std::string numeric = Poco::format(numeric_attribute_map.at(attribute), parameter);
|
||||
|
||||
|
||||
if (formatting_aggregated_attribute_map.count(attribute))
|
||||
return Poco::format(formatting_aggregated_attribute_map.at(attribute), std::string("(") + numeric + ")");
|
||||
else
|
||||
return numeric;
|
||||
}
|
||||
|
||||
|
||||
throw Exception("Unknown attribute: " + attribute, ErrorCodes::UNKNOWN_IDENTIFIER);
|
||||
}
|
||||
|
||||
@ -203,7 +212,7 @@ std::string QueryConverter::convertAttributeNumeric(const std::string & attribut
|
||||
|
||||
if (numeric_attribute_map.count(attribute))
|
||||
return Poco::format(numeric_attribute_map.at(attribute), parameter);
|
||||
|
||||
|
||||
throw Exception("Unknown attribute: " + attribute, ErrorCodes::UNKNOWN_IDENTIFIER);
|
||||
}
|
||||
|
||||
@ -228,9 +237,9 @@ std::string QueryConverter::convertAggregateFunction(const std::string & attribu
|
||||
else
|
||||
return "sum(Sign)";
|
||||
}
|
||||
|
||||
|
||||
std::string numeric = convertAttributeNumeric(attribute, parameter, regions_point_of_view_formatted);
|
||||
|
||||
|
||||
if (name == "uniq" ||
|
||||
name == "uniq_sort" ||
|
||||
name == "uniq_hash" ||
|
||||
@ -241,13 +250,13 @@ std::string QueryConverter::convertAggregateFunction(const std::string & attribu
|
||||
|
||||
if (name == "uniq_state")
|
||||
return "uniqState(" + numeric + ")";
|
||||
|
||||
|
||||
if (name == "uniq_hll12")
|
||||
return "uniqHLL12(" + numeric + ")";
|
||||
|
||||
|
||||
if (name == "uniq_hll12_state")
|
||||
return "uniqHLL12State(" + numeric + ")";
|
||||
|
||||
|
||||
if (name == "count_non_zero")
|
||||
{
|
||||
if (query.sample != 1)
|
||||
@ -271,7 +280,7 @@ std::string QueryConverter::convertAggregateFunction(const std::string & attribu
|
||||
}
|
||||
|
||||
bool trivial_format;
|
||||
|
||||
|
||||
std::string format;
|
||||
if (formatting_aggregated_attribute_map.count(attribute))
|
||||
{
|
||||
@ -285,7 +294,7 @@ std::string QueryConverter::convertAggregateFunction(const std::string & attribu
|
||||
}
|
||||
|
||||
std::string s;
|
||||
|
||||
|
||||
if (name == "sum")
|
||||
{
|
||||
if (query.sample != 1)
|
||||
@ -326,10 +335,10 @@ std::string QueryConverter::convertAggregateFunction(const std::string & attribu
|
||||
s = "min(" + numeric + ")";
|
||||
if (name == "max")
|
||||
s = "max(" + numeric + ")";
|
||||
|
||||
|
||||
/// Если агрегатная функция возвращает дробное число, и атрибут имеет нетривиальное форматирование, после агрегации приведем дробное число к целому.
|
||||
bool need_cast = !trivial_format && float_value;
|
||||
|
||||
|
||||
return Poco::format(format, std::string() + (need_cast ? "toInt64" : "") + "(" + s + ")");
|
||||
}
|
||||
|
||||
@ -349,7 +358,7 @@ std::string QueryConverter::convertCondition(
|
||||
{
|
||||
std::string value = convertAttributeNumeric(attribute, parameter, regions_point_of_view_formatted);
|
||||
std::string constant = convertConstant(attribute, rhs);
|
||||
|
||||
|
||||
if (name == "equals")
|
||||
return "(" + value + ")" + " == " + constant;
|
||||
if (name == "not_equals")
|
||||
@ -436,7 +445,7 @@ void QueryConverter::fillNumericAttributeMap()
|
||||
M("VisitStartWeek", "toInt32(toDateTime(toMonday(StartDate)))")
|
||||
M("VisitStartTime", "toInt32(toTime(StartTime))")
|
||||
M("VisitStartTimeRoundedToMinute", "toInt32(toStartOfMinute(toTime(StartTime)))")
|
||||
|
||||
|
||||
M("VisitStartYear", "toYear(StartDate)")
|
||||
M("VisitStartMonth", "toMonth(StartDate)")
|
||||
M("VisitStartDayOfWeek", "toDayOfWeek(StartDate)")
|
||||
@ -449,7 +458,7 @@ void QueryConverter::fillNumericAttributeMap()
|
||||
M("FirstVisitDate", "toInt32(toDateTime(toDate(FirstVisit)))")
|
||||
M("FirstVisitWeek", "toInt32(toDateTime(toMonday(FirstVisit)))")
|
||||
M("FirstVisitTime", "toInt32(toTime(FirstVisit))")
|
||||
|
||||
|
||||
M("FirstVisitYear", "toYear(FirstVisit)")
|
||||
M("FirstVisitMonth", "toMonth(FirstVisit)")
|
||||
M("FirstVisitDayOfWeek", "toDayOfWeek(FirstVisit)")
|
||||
@ -470,7 +479,7 @@ void QueryConverter::fillNumericAttributeMap()
|
||||
M("ClientTimeHour", "toHour(ClientEventTime)")
|
||||
M("ClientTimeMinute", "toMinute(ClientEventTime)")
|
||||
M("ClientTimeSecond", "toSecond(ClientEventTime)")
|
||||
|
||||
|
||||
M("SearchPhraseHash", "SearchPhraseHash")
|
||||
M("RefererDomainHash", "RefererDomainHash")
|
||||
M("StartURLHash", "NormalizedStartURLHash")
|
||||
@ -495,10 +504,10 @@ void QueryConverter::fillNumericAttributeMap()
|
||||
M("BouncePrecise", "IsBounce")
|
||||
M("IsYandex", "IsYandex")
|
||||
M("UserID", "UserID")
|
||||
|
||||
|
||||
M("UserIDCreateDateTime", "(UserID > 10000000000000000000 OR UserID %% 10000000000 > 2000000000 OR UserID %% 10000000000 < 1000000000 ? toUInt64(0) : UserID %% 10000000000)")
|
||||
M("UserIDCreateDate", "(UserID > 10000000000000000000 OR UserID %% 10000000000 > 2000000000 OR UserID %% 10000000000 < 1000000000 ? toUInt64(0) : UserID %% 10000000000)")
|
||||
|
||||
|
||||
M("UserIDAge", "(UserID > 10000000000000000000 OR UserID %% 10000000000 < 1000000000 OR UserID %% 10000000000 > toUInt64(StartTime) ? toInt64(-1) : intDiv(toInt64(StartTime) - UserID %% 10000000000, 86400))")
|
||||
M("UserIDAgeInterval", "(UserID > 10000000000000000000 OR UserID %% 10000000000 < 1000000000 OR UserID %% 10000000000 > toUInt64(StartTime) ? toInt64(-1) : toInt64(roundToExp2(intDiv(toUInt64(StartTime) - UserID %% 10000000000, 86400))))")
|
||||
M("TotalVisits", "TotalVisits")
|
||||
@ -508,18 +517,18 @@ void QueryConverter::fillNumericAttributeMap()
|
||||
M("Sex", "Sex")
|
||||
M("Income", "Income")
|
||||
M("AdvEngineID", "AdvEngineID")
|
||||
|
||||
|
||||
M("DotNet", "NetMajor * 256 + NetMinor")
|
||||
|
||||
|
||||
M("DotNetMajor", "NetMajor")
|
||||
|
||||
|
||||
M("Flash", "FlashMajor * 256 + FlashMinor")
|
||||
|
||||
|
||||
M("FlashExists", "FlashMajor > 0")
|
||||
M("FlashMajor", "FlashMajor")
|
||||
|
||||
|
||||
M("Silverlight", "SilverlightVersion1 * 72057594037927936 + SilverlightVersion2 * 281474976710656 + SilverlightVersion3 * 65536 + SilverlightVersion4")
|
||||
|
||||
|
||||
M("SilverlightMajor", "SilverlightVersion1")
|
||||
M("Hits", "Hits")
|
||||
M("HitsInterval", "roundToExp2(Hits)")
|
||||
@ -529,30 +538,30 @@ void QueryConverter::fillNumericAttributeMap()
|
||||
M("IsMobile", "IsMobile")
|
||||
M("MobilePhoneID", "MobilePhone")
|
||||
M("MobilePhoneModelHash", "halfMD5(MobilePhoneModel)")
|
||||
|
||||
|
||||
M("MobilePhoneModel", "reinterpretAsUInt64(MobilePhoneModel)")
|
||||
M("BrowserLanguage", "BrowserLanguage")
|
||||
M("BrowserCountry", "BrowserCountry")
|
||||
M("TopLevelDomain", "TopLevelDomain")
|
||||
M("URLScheme", "URLScheme")
|
||||
|
||||
|
||||
M("IPNetworkID", "IPNetworkID")
|
||||
M("ClientTimeZone", "ClientTimeZone")
|
||||
M("OSID", "OS")
|
||||
M("OSMostAncestor", "OSToRoot(OS)")
|
||||
|
||||
|
||||
M("ClientIP", "ClientIP")
|
||||
M("Resolution", "ResolutionWidth * 16777216 + ResolutionHeight * 256 + ResolutionDepth")
|
||||
M("ResolutionWidthHeight","ResolutionWidth * 65536 + ResolutionHeight")
|
||||
|
||||
|
||||
M("ResolutionWidth", "ResolutionWidth")
|
||||
M("ResolutionHeight", "ResolutionHeight")
|
||||
M("ResolutionWidthInterval","intDiv(ResolutionWidth, 100) * 100")
|
||||
M("ResolutionHeightInterval","intDiv(ResolutionHeight, 100) * 100")
|
||||
M("ResolutionColor", "ResolutionDepth")
|
||||
|
||||
|
||||
M("WindowClientArea", "WindowClientWidth * 65536 + WindowClientHeight")
|
||||
|
||||
|
||||
M("WindowClientAreaInterval","intDiv(WindowClientWidth, 100) * 6553600 + intDiv(WindowClientHeight, 100) * 100")
|
||||
M("WindowClientWidth", "WindowClientWidth")
|
||||
M("WindowClientWidthInterval","intDiv(WindowClientWidth, 100) * 100")
|
||||
@ -561,11 +570,11 @@ void QueryConverter::fillNumericAttributeMap()
|
||||
M("SearchEngineID", "SearchEngineID")
|
||||
M("SearchEngineMostAncestor", "SEToRoot(toUInt8(SearchEngineID))")
|
||||
M("CodeVersion", "CodeVersion")
|
||||
|
||||
|
||||
M("UserAgent", "UserAgent * 16777216 + UserAgentMajor * 65536 + UserAgentMinor")
|
||||
M("UserAgentVersion", "UserAgentMajor * 65536 + UserAgentMinor")
|
||||
M("UserAgentMajor", "UserAgent * 256 + UserAgentMajor")
|
||||
|
||||
|
||||
M("UserAgentID", "UserAgent")
|
||||
M("ClickGoodEvent", "ClickGoodEvent")
|
||||
M("ClickPriorityID", "ClickPriorityID")
|
||||
@ -588,9 +597,9 @@ void QueryConverter::fillNumericAttributeMap()
|
||||
M("Converted", "has(Goals.ID, toUInt32(%u))")
|
||||
M("CounterID", "CounterID")
|
||||
M("VisitID", "VisitID")
|
||||
|
||||
|
||||
M("Interests", "Interests")
|
||||
|
||||
|
||||
M("HasInterestPhoto", "modulo(intDiv(Interests, 128), 2)")
|
||||
M("HasInterestMoviePremieres","modulo(intDiv(Interests, 64), 2)")
|
||||
M("HasInterestTourism", "modulo(intDiv(Interests, 32), 2)")
|
||||
@ -612,12 +621,12 @@ void QueryConverter::fillNumericAttributeMap()
|
||||
M("UTMTermHash", "UTMTermHash")
|
||||
M("FromHash", "FromHash")
|
||||
M("CLID", "CLID")
|
||||
|
||||
|
||||
M("SocialSourceNetworkID","SocialSourceNetworkID")
|
||||
/// где 26 это Яндекс (db_dumps/SearchEngines).
|
||||
M("CorrectedTraficSourceID", "(IsYandex AND SEIn(toUInt8(SearchEngineID), 26)) ? -1 : TraficSourceID")
|
||||
M("CorrectedSearchEngineID", "(IsYandex AND SEIn(toUInt8(SearchEngineID), 26)) ? 0 : toUInt8(SearchEngineID)")
|
||||
|
||||
|
||||
#undef M
|
||||
}
|
||||
|
||||
@ -633,33 +642,33 @@ void QueryConverter::fillFormattedAttributeMap()
|
||||
M("VisitStartDateTimeRoundedToHour", "toStartOfHour(StartTime)")
|
||||
M("VisitStartDateRoundedToMonth", "toDateTime(toStartOfMonth(StartDate))")
|
||||
M("VisitStartTimeRoundedToMinute", "substring(toString(toStartOfMinute(toTime(StartTime))), 12, 8)")
|
||||
|
||||
|
||||
M("FirstVisitDateTime", "FirstVisit")
|
||||
M("FirstVisitDate", "toDate(FirstVisit)")
|
||||
M("FirstVisitWeek", "toMonday(FirstVisit)")
|
||||
M("FirstVisitTime", "substring(toString(FirstVisit), 12, 8)")
|
||||
|
||||
|
||||
M("PredLastVisitDate", "PredLastVisit")
|
||||
M("PredLastVisitWeek", "toMonday(PredLastVisit)")
|
||||
|
||||
|
||||
M("ClientDateTime", "ClientEventTime")
|
||||
M("ClientTime", "substring(toString(ClientEventTime), 12, 8)")
|
||||
|
||||
|
||||
M("DotNet", "concat(concat(toString(NetMajor), '.'), toString(NetMinor))")
|
||||
M("Flash", "concat(concat(toString(FlashMajor),'.'),toString(FlashMinor))")
|
||||
M("Silverlight", "concat(concat(concat(concat(concat(concat(toString(SilverlightVersion1), '.'), toString(SilverlightVersion2)), '.'), toString(SilverlightVersion3)), '.'), toString(SilverlightVersion4))")
|
||||
M("MobilePhoneModel", "MobilePhoneModel")
|
||||
|
||||
|
||||
M("ClientIP", "IPv4NumToString(ClientIP)")
|
||||
M("Resolution", "concat(concat(concat(concat(toString(ResolutionWidth),'x'),toString(ResolutionHeight)),'x'),toString(ResolutionDepth))")
|
||||
M("ResolutionWidthHeight","concat(concat(toString(ResolutionWidth),'x'),toString(ResolutionHeight))")
|
||||
|
||||
|
||||
M("WindowClientArea", "concat(concat(toString(WindowClientWidth),'x'),toString(WindowClientHeight))")
|
||||
|
||||
|
||||
M("UserAgent", "concat(concat(concat(toString(UserAgent), ' '), toString(UserAgentMajor)), UserAgentMinor == 0 ? '' : concat('.', reinterpretAsString(UserAgentMinor)))")
|
||||
M("UserAgentVersion", "concat(toString(UserAgentMajor), UserAgentMinor == 0 ? '' : concat('.', reinterpretAsString(UserAgentMinor)))")
|
||||
M("UserAgentMajor", "concat(concat(toString(UserAgent), ' '), toString(UserAgentMajor))")
|
||||
#undef M
|
||||
#undef M
|
||||
}
|
||||
|
||||
void QueryConverter::fillFormattingAggregatedAttributeMap()
|
||||
|
@ -16,6 +16,7 @@ namespace DB
|
||||
extern const int NOT_FOUND_NODE;
|
||||
extern const int FOUND_MORE_THAN_ONE_NODE;
|
||||
extern const int SYNTAX_ERROR;
|
||||
extern const int UNKNOWN_FORMAT;
|
||||
extern const int FIRST_DATE_IS_BIGGER_THAN_LAST_DATE;
|
||||
extern const int UNKNOWN_OVERFLOW_MODE;
|
||||
extern const int NOT_FOUND_FUNCTION_ELEMENT_FOR_AGGREGATE;
|
||||
|
Loading…
Reference in New Issue
Block a user