mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
ISSUES-4389 fix lambda function with predicate optimizer
This commit is contained in:
parent
ed3a8a66a2
commit
597ae0b937
@ -119,8 +119,10 @@ bool PredicateExpressionsOptimizer::allowPushDown(const ASTSelectQuery * subquer
|
||||
|
||||
for (const auto & subquery_function : extract_data.functions)
|
||||
{
|
||||
const auto & function = FunctionFactory::instance().get(subquery_function->name, context);
|
||||
if (function->isStateful())
|
||||
const auto & function = FunctionFactory::instance().tryGet(subquery_function->name, context);
|
||||
|
||||
/// Skip lambda、tuple and other special functions
|
||||
if (function && function->isStateful())
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -7,3 +7,6 @@
|
||||
1 a 0
|
||||
2 b 0
|
||||
2 a 0
|
||||
(1,1)
|
||||
(3,2)
|
||||
(5,2)
|
||||
|
@ -29,4 +29,11 @@ SELECT n, z, changed FROM (
|
||||
)
|
||||
) WHERE changed = 0;
|
||||
|
||||
|
||||
SELECT arrayJoin(arrayMap(x -> x, arraySort(groupArray((ts, n))))) AS k FROM (
|
||||
SELECT ts, n, z FROM system.one ARRAY JOIN [1, 3, 4, 5, 6] AS ts, [1, 2, 2, 2, 1] AS n, ['a', 'a', 'b', 'a', 'b'] AS z
|
||||
ORDER BY n ASC, ts DESC
|
||||
) WHERE z = 'a' GROUP BY z;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS test.test;
|
||||
|
Loading…
Reference in New Issue
Block a user