Skip to content

Commit

Permalink
fix core for new_json_reader
Browse files Browse the repository at this point in the history
  • Loading branch information
amorynan committed Dec 25, 2024
1 parent f772baa commit 997b59f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions be/src/vec/exec/format/json/new_json_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1657,9 +1657,7 @@ Status NewJsonReader::_simdjson_write_data_to_column(simdjson::ondemand::value&
data_serde = serde->get_nested_serdes()[0];

// kNullType will put 1 into the Null map, so there is no need to push 0 for kNullType.
if (value.type() != simdjson::ondemand::json_type::null) {
nullable_column->get_null_map_data().push_back(0);
} else {
if (value.type() == simdjson::ondemand::json_type::null) {
nullable_column->insert_default();
*valid = true;
return Status::OK();
Expand Down Expand Up @@ -1817,6 +1815,10 @@ Status NewJsonReader::_simdjson_write_data_to_column(simdjson::ondemand::value&
} else {
return Status::InternalError("Not support load to complex column.");
}
// we should set nullmap at last to avoid column_nullable nullmap and data column size not same
if (nullable_column && value.type() != simdjson::ondemand::json_type::null) {
nullable_column->get_null_map_data().push_back(0);
}
*valid = true;
return Status::OK();
}
Expand Down

0 comments on commit 997b59f

Please sign in to comment.