Skip to content

Commit

Permalink
update stringstream to string because there is no complex manipulation
Browse files Browse the repository at this point in the history
  • Loading branch information
llama90 committed May 25, 2024
1 parent 337ffca commit 597439e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cpp/src/arrow/compute/kernels/scalar_cast_string.cc
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,9 @@ struct UnionToStringCastFunctor {
auto child_index = union_type.mode() == UnionMode::DENSE ? offsets[i] : i;
RETURN_NOT_OK(child_span.ToArray()->GetScalar(child_index).Value(&child_scalar));

std::stringstream ss;
ss << "union{" << field->name() << ": " << field->type()->ToString() << " = "
<< child_scalar->ToString() << "}";

RETURN_NOT_OK(builder.Append(ss.str()));
std::string str = "union{" + field->name() + ": " + field->type()->ToString() +
" = " + child_scalar->ToString() + "}";
RETURN_NOT_OK(builder.Append(str));
}

std::shared_ptr<Array> output_array;
Expand Down

0 comments on commit 597439e

Please sign in to comment.