Skip to content

Commit

Permalink
throw exception instead of CHECK
Browse files Browse the repository at this point in the history
  • Loading branch information
eldenmoon committed Dec 20, 2023
1 parent 10a6e70 commit 26b5725
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions be/src/vec/columns/column_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,8 +1161,14 @@ void ColumnObject::merge_sparse_to_root_column() {
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
root.Accept(writer);
bool res = parser.parse(buffer.GetString(), buffer.GetSize());
CHECK(res) << "buffer:" << std::string(buffer.GetString(), buffer.GetSize())
<< ", row_num:" << i;
if (!res) {
throw Exception(ErrorCode::INVALID_ARGUMENT,
"parse json failed, doc: {}"
", row_num:{}"
", error:{}",
std::string(buffer.GetString(), buffer.GetSize()), i,
JsonbErrMsg::getErrMsg(parser.getErrorCode()));
}
result_column_ptr->insert_data(parser.getWriter().getOutput()->getBuffer(),
parser.getWriter().getOutput()->getSize());
result_column_nullable->get_null_map_data().push_back(0);
Expand Down

0 comments on commit 26b5725

Please sign in to comment.