Anubhav Jindal has posted comments on this change. ( 
https://gerrit.cloudera.org/25371 )

Change subject: IMPALA-13488: Make CollectionValueBuilder initial capacity 
configurable
......................................................................


Patch Set 1:

(8 comments)

https://gerrit.cloudera.org/#/c/25371/1//COMMIT_MSG
Commit Message:

https://gerrit.cloudera.org/#/c/25371/1//COMMIT_MSG@9
PS1, Line 9: CollectionValueBuilder currently uses a hardcoded initial tuple 
capacity of 4 when allocating memory for collection values.
nit: could the body be wrapped at around 72 characters? A "Testing:" section 
would also be nice once tests are added.


https://gerrit.cloudera.org/#/c/25371/1/be/src/runtime/collection-value-builder.h
File be/src/runtime/collection-value-builder.h:

https://gerrit.cloudera.org/#/c/25371/1/be/src/runtime/collection-value-builder.h@37
PS1, Line 37: CollectionValueBuilder(
nit: the constructors lost their indentation inside the class. Running 
clang-format with the repo's .clang-format should fix it.


https://gerrit.cloudera.org/#/c/25371/1/be/src/runtime/collection-value-builder.h@58
PS1, Line 58:   buffer_size_ = initial_tuple_capacity * tuple_desc_.byte_size();
With the value now coming from the user, it might be good to add a 
DCHECK_GT(initial_tuple_capacity, 0) here, alongside the range check in 
query-options.cc.


https://gerrit.cloudera.org/#/c/25371/1/be/src/service/query-options.h
File be/src/service/query-options.h:

https://gerrit.cloudera.org/#/c/25371/1/be/src/service/query-options.h@335
PS1, Line 335:   QUERY_OPT_FN(collection_value_builder_initial_tuple_capacity,  
                        \
A couple of related things are needed for a new option:
- a matching case in query-options.cc to parse the value. Without it, setting 
the option hits "Missing exec option implementation". It would be good to add a 
range check there too, for example ParseAndCheckInclusiveRange<int64_t> with a 
minimum of 1 and a reasonable maximum.
- updating NUM_QUERY_OPTIONS near the top of this file to the new last option, 
otherwise the DCHECK on the option count will fail at startup.


https://gerrit.cloudera.org/#/c/25371/1/common/thrift/ImpalaService.thrift
File common/thrift/ImpalaService.thrift:

https://gerrit.cloudera.org/#/c/25371/1/common/thrift/ImpalaService.thrift@944
PS1, Line 944:   // Initial tuple capacity for CollectionValueBuilder.
Could this comment explain a bit more for users? For example: the number of 
items to allocate space for when building each collection, the default, and 
that larger values can reduce reallocations but use more memory.


https://gerrit.cloudera.org/#/c/25371/1/common/thrift/ImpalaService.thrift@946
PS1, Line 946:   COLLECTION_VALUE_BUILDER_INITIAL_TUPLE_CAPACITY = 
<NEW_ENUM_VALUE>
I think a placeholder was left here, so the Thrift build will fail. After 
rebasing onto the latest master, the next free value should be 207


https://gerrit.cloudera.org/#/c/25371/1/common/thrift/Query.thrift
File common/thrift/Query.thrift:

https://gerrit.cloudera.org/#/c/25371/1/common/thrift/Query.thrift@733
PS1, Line 733:   // Initial tuple capacity used by CollectionValueBuilder when 
allocating 
nit: trailing whitespace here.


https://gerrit.cloudera.org/#/c/25371/1/common/thrift/Query.thrift@735
PS1, Line 735:   180: optional i64 
collection_value_builder_initial_tuple_capacity = 4;
Field 180 is already used on master (use_null_slots_cache), so after rebasing 
this should probably be 208.



--
To view, visit https://gerrit.cloudera.org/25371
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5affbbb31c3bd0508e50501a05688ab1ee8a9503
Gerrit-Change-Number: 25371
Gerrit-PatchSet: 1
Gerrit-Owner: Anshula Jain <[email protected]>
Gerrit-Reviewer: Anubhav Jindal <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Comment-Date: Wed, 25 Nov 2026 22:34:19 +0000
Gerrit-HasComments: Yes

Reply via email to