mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-09 17:14:47 +00:00
[rev 2] Fix review notes
This commit is contained in:
parent
afada0ecb3
commit
42549e89f2
@ -25,8 +25,8 @@
|
||||
</id>
|
||||
|
||||
<attribute>
|
||||
<name>bad_attr</name>
|
||||
<type>bad_type</type>
|
||||
<name>invalid_attr</name>
|
||||
<type>invalid_type</type>
|
||||
<null_value></null_value>
|
||||
<hierarchical>false</hierarchical>
|
||||
<injective>false</injective>
|
@ -12,7 +12,7 @@ cluster = ClickHouseCluster(__file__)
|
||||
instance = cluster.add_instance("instance", dictionaries=DICTIONARY_FILES)
|
||||
|
||||
VALID_DICT_NAME = "valid_dict"
|
||||
BAD_DICT_NAME = "invalid_dict"
|
||||
INVALID_DICT_NAME = "invalid_dict"
|
||||
UNKNOWN_DATA_TYPE_EXCEPTION_STR = "DB::Exception: Unknown data type"
|
||||
|
||||
|
||||
@ -25,12 +25,12 @@ def started_cluster():
|
||||
cluster.shutdown()
|
||||
|
||||
|
||||
def test_select_from_system_dictionaries_with_bad_dictionary(started_cluster):
|
||||
def test_select_from_system_dictionaries_with_invalid_dictionary(started_cluster):
|
||||
query = instance.query
|
||||
|
||||
assert query("SELECT name FROM system.dictionaries;").splitlines() == [
|
||||
VALID_DICT_NAME,
|
||||
BAD_DICT_NAME,
|
||||
INVALID_DICT_NAME,
|
||||
]
|
||||
|
||||
assert (
|
||||
@ -43,14 +43,16 @@ def test_select_from_system_dictionaries_with_bad_dictionary(started_cluster):
|
||||
assert (
|
||||
UNKNOWN_DATA_TYPE_EXCEPTION_STR
|
||||
in query(
|
||||
f"select last_exception from system.dictionaries WHERE name='{BAD_DICT_NAME}';"
|
||||
f"select last_exception from system.dictionaries WHERE name='{INVALID_DICT_NAME}';"
|
||||
).strip()
|
||||
)
|
||||
|
||||
|
||||
def test_dictGet_func_for_bad_dictionary(started_cluster):
|
||||
def test_dictGet_func_for_invalid_dictionary(started_cluster):
|
||||
query = instance.query
|
||||
|
||||
with pytest.raises(QueryRuntimeException) as exc:
|
||||
query(f"SELECT dictGetString('{BAD_DICT_NAME}', 'bad_attr', toInt64(1));")
|
||||
query(
|
||||
f"SELECT dictGetString('{INVALID_DICT_NAME}', 'invalid_attr', toInt64(1));"
|
||||
)
|
||||
assert UNKNOWN_DATA_TYPE_EXCEPTION_STR in str(exc.value)
|
Loading…
Reference in New Issue
Block a user