This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 8c40f04f2ba [Opt](parquet-reader) Opt
`ColumnSelectVector::set_run_length_null_map()` in parquet reader. (#28954)
(#29527)
8c40f04f2ba is described below
commit 8c40f04f2ba0045324ba556fca6fb388d72ebff7
Author: Qi Chen <[email protected]>
AuthorDate: Fri Jan 5 11:13:40 2024 +0800
[Opt](parquet-reader) Opt `ColumnSelectVector::set_run_length_null_map()`
in parquet reader. (#28954) (#29527)
---
be/src/vec/exec/format/parquet/parquet_common.cpp | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/be/src/vec/exec/format/parquet/parquet_common.cpp
b/be/src/vec/exec/format/parquet/parquet_common.cpp
index 46d9ae63af9..cbef2a0f286 100644
--- a/be/src/vec/exec/format/parquet/parquet_common.cpp
+++ b/be/src/vec/exec/format/parquet/parquet_common.cpp
@@ -97,11 +97,17 @@ 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_read);
- for (size_t i = 0; i < num_values; ++i) {
- if (_data_map[i] == CONTENT) {
- map_data_column[null_map_index++] = (UInt8) false;
- } else if (_data_map[i] == NULL_DATA) {
- map_data_column[null_map_index++] = (UInt8) true;
+ if (_num_nulls == 0) {
+ memset(map_data_column.data() + null_map_index, 0, num_read);
+ } else if (_num_nulls == num_values) {
+ memset(map_data_column.data() + null_map_index, 1, num_read);
+ } else {
+ for (size_t i = 0; i < num_values; ++i) {
+ if (_data_map[i] == CONTENT) {
+ map_data_column[null_map_index++] = (UInt8) false;
+ } else if (_data_map[i] == NULL_DATA) {
+ map_data_column[null_map_index++] = (UInt8) true;
+ }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]