mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 12:01:58 +00:00
Unwrap LC column in IExecutablefunction::executeWithoutSparseColumns
This commit is contained in:
parent
a3c52f1140
commit
59fbd21024
@ -285,6 +285,8 @@ ColumnPtr IExecutableFunction::executeWithoutSparseColumns(const ColumnsWithType
|
||||
? res->cloneResized(1)->convertToFullColumnIfConst()
|
||||
: res;
|
||||
|
||||
keys = keys->convertToFullColumnIfLowCardinality();
|
||||
|
||||
auto res_mut_dictionary = DataTypeLowCardinality::createColumnUnique(*res_low_cardinality_type->getDictionaryType());
|
||||
ColumnPtr res_indexes = res_mut_dictionary->uniqueInsertRangeFrom(*keys, 0, keys->size());
|
||||
ColumnUniquePtr res_dictionary = std::move(res_mut_dictionary);
|
||||
|
0
tests/integration/test_cte_lc/__init__.py
Normal file
0
tests/integration/test_cte_lc/__init__.py
Normal file
26
tests/integration/test_cte_lc/test.py
Normal file
26
tests/integration/test_cte_lc/test.py
Normal file
@ -0,0 +1,26 @@
|
||||
import pytest
|
||||
from helpers.cluster import ClickHouseCluster
|
||||
|
||||
cluster = ClickHouseCluster(__file__)
|
||||
node = cluster.add_instance("node")
|
||||
|
||||
|
||||
@pytest.fixture(scope="module", autouse=True)
|
||||
def start_cluster():
|
||||
try:
|
||||
cluster.start()
|
||||
yield cluster
|
||||
finally:
|
||||
cluster.shutdown()
|
||||
|
||||
|
||||
def test_lc_of_string(start_cluster):
|
||||
result = node.query("WITH ( SELECT toLowCardinality('a') ) AS bar SELECT bar")
|
||||
|
||||
assert result == 'a\n'
|
||||
|
||||
|
||||
def test_lc_of_int(start_cluster):
|
||||
result = node.query("WITH ( SELECT toLowCardinality(1) ) AS bar SELECT bar")
|
||||
|
||||
assert result == '1\n'
|
Loading…
Reference in New Issue
Block a user