This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new 3e89ebf12 KUDU-1261 correct estimate for validity bitmap encoder buffer
3e89ebf12 is described below
commit 3e89ebf12caa2eee0f6bdf0faca32bb7e9caf664
Author: Alexey Serbin <[email protected]>
AuthorDate: Fri Oct 24 10:32:46 2025 -0700
KUDU-1261 correct estimate for validity bitmap encoder buffer
Since the estimate should be for the maximum possible size, it should
assume just a single element per array, not the maximum number of
elements, of course. This changelist corrects the estimation.
This is a follow-up to 18b1930e830609248ee2e26d6216d073ff40ac5d.
Change-Id: Id7fc3c28043be160daa03372009117f5bfaf3d5b
Reviewed-on: http://gerrit.cloudera.org:8080/23593
Reviewed-by: Abhishek Chennaka <[email protected]>
Tested-by: Alexey Serbin <[email protected]>
---
src/kudu/cfile/cfile_writer.cc | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/kudu/cfile/cfile_writer.cc b/src/kudu/cfile/cfile_writer.cc
index 036fcb51e..5a0d84740 100644
--- a/src/kudu/cfile/cfile_writer.cc
+++ b/src/kudu/cfile/cfile_writer.cc
@@ -70,8 +70,6 @@ DEFINE_bool(cfile_support_arrays, true,
"Support encoding/decoding of arrays in CFile data blocks");
TAG_FLAG(cfile_support_arrays, experimental);
-DECLARE_uint32(array_cell_max_elem_num);
-
using google::protobuf::RepeatedPtrField;
using kudu::fs::BlockCreationTransaction;
using kudu::fs::BlockManager;
@@ -276,12 +274,10 @@ Status CFileWriter::Start() {
// case of all cells being single element arrays, and also takes into
// account the possibility of going over the configured size for the
// CFile block (that's why factor 2 appeared below).
- const size_t cell_max_elem_num = FLAGS_array_cell_max_elem_num + 1;
const size_t elem_size = GetArrayElementTypeInfo(*typeinfo_)->size();
const size_t nrows =
(2 * options_.storage_attributes.cfile_block_size + elem_size - 1) /
elem_size;
- array_non_null_bitmap_builder_.reset(new NonNullBitmapBuilder(
- (nrows + cell_max_elem_num - 1) / cell_max_elem_num));
+ array_non_null_bitmap_builder_.reset(new NonNullBitmapBuilder((nrows + 1)
/ 2));
non_null_bitmap_builder_.reset(new NonNullBitmapBuilder(nrows));
array_elem_num_builder_.reset(new ArrayElemNumBuilder(nrows));
} else if (is_nullable_) {