From 1eb1f3028c7e9d7c7429d5fd630016bbd7f10204 Mon Sep 17 00:00:00 2001 From: Maksim Kita Date: Thu, 4 Mar 2021 16:55:05 +0300 Subject: [PATCH] FunctionsExternalDictionaries safe case to ColumnTuple --- src/Functions/FunctionsExternalDictionaries.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Functions/FunctionsExternalDictionaries.h b/src/Functions/FunctionsExternalDictionaries.h index ac59775a755..18b89ff9689 100644 --- a/src/Functions/FunctionsExternalDictionaries.h +++ b/src/Functions/FunctionsExternalDictionaries.h @@ -358,6 +358,13 @@ public: } else if (dictionary_key_type == DictionaryKeyType::complex) { + if (!isTuple(key_col_with_type.type)) + throw Exception( + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, + "Third argument of function ({}) must be tuple when dictionary is complex. Actual type ({}).", + getName(), + key_col_with_type.type->getName()); + /// Functions in external dictionaries_loader only support full-value (not constant) columns with keys. ColumnPtr key_column_full = key_col_with_type.column->convertToFullColumnIfConst();