Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions be/src/vec/data_types/serde/data_type_array_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ Status DataTypeArraySerDe::_write_column_to_mysql(const IColumn& column,
return Status::InternalError("pack mysql buffer failed.");
}
} else {
++options.level;
if (is_nested_string && options.wrapper_len > 0) {
if (0 != result.push_string(options.nested_string_wrapper, options.wrapper_len)) {
return Status::InternalError("pack mysql buffer failed.");
Expand All @@ -355,7 +354,6 @@ Status DataTypeArraySerDe::_write_column_to_mysql(const IColumn& column,
RETURN_IF_ERROR(
nested_serde->write_column_to_mysql(data, result, j, false, options));
}
--options.level;
}
}
if (0 != result.push_string("]", 1)) {
Expand Down
4 changes: 0 additions & 4 deletions be/src/vec/data_types/serde/data_type_map_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ Status DataTypeMapSerDe::_write_column_to_mysql(const IColumn& column,
return Status::InternalError("pack mysql buffer failed.");
}
} else {
++options.level;
if (is_key_string && options.wrapper_len > 0) {
if (0 != result.push_string(options.nested_string_wrapper, options.wrapper_len)) {
return Status::InternalError("pack mysql buffer failed.");
Expand All @@ -443,7 +442,6 @@ Status DataTypeMapSerDe::_write_column_to_mysql(const IColumn& column,
RETURN_IF_ERROR(key_serde->write_column_to_mysql(nested_keys_column, result, j,
false, options));
}
--options.level;
}
if (0 != result.push_string(&options.map_key_delim, 1)) {
return Status::InternalError("pack mysql buffer failed.");
Expand All @@ -453,7 +451,6 @@ Status DataTypeMapSerDe::_write_column_to_mysql(const IColumn& column,
return Status::InternalError("pack mysql buffer failed.");
}
} else {
++options.level;
if (is_val_string && options.wrapper_len > 0) {
if (0 != result.push_string(options.nested_string_wrapper, options.wrapper_len)) {
return Status::InternalError("pack mysql buffer failed.");
Expand All @@ -467,7 +464,6 @@ Status DataTypeMapSerDe::_write_column_to_mysql(const IColumn& column,
RETURN_IF_ERROR(value_serde->write_column_to_mysql(nested_values_column, result, j,
false, options));
}
--options.level;
}
}
if (0 != result.push_string("}", 1)) {
Expand Down
2 changes: 1 addition & 1 deletion be/src/vec/data_types/serde/data_type_number_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ Status DataTypeNumberSerDe<T>::_write_column_to_mysql(const IColumn& column,
if constexpr (std::is_same_v<T, Int8>) {
buf_ret = result.push_tinyint(data[col_index]);
} else if constexpr (std::is_same_v<T, UInt8>) {
if (options.level > 0 && !options.is_bool_value_num) {
if (_nesting_level > 1 && !options.is_bool_value_num) {
std::string bool_value = data[col_index] ? "true" : "false";
result.push_string(bool_value.c_str(), bool_value.size());
} else {
Expand Down
5 changes: 0 additions & 5 deletions be/src/vec/data_types/serde/data_type_serde.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,6 @@ class DataTypeSerDe {
*/
bool is_bool_value_num = true;

/**
* Indicate the nested level of column. It is used to control some behavior of serde
*/
mutable int level = 0;

[[nodiscard]] char get_collection_delimiter(
int hive_text_complex_type_delimiter_level) const {
CHECK(0 <= hive_text_complex_type_delimiter_level &&
Expand Down
2 changes: 0 additions & 2 deletions be/src/vec/data_types/serde/data_type_struct_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ Status DataTypeStructSerDe::_write_column_to_mysql(const IColumn& column,
return Status::InternalError("pack mysql buffer failed.");
}
} else {
++options.level;
if (remove_nullable(col.get_column_ptr(j))->is_column_string() &&
options.wrapper_len > 0) {
if (0 != result.push_string(options.nested_string_wrapper, options.wrapper_len)) {
Expand All @@ -397,7 +396,6 @@ Status DataTypeStructSerDe::_write_column_to_mysql(const IColumn& column,
RETURN_IF_ERROR(elem_serdes_ptrs[j]->write_column_to_mysql(
col.get_column(j), result, col_index, false, options));
}
--options.level;
}
begin = false;
}
Expand Down
Loading