Skip to content

Commit

Permalink
[Fix](json reader) fix json reader crash due to fmt::format_to (#28737
Browse files Browse the repository at this point in the history
)

```
4# __gnu_cxx::__verbose_terminate_handler() [clone .cold] at ../../../../libstdc++-v3/libsupc++/vterminate.cc:75
5# __cxxabiv1::__terminate(void (*)()) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48
6# 0x00005622F33D22B1 in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be
7# 0x00005622F33D2404 in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be
8# fmt::v7::detail::error_handler::on_error(char const*) in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be
9# char const* fmt::v7::detail::parse_replacement_field<char, fmt::v7::detail::format_handler<fmt::v7::detail::buffer_appender<char>, char, fmt::v7::basic_format_context<fmt::v7::detail::buffer_appender<char>, char> >&>(char const*, char const*, fmt::v7::detail::format_handler<fmt::v7::detail::buffer_appender<char>, char, fmt::v7::basic_format_context<fmt::v7::detail::buffer_appender<char>, char> >&) in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be
10# void fmt::v7::detail::vformat_to<char>(fmt::v7::detail::buffer<char>&, fmt::v7::basic_string_view<char>, fmt::v7::basic_format_args<fmt::v7::basic_format_context<fmt::v7::detail::buffer_appender<fmt::v7::type_identity<char>::type>, fmt::v7::type_identity<char>::type> >, fmt::v7::detail::locale_ref) in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be
11# doris::vectorized::NewJsonReader::_append_error_msg(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool*) at /root/doris/be/src/vec/exec/format/json/new_json_reader.cpp:924
12# doris::vectorized::NewJsonReader::_set_column_value
```
  • Loading branch information
eldenmoon authored Dec 20, 2023
1 parent ea646c6 commit 3685700
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 9 additions & 6 deletions be/src/vec/exec/format/json/new_json_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,9 @@ Status NewJsonReader::_set_column_value(rapidjson::Value& objectValue, Block& bl
}
RETURN_IF_ERROR(_append_error_msg(objectValue,
"There is no column matching jsonpaths in the json file, "
"columns:[{}], jsonpaths:{}, please check columns "
"and jsonpaths",
"columns:[{}], lease check columns "
"and jsonpaths:" +
_jsonpaths,
col_names, valid));
return Status::OK();
}
Expand Down Expand Up @@ -1345,8 +1346,9 @@ Status NewJsonReader::_simdjson_set_column_value(simdjson::ondemand::object* val
}
RETURN_IF_ERROR(_append_error_msg(value,
"There is no column matching jsonpaths in the json file, "
"columns:[{}], jsonpaths:{}, please check columns "
"and jsonpaths",
"columns:[{}], please check columns "
"and jsonpaths:" +
_jsonpaths,
col_names, valid));
return Status::OK();
}
Expand Down Expand Up @@ -1660,8 +1662,9 @@ Status NewJsonReader::_simdjson_write_columns_by_jsonpath(
}
RETURN_IF_ERROR(_append_error_msg(value,
"There is no column matching jsonpaths in the json file, "
"columns:[{}], jsonpaths:{}, please check columns "
"and jsonpaths",
"columns:[{}], please check columns "
"and jsonpaths:" +
_jsonpaths,
col_names, valid));
return Status::OK();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ suite("test_json_load", "p0") {
def code = process.waitFor()
def out = process.text
log.info("result: ${out}".toString())
def reason = "Reason: There is no column matching jsonpaths in the json file, columns:[name, age, agent_id, ], jsonpaths:[\"Name\", \"Age\", \"Agent_id\"], please check columns and jsonpaths. src line [{\"name\":\"Name1\",\"age\":21,\"agent_id\":\"1\"}]; \n"
def reason = "Reason: There is no column matching jsonpaths in the json file, columns:[name, age, agent_id, ], please check columns and jsonpaths:[\"Name\", \"Age\", \"Agent_id\"]. src line [{\"name\":\"Name1\",\"age\":21,\"agent_id\":\"1\"}]; \n"
assertEquals("${reason}", "${out}")
}
}
Expand Down Expand Up @@ -790,7 +790,7 @@ suite("test_json_load", "p0") {
def code = process.waitFor()
def out = process.text
log.info("result: ${out}".toString())
def reason = "Reason: There is no column matching jsonpaths in the json file, columns:[Name, Age, Agent_id, ], jsonpaths:, please check columns and jsonpaths. src line [{\"name\":\"Name1\",\"age\":21,\"agent_id\":\"1\"}]; \n"
def reason = "Reason: There is no column matching jsonpaths in the json file, columns:[Name, Age, Agent_id, ], please check columns and jsonpaths:. src line [{\"name\":\"Name1\",\"age\":21,\"agent_id\":\"1\"}]; \n"
assertEquals("${reason}", "${out}")
}
}
Expand Down

0 comments on commit 3685700

Please sign in to comment.