Merge pull request #19016 from ClickHouse/fix-ignore-with-lc-arg

Fix `ignore` function with LowCardinality argument
This commit is contained in:
Nikolai Kochetov 2021-01-14 16:50:54 +03:00 committed by GitHub
commit d8b9278193
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View File

@ -30,6 +30,10 @@ public:
bool useDefaultImplementationForNulls() const override { return false; }
/// We should never return LowCardinality result, cause we declare that result is always constant zero.
/// (in getResultIfAlwaysReturnsConstantAndHasArguments)
bool useDefaultImplementationForLowCardinalityColumns() const override { return false; }
String getName() const override
{
return name;

View File

@ -0,0 +1,6 @@
set allow_suspicious_low_cardinality_types = 1;
CREATE TABLE lc_null_int8_defnull (val LowCardinality(Nullable(Int8)) DEFAULT NULL) ENGINE = MergeTree order by tuple();
SELECT ignore(10, ignore(*), ignore(ignore(-2, 1025, *)), NULL, *), * FROM lc_null_int8_defnull AS values;
SELECT ignore(toLowCardinality(1), toLowCardinality(2), 3);