Merge pull request #45065 from ClickHouse/fix-low-cardinality-in-nested-lambda-capture

Fix Cannot capture column for nested lambda with LowCardinality
This commit is contained in:
Alexey Milovidov 2023-01-10 04:50:46 +03:00 committed by GitHub
commit d6748f9fae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,8 @@ public:
/// default implementation for Nothing.
/// Example: arrayMap(x -> CAST(x, 'UInt8'), []);
bool useDefaultImplementationForNothing() const override { return false; }
/// Example: SELECT arrayMap(x -> (x + (arrayMap(y -> ((x + y) + toLowCardinality(1)), [])[1])), [])
bool useDefaultImplementationForLowCardinalityColumns() const override { return false; }
private:
ExpressionActionsPtr expression_actions;

View File

@ -9,3 +9,4 @@
[0,2,4,6]
[0,2,4,6,8]
[['a']]
[]

View File

@ -9,3 +9,5 @@ CREATE TABLE test_array(resources_host Array(LowCardinality(String))) ENGINE = M
insert into test_array values (['a']);
SELECT arrayMap(i -> [resources_host[i]], arrayEnumerate(resources_host)) FROM test_array;
drop table if exists test_array;
SELECT arrayMap(x -> (x + (arrayMap(y -> ((x + y) + toLowCardinality(1)), [])[1])), []);