mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 17:20:50 +00:00
Merge pull request #23948 from azat/dict-range-min-max-check
Check MIN/MAX attributes in the list of dictionary attributes
This commit is contained in:
commit
80dbb7ca4f
@ -161,6 +161,13 @@ void buildRangeConfiguration(AutoPtr<Document> doc, AutoPtr<Element> root, const
|
||||
root->appendChild(element);
|
||||
};
|
||||
|
||||
if (!all_attrs.count(range->min_attr_name))
|
||||
throw Exception(ErrorCodes::INCORRECT_DICTIONARY_DEFINITION,
|
||||
"MIN ({}) attribute is not defined in the dictionary attributes", range->min_attr_name);
|
||||
if (!all_attrs.count(range->max_attr_name))
|
||||
throw Exception(ErrorCodes::INCORRECT_DICTIONARY_DEFINITION,
|
||||
"MAX ({}) attribute is not defined in the dictionary attributes", range->max_attr_name);
|
||||
|
||||
append_element("range_min", range->min_attr_name, all_attrs.at(range->min_attr_name));
|
||||
append_element("range_max", range->max_attr_name, all_attrs.at(range->max_attr_name));
|
||||
}
|
||||
|
@ -0,0 +1,11 @@
|
||||
DROP DICTIONARY IF EXISTS dict_01864;
|
||||
CREATE DICTIONARY dict_01864
|
||||
(
|
||||
`id` UInt64,
|
||||
`value` String
|
||||
)
|
||||
PRIMARY KEY id
|
||||
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() TABLE 'does_not_exists'))
|
||||
LIFETIME(MIN 0 MAX 1000)
|
||||
LAYOUT(RANGE_HASHED())
|
||||
RANGE(MIN first MAX last) -- { serverError 489 }
|
Loading…
Reference in New Issue
Block a user