From ef7d19e1433f18420f724c5418be87fa2330a160 Mon Sep 17 00:00:00 2001 From: chertus Date: Mon, 5 Aug 2019 17:03:14 +0300 Subject: [PATCH] better JOIN exception messages #5565 --- dbms/src/Common/ErrorCodes.cpp | 2 +- dbms/src/Interpreters/Join.cpp | 7 ++++--- dbms/src/Interpreters/SetVariants.cpp | 1 - dbms/src/Storages/StorageJoin.cpp | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dbms/src/Common/ErrorCodes.cpp b/dbms/src/Common/ErrorCodes.cpp index 56598aa2e89..cd4601e5b3d 100644 --- a/dbms/src/Common/ErrorCodes.cpp +++ b/dbms/src/Common/ErrorCodes.cpp @@ -127,7 +127,7 @@ namespace ErrorCodes extern const int INCORRECT_DATA = 117; 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 UNSUPPORTED_JOIN_KEYS = 121; extern const int INCOMPATIBLE_COLUMNS = 122; extern const int UNKNOWN_TYPE_OF_AST_NODE = 123; extern const int INCORRECT_ELEMENT_OF_SET = 124; diff --git a/dbms/src/Interpreters/Join.cpp b/dbms/src/Interpreters/Join.cpp index ccd5e76161b..9f1a69fba70 100644 --- a/dbms/src/Interpreters/Join.cpp +++ b/dbms/src/Interpreters/Join.cpp @@ -26,7 +26,7 @@ namespace DB namespace ErrorCodes { - extern const int UNKNOWN_SET_DATA_VARIANT; + extern const int UNSUPPORTED_JOIN_KEYS; extern const int LOGICAL_ERROR; extern const int SET_SIZE_LIMIT_EXCEEDED; extern const int TYPE_MISMATCH; @@ -770,7 +770,7 @@ IColumn::Filter switchJoinRightColumns( #undef M default: - throw Exception("Unknown JOIN keys variant.", ErrorCodes::UNKNOWN_SET_DATA_VARIANT); + throw Exception("Unsupported JOIN keys. Type: " + toString(static_cast(type)), ErrorCodes::UNSUPPORTED_JOIN_KEYS); } } @@ -1350,7 +1350,8 @@ private: APPLY_FOR_JOIN_VARIANTS(M) #undef M default: - throw Exception("Unknown JOIN keys variant.", ErrorCodes::UNKNOWN_SET_DATA_VARIANT); + throw Exception("Unsupported JOIN keys. Type: " + toString(static_cast(parent.type)), + ErrorCodes::UNSUPPORTED_JOIN_KEYS); } __builtin_unreachable(); diff --git a/dbms/src/Interpreters/SetVariants.cpp b/dbms/src/Interpreters/SetVariants.cpp index 8b5e8fbc984..281304f886e 100644 --- a/dbms/src/Interpreters/SetVariants.cpp +++ b/dbms/src/Interpreters/SetVariants.cpp @@ -8,7 +8,6 @@ namespace DB namespace ErrorCodes { - extern const int UNKNOWN_SET_DATA_VARIANT; extern const int LOGICAL_ERROR; } diff --git a/dbms/src/Storages/StorageJoin.cpp b/dbms/src/Storages/StorageJoin.cpp index 8a38c6fa8ff..3c90917b0f6 100644 --- a/dbms/src/Storages/StorageJoin.cpp +++ b/dbms/src/Storages/StorageJoin.cpp @@ -18,7 +18,7 @@ namespace DB namespace ErrorCodes { - extern const int UNKNOWN_SET_DATA_VARIANT; + extern const int UNSUPPORTED_JOIN_KEYS; extern const int NO_SUCH_COLUMN_IN_TABLE; extern const int INCOMPATIBLE_TYPE_OF_JOIN; extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; @@ -285,7 +285,8 @@ private: #undef M default: - throw Exception("Unknown JOIN keys variant for limited use", ErrorCodes::UNKNOWN_SET_DATA_VARIANT); + throw Exception("Unsupported JOIN keys in StorageJoin. Type: " + toString(static_cast(parent.type)), + ErrorCodes::UNSUPPORTED_JOIN_KEYS); } if (!rows_added)