mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
ExecutableUserDefinedFunction fix usage in GROUP BY
This commit is contained in:
parent
dd93d5d872
commit
397603e9be
@ -21,6 +21,7 @@
|
|||||||
#include <Interpreters/Context.h>
|
#include <Interpreters/Context.h>
|
||||||
#include <Interpreters/ExternalDictionariesLoader.h>
|
#include <Interpreters/ExternalDictionariesLoader.h>
|
||||||
#include <Interpreters/GatherFunctionQuantileVisitor.h>
|
#include <Interpreters/GatherFunctionQuantileVisitor.h>
|
||||||
|
#include <Interpreters/UserDefinedExecutableFunctionFactory.h>
|
||||||
|
|
||||||
#include <Parsers/ASTExpressionList.h>
|
#include <Parsers/ASTExpressionList.h>
|
||||||
#include <Parsers/ASTFunction.h>
|
#include <Parsers/ASTFunction.h>
|
||||||
@ -138,11 +139,19 @@ void optimizeGroupBy(ASTSelectQuery * select_query, ContextPtr context)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!function_factory.get(function->name, context)->isInjective({}))
|
else
|
||||||
|
{
|
||||||
|
FunctionOverloadResolverPtr function_builder = UserDefinedExecutableFunctionFactory::instance().tryGet(function->name, context);
|
||||||
|
|
||||||
|
if (!function_builder)
|
||||||
|
function_builder = function_factory.get(function->name, context);
|
||||||
|
|
||||||
|
if (function_builder->isInjective({}))
|
||||||
{
|
{
|
||||||
++i;
|
++i;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// copy shared pointer to args in order to ensure lifetime
|
/// copy shared pointer to args in order to ensure lifetime
|
||||||
auto args_ast = function->arguments;
|
auto args_ast = function->arguments;
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
0
|
||||||
|
2
|
||||||
|
4
|
||||||
|
6
|
||||||
|
8
|
||||||
|
10
|
||||||
|
12
|
||||||
|
14
|
||||||
|
16
|
||||||
|
18
|
@ -0,0 +1 @@
|
|||||||
|
SELECT test_function(number, number) as a FROM numbers(10) GROUP BY a ORDER BY a;
|
Loading…
Reference in New Issue
Block a user