| 930 | } |
| 931 | |
| 932 | void rerunFunctionResolve(FunctionNode * function_node, ContextPtr context) |
| 933 | { |
| 934 | if (!function_node->isResolved()) |
| 935 | throw Exception(ErrorCodes::LOGICAL_ERROR, "Trying to rerun resolve of unresolved function '{}'", function_node->getFunctionName()); |
| 936 | |
| 937 | const auto & name = function_node->getFunctionName(); |
| 938 | if (function_node->isOrdinaryFunction()) |
| 939 | { |
| 940 | // Special case, don't need to be resolved. It must be processed by GroupingFunctionsResolvePass. |
| 941 | if (name == "grouping") |
| 942 | return; |
| 943 | auto function = FunctionFactory::instance().get(name, context); |
| 944 | function_node->resolveAsFunction(function->build(function_node->getArgumentColumns())); |
| 945 | } |
| 946 | else if (function_node->isAggregateFunction()) |
| 947 | { |
| 948 | if (name == "nothing" || name == "nothingUInt64" || name == "nothingNull") |
| 949 | return; |
| 950 | function_node->resolveAsAggregateFunction(resolveAggregateFunction(*function_node, function_node->getFunctionName())); |
| 951 | } |
| 952 | else if (function_node->isWindowFunction()) |
| 953 | { |
| 954 | function_node->resolveAsWindowFunction(resolveAggregateFunction(*function_node, function_node->getFunctionName())); |
| 955 | } |
| 956 | } |
| 957 | |
| 958 | namespace |
| 959 | { |
no test coverage detected