Skip to content

Commit

Permalink
[Opt](multi-catalog) Opt parquet orc reader numeric copy by `memcpy()…
Browse files Browse the repository at this point in the history
…` and `memset()`.
  • Loading branch information
kaka11chen committed Nov 26, 2023
1 parent dfe3a2d commit 3f353a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions be/src/vec/exec/format/orc/vorc_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1261,9 +1261,7 @@ Status OrcReader::_orc_column_to_doris_column(const std::string& col_name,
map_data_column[origin_size + i] = !cvb_nulls[i];
}
} else {
for (int i = 0; i < num_values; ++i) {
map_data_column[origin_size + i] = false;
}
memset(map_data_column.data() + origin_size, 0, num_values);
}
} else {
if (cvb->hasNulls) {
Expand Down
11 changes: 5 additions & 6 deletions be/src/vec/exec/format/parquet/parquet_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,15 @@ void ColumnSelectVector::set_run_length_null_map(const std::vector<uint16_t>& ru
NullMap& map_data_column = *null_map;
auto null_map_index = map_data_column.size();
map_data_column.resize(null_map_index + num_values);

for (auto& run_length : run_length_null_map) {
if (is_null) {
memset(map_data_column.data() + null_map_index, 1, run_length);
null_map_index += run_length;
_num_nulls += run_length;
for (int i = 0; i < run_length; ++i) {
map_data_column[null_map_index++] = 1;
}
} else {
for (int i = 0; i < run_length; ++i) {
map_data_column[null_map_index++] = 0;
}
memset(map_data_column.data() + null_map_index, 0, run_length);
null_map_index += run_length;
}
is_null = !is_null;
}
Expand Down

0 comments on commit 3f353a8

Please sign in to comment.