Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Zhou <[email protected]>
  • Loading branch information
zhouyuan committed Mar 18, 2021
1 parent a33f069 commit f42384d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,8 @@ arrow::Status ExpressionCodegenVisitor::Visit(const gandiva::FunctionNode& node)
} else {
auto childNode = node.children().at(0);
auto childType =
std::dynamic_pointer_cast<arrow::Decimal128Type>(childNode->return_type());
fix_ss << "round(" << child_visitor_list[0]->GetResult() << ", "
std::dynamic_pointer_cast<arrow::Decimal128Type>(childNode->return_type());
fix_ss << "round(" << child_visitor_list[0]->GetResult() << ", "
<< childType->precision() << ", " << childType->scale() << ", &overflow";
}
if (child_visitor_list.size() > 1) {
Expand Down
11 changes: 4 additions & 7 deletions native-sql-engine/cpp/src/precompile/gandiva.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,12 @@ bool equal_with_nan(double left, double right) {
return left == right;
}

arrow::Decimal128 round(arrow::Decimal128 in,
int32_t original_precision,
int32_t original_scale,
bool* overflow_,
int32_t res_scale = 2) {
arrow::Decimal128 round(arrow::Decimal128 in, int32_t original_precision,
int32_t original_scale, bool* overflow_, int32_t res_scale = 2) {
bool overflow = false;
gandiva::BasicDecimalScalar128 val(in, original_precision, original_scale);
auto out = gandiva::decimalops::Round(val, original_precision, res_scale,
res_scale, &overflow);
auto out = gandiva::decimalops::Round(val, original_precision, res_scale, res_scale,
&overflow);
if (overflow) {
*overflow_ = true;
}
Expand Down

0 comments on commit f42384d

Please sign in to comment.