github-actions[bot] commented on code in PR #18051:
URL: https://github.com/apache/doris/pull/18051#discussion_r1168831780
##########
be/src/vec/exec/vaggregation_node.h:
##########
@@ -974,6 +786,44 @@ struct AggregateDataContainer {
bool _inited = false;
};
+struct AggSpillContext {
+ bool has_data = false;
+ bool readers_prepared = false;
+
+ /// stream ids of writers/readers
+ std::vector<int64_t> stream_ids;
+ std::vector<BlockSpillReaderUPtr> readers;
+ RuntimeProfile* runtime_profile;
+
+ size_t read_cursor {};
+
+ Status prepare_for_reading();
+
+ ~AggSpillContext() {
+ for (auto& reader : readers) {
+ if (reader) {
+ reader->close();
+ reader.reset();
+ }
+ }
+ }
+};
+
+struct SpillPartitionHelper {
+ const size_t partition_count_bits;
+ const size_t partition_count;
+ const size_t max_partition_index;
+
+ SpillPartitionHelper(const size_t partition_count_bits_)
+ : partition_count_bits(partition_count_bits_),
+ partition_count(1 << partition_count_bits),
+ max_partition_index(partition_count - 1) {}
+
+ size_t get_index(size_t hash_value) {
+ return (hash_value >> (32 - partition_count_bits)) &
max_partition_index;
+ }
Review Comment:
warning: method 'get_index' can be made const
[readability-make-member-function-const]
```suggestion
size_t get_index(size_t hash_value) const {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]