-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GLUTEN-3934][CH]Bug fix log function diff #3935
[GLUTEN-3934][CH]Bug fix log function diff #3935
Conversation
Run Gluten Clickhouse CI |
3 similar comments
Run Gluten Clickhouse CI |
Run Gluten Clickhouse CI |
Run Gluten Clickhouse CI |
bd38343
to
13eaebd
Compare
Run Gluten Clickhouse CI |
auto nullable_result_type = makeNullable(result_type); | ||
|
||
const auto * null_const_node = addColumnToActionsDAG(actions_dag, nullable_result_type, Field()); | ||
const auto * nullable_log_node = ActionsDAGUtil::convertNodeType(actions_dag, log_node, nullable_result_type->getName(), log_node->result_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没必要强转。if函数会处理。
throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "Function {} requires exactly one arguments", getName()); | ||
|
||
const auto * arg_node = parsed_args[0]; | ||
const std::string function_name = getName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getName()返回的是substrait function name, 不是ch function name。这里不能混为一谈
const auto * log_node = toFunctionNode(actions_dag, function_name, {arg_node}); | ||
|
||
auto result_type = log_node->result_type; | ||
auto nullable_result_type = makeNullable(result_type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以合并了,auto nullable_result_type = makeNullable(log_node->result_type);
const auto * null_const_node = addColumnToActionsDAG(actions_dag, nullable_result_type, Field()); | ||
const auto * nullable_log_node = ActionsDAGUtil::convertNodeType(actions_dag, log_node, nullable_result_type->getName(), log_node->result_name); | ||
const DB::Float64 lowerBound = getParameterLowerBoundValue(); | ||
const auto * le_node = toFunctionNode(actions_dag, "lessOrEquals", {arg_node, addColumnToActionsDAG(actions_dag, result_type, lowerBound)}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lowerBound类型错了,应该是 arg_node的类型。
if (x <= c) | ||
null | ||
else | ||
log(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该是 x <= 0, log(x) ?
13eaebd
to
9c2fbb4
Compare
Run Gluten Clickhouse CI |
9c2fbb4
to
8a6dda1
Compare
Fixed done. |
Run Gluten Clickhouse CI |
Run Gluten Clickhouse CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What changes were proposed in this pull request?
(Please fill in changes proposed in this fix)
(Fixes: #3934)
How was this patch tested?
(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
TEST BY UT