Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
bobhan1 committed Nov 13, 2024
1 parent 5d99f2b commit 100bceb
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions be/src/exec/tablet_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "exec/tablet_info.h"

#include <butil/logging.h>
#include <gen_cpp/Descriptors_types.h>
#include <gen_cpp/Exprs_types.h>
#include <gen_cpp/Partitions_types.h>
Expand Down Expand Up @@ -180,6 +181,17 @@ Status OlapTableSchemaParam::init(const POlapTableSchemaParam& pschema) {
auto it = slots_map.find(to_lower(pcolumn_desc.name()) + "+" + data_type_str +
is_null_str);
if (it == std::end(slots_map)) {
std::string keys {};
for (const auto& [key, _] : slots_map) {
keys += fmt::format("{},", key);
}
LOG_EVERY_SECOND(WARNING) << fmt::format(
"[OlapTableSchemaParam::init(const POlapTableSchemaParam& pschema)]: "
"unknown index column, column={}, type={}, data_type_str={}, "
"is_null_str={}, slots_map.keys()=[{}], {}\npschema={}",
pcolumn_desc.name(), pcolumn_desc.type(), data_type_str, is_null_str,
keys, debug_string(), pschema.DebugString());

return Status::InternalError("unknown index column, column={}, type={}",
pcolumn_desc.name(), pcolumn_desc.type());
}
Expand Down Expand Up @@ -286,6 +298,18 @@ Status OlapTableSchemaParam::init(const TOlapTableSchemaParam& tschema) {
auto it = slots_map.find(to_lower(tcolumn_desc.column_name) + "+" + data_type_str +
is_null_str);
if (it == slots_map.end()) {
std::stringstream ss;
ss << tschema;
std::string keys {};
for (const auto& [key, _] : slots_map) {
keys += fmt::format("{},", key);
}
LOG_EVERY_SECOND(WARNING) << fmt::format(
"[OlapTableSchemaParam::init(const TOlapTableSchemaParam& tschema)]: "
"unknown index column, column={}, type={}, data_type_str={}, "
"is_null_str={}, slots_map.keys()=[{}], {}\ntschema={}",
tcolumn_desc.column_name, tcolumn_desc.column_type.type, data_type_str,
is_null_str, keys, debug_string(), ss.str());
return Status::InternalError("unknown index column, column={}, type={}",
tcolumn_desc.column_name,
tcolumn_desc.column_type.type);
Expand Down

0 comments on commit 100bceb

Please sign in to comment.