Skip to content

Commit

Permalink
change for complex type from liyang
Browse files Browse the repository at this point in the history
  • Loading branch information
liuneng1994 authored and kyligence-git committed May 17, 2023
1 parent 79af00b commit ad3f78b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Interpreters/ActionsDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ const ActionsDAG::Node & ActionsDAG::addFunction(

auto function_base = function->build(arguments);
return addFunctionImpl(
function,
function_base,
std::move(children),
std::move(arguments),
Expand All @@ -213,6 +214,7 @@ const ActionsDAG::Node & ActionsDAG::addFunction(
auto [arguments, all_const] = getFunctionArguments(children);

return addFunctionImpl(
{},
function.getFunction(),
std::move(children),
std::move(arguments),
Expand All @@ -229,6 +231,7 @@ const ActionsDAG::Node & ActionsDAG::addFunction(
auto [arguments, all_const] = getFunctionArguments(children);

return addFunctionImpl(
{},
function_base,
std::move(children),
std::move(arguments),
Expand All @@ -254,6 +257,7 @@ const ActionsDAG::Node & ActionsDAG::addCast(const Node & node_to_cast, const Da
}

const ActionsDAG::Node & ActionsDAG::addFunctionImpl(
const FunctionOverloadResolverPtr & function,
const FunctionBasePtr & function_base,
NodeRawConstPtrs children,
ColumnsWithTypeAndName arguments,
Expand All @@ -270,6 +274,7 @@ const ActionsDAG::Node & ActionsDAG::addFunctionImpl(
node.function_base = function_base;
node.result_type = result_type;
node.function = node.function_base->prepare(arguments);
node.function->setResolver(function); /// It's needed for spark compatibility.
node.is_deterministic = node.function_base->isDeterministic();

/// If all arguments are constants, and function is suitable to be executed in 'prepare' stage - execute function.
Expand Down Expand Up @@ -2460,6 +2465,7 @@ ActionsDAGPtr ActionsDAG::buildFilterActionsDAG(
auto function_base = function_overload_resolver ? function_overload_resolver->build(arguments) : node->function_base;

result_node = &result_dag->addFunctionImpl(
function_overload_resolver,
function_base,
std::move(function_children),
std::move(arguments),
Expand Down
1 change: 1 addition & 0 deletions src/Interpreters/ActionsDAG.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ class ActionsDAG
Node & addNode(Node node);

const Node & addFunctionImpl(
const FunctionOverloadResolverPtr & function,
const FunctionBasePtr & function_base,
NodeRawConstPtrs children,
ColumnsWithTypeAndName arguments,
Expand Down

0 comments on commit ad3f78b

Please sign in to comment.