Coverage Report

Created: 2026-11-01 07:44

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exprs/aggregate/aggregate_function_topk.h
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#pragma once
19
20
#include <algorithm>
21
#include <atomic>
22
#include <cstdint>
23
#include <limits>
24
#include <memory>
25
#include <random>
26
#include <type_traits>
27
#include <utility>
28
29
#include "common/check.h"
30
#include "common/compare.h"
31
#include "common/exception.h"
32
#include "core/assert_cast.h"
33
#include "core/column/column.h"
34
#include "core/column/column_array.h"
35
#include "core/column/column_decimal.h"
36
#include "core/column/column_nullable.h"
37
#include "core/column/column_string.h"
38
#include "core/column/column_struct.h"
39
#include "core/column/column_vector.h"
40
#include "core/custom_allocator.h"
41
#include "core/data_type/data_type.h"
42
#include "core/data_type/data_type_array.h"
43
#include "core/data_type/data_type_nullable.h"
44
#include "core/data_type/data_type_number.h"
45
#include "core/data_type/data_type_struct.h"
46
#include "core/data_type/primitive_type.h"
47
#include "core/memcmp_small.h"
48
#include "core/pod_array.h"
49
#include "core/string_buffer.hpp"
50
#include "core/string_ref.h"
51
#include "core/types.h"
52
#include "exprs/aggregate/aggregate_function.h"
53
54
namespace doris {
55
56
/// A string payload's position in its state's arena.
57
struct StringSpan {
58
    size_t offset = 0;
59
    size_t length = 0;
60
};
61
62
/// The bytes of one group's string values. A StringRef cannot be stored in a slot: the arena
63
/// reallocates and would invalidate the pointers, so a slot keeps a span instead and materializes a
64
/// view on access. Fixed-width value types inherit EmptyTopKArena instead, so this costs them
65
/// nothing.
66
struct StringTopKArena {
67
    /// The initial allocation is small on purpose: the arena grows with the bytes actually retained,
68
    /// unlike a Doris column's container, whose PaddedPODArray allocates a 4 KiB initial chunk as
69
    /// soon as it holds one value.
70
    /// PaddedPODArray, not PODArray: comparisons go through memcmp_small_allow_overflow15, which
71
    /// loads a full 16-byte vector even for a one-byte string, the same tail allowance
72
    /// ColumnString's chars buffer provides.
73
    PaddedPODArray<char, 32> bytes;
74
    // Sum of the live slots' payload and of the payload evicted since the last compaction. The
75
    // slot counters alone cannot bound the memory: replacing 1024 1 MiB strings with short ones
76
    // leaves dead == live by slot count while ~1 GiB of discarded bytes stay in the arena.
77
    size_t live_payload_bytes = 0;
78
    size_t dead_payload_bytes = 0;
79
};
80
81
/// The payload holder of a fixed-width value type: its values live in their slots, so its states
82
/// own no arena at all.
83
struct EmptyTopKArena {};
84
85
/// A per-state seed for the treap priorities. A fixed sequence is predictable from the input: an
86
/// adversarial input can feed the n-th generated priority as the n-th smallest value, making the
87
/// value order match the priority order and turning the treap into a chain of depth n. The
88
/// process-random base and the counter keep the sequence independent of the data.
89
541
inline uint32_t next_topk_priority_seed() {
90
541
    static std::atomic<uint32_t> counter {0};
91
541
    static const uint32_t base = [] {
92
2
        std::random_device device;
93
2
        return static_cast<uint32_t>(device());
94
2
    }();
95
541
    uint32_t z = base + counter.fetch_add(1, std::memory_order_relaxed) * 0x9E3779B9U;
96
541
    z = (z ^ (z >> 16)) * 0x21F0AAADU;
97
541
    z = (z ^ (z >> 15)) * 0x735A2D97U;
98
541
    return z ^ (z >> 15);
99
541
}
100
101
/**
102
 * State shared by min_topk and max_topk, for one value type.
103
 *
104
 * The distinct values sit in slots (see the stores above), with one Slot record per value carrying
105
 * the row count and the links of a treap ordered best-first (ascending values for MIN, descending
106
 * for MAX). A row costs one O(log k) descent: it either finds its value and bumps the count or
107
 * links a new slot at the leaf. A sorted vector would shift O(k) elements for the same insert.
108
 *
109
 * The treap stores explicit child links because, unlike a heap, its shape is not the complete tree
110
 * that an array index can describe: rotations move entries, and the in-order sequence is the value
111
 * order rather than the arrival order. A heap could evict and append in O(log k), but it cannot
112
 * find an existing value without a hash index or a linear scan, and it cannot produce the sorted
113
 * result without sorting. The ordered tree is the structure that keeps find, insert and eviction
114
 * all at O(log k) with comparisons only.
115
 *
116
 * An entry that is evicted keeps its slot and value until the next compaction. The tree never
117
 * points at a dead slot.
118
 *
119
 * With k == 0 the state holds at most the single extreme value and its row count; the caller
120
 * derives truncation from the list length, so the state carries no separate bound.
121
 */
122
template <PrimitiveType T>
123
struct AggregateTopKCountData
124
        : std::conditional_t<is_string_type(T), StringTopKArena, EmptyTopKArena> {
125
    using CppType = typename PrimitiveTypeTraits<T>::CppType;
126
    static constexpr bool IS_STRING = is_string_type(T);
127
    /// A value as the state stores it: the value itself for fixed-width types, the span of its
128
    /// bytes in the arena for strings.
129
    using Payload = std::conditional_t<IS_STRING, StringSpan, CppType>;
130
    /// A value read out of a state: a view valid until that state's arena changes.
131
    using ValueRef = std::conditional_t<IS_STRING, StringRef, const CppType&>;
132
    /// A value copied out of a state, for building the sorted list a rebuild starts from.
133
    using ValueCopy = std::conditional_t<IS_STRING, StringRef, CppType>;
134
135
    static constexpr int32_t NO_SLOT = -1;
136
    // Row counts are never negative, so this cannot collide with a live entry.
137
    static constexpr int64_t DEAD_COUNT = -1;
138
139
    /// One running value: its count, its payload and its treap links. Keeping the payload in the
140
    /// slot is what makes a group cost one heap allocation instead of two: the slot array carries
141
    /// the values with it.
142
    struct Slot {
143
        int64_t count = 0;
144
        int32_t left = NO_SLOT;
145
        int32_t right = NO_SLOT;
146
        uint32_t priority = 0;
147
        Payload payload {};
148
    };
149
150
    /// One (value, count) entry of the sorted list a state is rebuilt from.
151
    struct Entry {
152
        ValueCopy value {};
153
        int64_t count = 0;
154
    };
155
156
    // k is the aggregate's count argument, which is never negative, so -1 can stand in for "this
157
    // partial state has not seen its first row yet" and the state needs no separate flag.
158
    static constexpr int64_t NO_K = -1;
159
    int64_t k = NO_K;
160
    // Indexed by slot; an evicted slot stays as a dead entry until compaction.
161
    DorisVector<Slot> slots;
162
    int32_t root = NO_SLOT;
163
    // The last live slot in the aggregate's order: the value an incoming row has to beat to enter
164
    // a full list. Cached so that rejecting a worse value costs one comparison, not a descent.
165
    int32_t worst = NO_SLOT;
166
    // Both counters are bounded by the slot count, which the int32_t links already cap, so 32 bits
167
    // are enough; keeping them (and the seed) 32-bit is what holds the state to 56 bytes.
168
    uint32_t live = 0;
169
    // Slots evicted since the last compaction.
170
    uint32_t dead = 0;
171
    uint32_t rng = next_topk_priority_seed();
172
173
541
    AggregateTopKCountData() = default;
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE2EEC2Ev
_ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE3EEC2Ev
Line
Count
Source
173
1
    AggregateTopKCountData() = default;
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE4EEC2Ev
_ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE5EEC2Ev
Line
Count
Source
173
381
    AggregateTopKCountData() = default;
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE6EEC2Ev
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE7EEC2Ev
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE8EEC2Ev
_ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE9EEC2Ev
Line
Count
Source
173
6
    AggregateTopKCountData() = default;
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE28EEC2Ev
_ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE29EEC2Ev
Line
Count
Source
173
52
    AggregateTopKCountData() = default;
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE20EEC2Ev
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE30EEC2Ev
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE35EEC2Ev
_ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE10EEC2Ev
Line
Count
Source
173
71
    AggregateTopKCountData() = default;
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE11EEC2Ev
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE12EEC2Ev
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE25EEC2Ev
_ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE26EEC2Ev
Line
Count
Source
173
30
    AggregateTopKCountData() = default;
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE27EEC2Ev
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE43EEC2Ev
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE42EEC2Ev
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE36EEC2Ev
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE37EEC2Ev
Unexecuted instantiation: _ZN5doris22AggregateTopKCountDataILNS_13PrimitiveTypeE44EEC2Ev
174
    AggregateTopKCountData(const AggregateTopKCountData&) = delete;
175
    AggregateTopKCountData& operator=(const AggregateTopKCountData&) = delete;
176
};
177
178
/**
179
 * min_topk(x, k) / max_topk(x, k).
180
 *
181
 * Result: ARRAY<STRUCT<value T, count BIGINT>>. NULL inputs are ignored: add validates k for
182
 * every row and then skips a NULL x, so the aggregate deliberately does not use the
183
 * nullable-argument wrapper. The array is ordered by value (ascending for MIN), holds at most k
184
 * distinct values with count > 0, and carries no truncation flag: the caller infers it from the
185
 * length (a list of exactly k entries is treated as possibly truncated).
186
 *
187
 * With k = 0 the array holds at most the extreme value and its row count, which lets the
188
 * append-only IVM path compute MIN/MAX from the delta extreme alone.
189
 */
190
template <PrimitiveType T, bool IsMin>
191
class AggregateFunctionTopK final
192
        : public IAggregateFunctionDataHelper<AggregateTopKCountData<T>,
193
                                              AggregateFunctionTopK<T, IsMin>, false>,
194
          public MultiExpression,
195
          public NotNullableAggregateFunction {
196
public:
197
    using State = AggregateTopKCountData<T>;
198
    using Base = IAggregateFunctionDataHelper<State, AggregateFunctionTopK<T, IsMin>, false>;
199
    using Slot = typename State::Slot;
200
    using Payload = typename State::Payload;
201
    using ValueRef = typename State::ValueRef;
202
    using ValueCopy = typename State::ValueCopy;
203
    using Entry = typename State::Entry;
204
    using ColumnType = typename PrimitiveTypeTraits<T>::ColumnType;
205
    static constexpr bool IS_STRING = State::IS_STRING;
206
    static constexpr int32_t NO_SLOT = State::NO_SLOT;
207
208
116
    explicit AggregateFunctionTopK(const DataTypes& argument_types_) : Base(argument_types_) {
209
116
        DCHECK_EQ(argument_types_.size(), 2);
210
116
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Line
Count
Source
208
1
    explicit AggregateFunctionTopK(const DataTypes& argument_types_) : Base(argument_types_) {
209
        DCHECK_EQ(argument_types_.size(), 2);
210
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Line
Count
Source
208
48
    explicit AggregateFunctionTopK(const DataTypes& argument_types_) : Base(argument_types_) {
209
        DCHECK_EQ(argument_types_.size(), 2);
210
48
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Line
Count
Source
208
2
    explicit AggregateFunctionTopK(const DataTypes& argument_types_) : Base(argument_types_) {
209
        DCHECK_EQ(argument_types_.size(), 2);
210
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Line
Count
Source
208
4
    explicit AggregateFunctionTopK(const DataTypes& argument_types_) : Base(argument_types_) {
209
        DCHECK_EQ(argument_types_.size(), 2);
210
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Line
Count
Source
208
14
    explicit AggregateFunctionTopK(const DataTypes& argument_types_) : Base(argument_types_) {
209
        DCHECK_EQ(argument_types_.size(), 2);
210
14
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Line
Count
Source
208
2
    explicit AggregateFunctionTopK(const DataTypes& argument_types_) : Base(argument_types_) {
209
        DCHECK_EQ(argument_types_.size(), 2);
210
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Line
Count
Source
208
32
    explicit AggregateFunctionTopK(const DataTypes& argument_types_) : Base(argument_types_) {
209
        DCHECK_EQ(argument_types_.size(), 2);
210
32
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Line
Count
Source
208
2
    explicit AggregateFunctionTopK(const DataTypes& argument_types_) : Base(argument_types_) {
209
        DCHECK_EQ(argument_types_.size(), 2);
210
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Line
Count
Source
208
4
    explicit AggregateFunctionTopK(const DataTypes& argument_types_) : Base(argument_types_) {
209
        DCHECK_EQ(argument_types_.size(), 2);
210
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Line
Count
Source
208
5
    explicit AggregateFunctionTopK(const DataTypes& argument_types_) : Base(argument_types_) {
209
        DCHECK_EQ(argument_types_.size(), 2);
210
5
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Line
Count
Source
208
2
    explicit AggregateFunctionTopK(const DataTypes& argument_types_) : Base(argument_types_) {
209
        DCHECK_EQ(argument_types_.size(), 2);
210
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE
211
212
1
    String get_name() const override { return IsMin ? "min_topk" : "max_topk"; }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE8get_nameB5cxx11Ev
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE8get_nameB5cxx11Ev
Line
Count
Source
212
1
    String get_name() const override { return IsMin ? "min_topk" : "max_topk"; }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE8get_nameB5cxx11Ev
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE8get_nameB5cxx11Ev
213
214
528
    DataTypePtr get_return_type() const override {
215
528
        return make_return_type(remove_nullable(this->argument_types[0]));
216
528
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE15get_return_typeEv
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE15get_return_typeEv
Line
Count
Source
214
4
    DataTypePtr get_return_type() const override {
215
4
        return make_return_type(remove_nullable(this->argument_types[0]));
216
4
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE15get_return_typeEv
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE15get_return_typeEv
Line
Count
Source
214
210
    DataTypePtr get_return_type() const override {
215
210
        return make_return_type(remove_nullable(this->argument_types[0]));
216
210
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE15get_return_typeEv
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE15get_return_typeEv
Line
Count
Source
214
19
    DataTypePtr get_return_type() const override {
215
19
        return make_return_type(remove_nullable(this->argument_types[0]));
216
19
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE15get_return_typeEv
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE15get_return_typeEv
Line
Count
Source
214
24
    DataTypePtr get_return_type() const override {
215
24
        return make_return_type(remove_nullable(this->argument_types[0]));
216
24
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE15get_return_typeEv
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE15get_return_typeEv
Line
Count
Source
214
35
    DataTypePtr get_return_type() const override {
215
35
        return make_return_type(remove_nullable(this->argument_types[0]));
216
35
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE15get_return_typeEv
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE15get_return_typeEv
Line
Count
Source
214
19
    DataTypePtr get_return_type() const override {
215
19
        return make_return_type(remove_nullable(this->argument_types[0]));
216
19
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE15get_return_typeEv
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE15get_return_typeEv
Line
Count
Source
214
130
    DataTypePtr get_return_type() const override {
215
130
        return make_return_type(remove_nullable(this->argument_types[0]));
216
130
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE15get_return_typeEv
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE15get_return_typeEv
Line
Count
Source
214
19
    DataTypePtr get_return_type() const override {
215
19
        return make_return_type(remove_nullable(this->argument_types[0]));
216
19
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE15get_return_typeEv
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE15get_return_typeEv
Line
Count
Source
214
24
    DataTypePtr get_return_type() const override {
215
24
        return make_return_type(remove_nullable(this->argument_types[0]));
216
24
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE15get_return_typeEv
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE15get_return_typeEv
Line
Count
Source
214
25
    DataTypePtr get_return_type() const override {
215
25
        return make_return_type(remove_nullable(this->argument_types[0]));
216
25
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE15get_return_typeEv
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE15get_return_typeEv
Line
Count
Source
214
19
    DataTypePtr get_return_type() const override {
215
19
        return make_return_type(remove_nullable(this->argument_types[0]));
216
19
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE15get_return_typeEv
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE15get_return_typeEv
217
218
    void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num,
219
20.8k
             Arena& arena) const override {
220
20.8k
        auto& state = Base::data(place);
221
        // k is read for every row, including rows where x is NULL: an evaluated count that is
222
        // NULL or out of range must fail the query instead of being skipped like a NULL value.
223
20.8k
        check_k(state, *columns[1], row_num);
224
20.8k
        const IColumn* value_column = columns[0];
225
20.8k
        if (const auto* nullable = check_and_get_column<ColumnNullable>(value_column)) {
226
528
            if (nullable->is_null_at(row_num)) {
227
81
                return;
228
81
            }
229
447
            value_column = &nullable->get_nested_column();
230
447
        }
231
20.7k
        add_value(state, *value_column, row_num);
232
20.7k
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Line
Count
Source
219
1
             Arena& arena) const override {
220
1
        auto& state = Base::data(place);
221
        // k is read for every row, including rows where x is NULL: an evaluated count that is
222
        // NULL or out of range must fail the query instead of being skipped like a NULL value.
223
1
        check_k(state, *columns[1], row_num);
224
1
        const IColumn* value_column = columns[0];
225
1
        if (const auto* nullable = check_and_get_column<ColumnNullable>(value_column)) {
226
0
            if (nullable->is_null_at(row_num)) {
227
0
                return;
228
0
            }
229
0
            value_column = &nullable->get_nested_column();
230
0
        }
231
1
        add_value(state, *value_column, row_num);
232
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Line
Count
Source
219
10.4k
             Arena& arena) const override {
220
10.4k
        auto& state = Base::data(place);
221
        // k is read for every row, including rows where x is NULL: an evaluated count that is
222
        // NULL or out of range must fail the query instead of being skipped like a NULL value.
223
10.4k
        check_k(state, *columns[1], row_num);
224
10.4k
        const IColumn* value_column = columns[0];
225
10.4k
        if (const auto* nullable = check_and_get_column<ColumnNullable>(value_column)) {
226
160
            if (nullable->is_null_at(row_num)) {
227
25
                return;
228
25
            }
229
135
            value_column = &nullable->get_nested_column();
230
135
        }
231
10.3k
        add_value(state, *value_column, row_num);
232
10.3k
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Line
Count
Source
219
5
             Arena& arena) const override {
220
5
        auto& state = Base::data(place);
221
        // k is read for every row, including rows where x is NULL: an evaluated count that is
222
        // NULL or out of range must fail the query instead of being skipped like a NULL value.
223
5
        check_k(state, *columns[1], row_num);
224
5
        const IColumn* value_column = columns[0];
225
5
        if (const auto* nullable = check_and_get_column<ColumnNullable>(value_column)) {
226
5
            if (nullable->is_null_at(row_num)) {
227
0
                return;
228
0
            }
229
5
            value_column = &nullable->get_nested_column();
230
5
        }
231
5
        add_value(state, *value_column, row_num);
232
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Line
Count
Source
219
44
             Arena& arena) const override {
220
44
        auto& state = Base::data(place);
221
        // k is read for every row, including rows where x is NULL: an evaluated count that is
222
        // NULL or out of range must fail the query instead of being skipped like a NULL value.
223
44
        check_k(state, *columns[1], row_num);
224
44
        const IColumn* value_column = columns[0];
225
44
        if (const auto* nullable = check_and_get_column<ColumnNullable>(value_column)) {
226
44
            if (nullable->is_null_at(row_num)) {
227
6
                return;
228
6
            }
229
38
            value_column = &nullable->get_nested_column();
230
38
        }
231
38
        add_value(state, *value_column, row_num);
232
38
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Line
Count
Source
219
93
             Arena& arena) const override {
220
93
        auto& state = Base::data(place);
221
        // k is read for every row, including rows where x is NULL: an evaluated count that is
222
        // NULL or out of range must fail the query instead of being skipped like a NULL value.
223
93
        check_k(state, *columns[1], row_num);
224
93
        const IColumn* value_column = columns[0];
225
93
        if (const auto* nullable = check_and_get_column<ColumnNullable>(value_column)) {
226
44
            if (nullable->is_null_at(row_num)) {
227
4
                return;
228
4
            }
229
40
            value_column = &nullable->get_nested_column();
230
40
        }
231
89
        add_value(state, *value_column, row_num);
232
89
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Line
Count
Source
219
22
             Arena& arena) const override {
220
22
        auto& state = Base::data(place);
221
        // k is read for every row, including rows where x is NULL: an evaluated count that is
222
        // NULL or out of range must fail the query instead of being skipped like a NULL value.
223
22
        check_k(state, *columns[1], row_num);
224
22
        const IColumn* value_column = columns[0];
225
22
        if (const auto* nullable = check_and_get_column<ColumnNullable>(value_column)) {
226
22
            if (nullable->is_null_at(row_num)) {
227
8
                return;
228
8
            }
229
14
            value_column = &nullable->get_nested_column();
230
14
        }
231
14
        add_value(state, *value_column, row_num);
232
14
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Line
Count
Source
219
10.1k
             Arena& arena) const override {
220
10.1k
        auto& state = Base::data(place);
221
        // k is read for every row, including rows where x is NULL: an evaluated count that is
222
        // NULL or out of range must fail the query instead of being skipped like a NULL value.
223
10.1k
        check_k(state, *columns[1], row_num);
224
10.1k
        const IColumn* value_column = columns[0];
225
10.1k
        if (const auto* nullable = check_and_get_column<ColumnNullable>(value_column)) {
226
138
            if (nullable->is_null_at(row_num)) {
227
20
                return;
228
20
            }
229
118
            value_column = &nullable->get_nested_column();
230
118
        }
231
10.1k
        add_value(state, *value_column, row_num);
232
10.1k
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Line
Count
Source
219
5
             Arena& arena) const override {
220
5
        auto& state = Base::data(place);
221
        // k is read for every row, including rows where x is NULL: an evaluated count that is
222
        // NULL or out of range must fail the query instead of being skipped like a NULL value.
223
5
        check_k(state, *columns[1], row_num);
224
5
        const IColumn* value_column = columns[0];
225
5
        if (const auto* nullable = check_and_get_column<ColumnNullable>(value_column)) {
226
5
            if (nullable->is_null_at(row_num)) {
227
0
                return;
228
0
            }
229
5
            value_column = &nullable->get_nested_column();
230
5
        }
231
5
        add_value(state, *value_column, row_num);
232
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Line
Count
Source
219
44
             Arena& arena) const override {
220
44
        auto& state = Base::data(place);
221
        // k is read for every row, including rows where x is NULL: an evaluated count that is
222
        // NULL or out of range must fail the query instead of being skipped like a NULL value.
223
44
        check_k(state, *columns[1], row_num);
224
44
        const IColumn* value_column = columns[0];
225
44
        if (const auto* nullable = check_and_get_column<ColumnNullable>(value_column)) {
226
44
            if (nullable->is_null_at(row_num)) {
227
6
                return;
228
6
            }
229
38
            value_column = &nullable->get_nested_column();
230
38
        }
231
38
        add_value(state, *value_column, row_num);
232
38
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Line
Count
Source
219
48
             Arena& arena) const override {
220
48
        auto& state = Base::data(place);
221
        // k is read for every row, including rows where x is NULL: an evaluated count that is
222
        // NULL or out of range must fail the query instead of being skipped like a NULL value.
223
48
        check_k(state, *columns[1], row_num);
224
48
        const IColumn* value_column = columns[0];
225
48
        if (const auto* nullable = check_and_get_column<ColumnNullable>(value_column)) {
226
44
            if (nullable->is_null_at(row_num)) {
227
4
                return;
228
4
            }
229
40
            value_column = &nullable->get_nested_column();
230
40
        }
231
44
        add_value(state, *value_column, row_num);
232
44
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Line
Count
Source
219
22
             Arena& arena) const override {
220
22
        auto& state = Base::data(place);
221
        // k is read for every row, including rows where x is NULL: an evaluated count that is
222
        // NULL or out of range must fail the query instead of being skipped like a NULL value.
223
22
        check_k(state, *columns[1], row_num);
224
22
        const IColumn* value_column = columns[0];
225
22
        if (const auto* nullable = check_and_get_column<ColumnNullable>(value_column)) {
226
22
            if (nullable->is_null_at(row_num)) {
227
8
                return;
228
8
            }
229
14
            value_column = &nullable->get_nested_column();
230
14
        }
231
14
        add_value(state, *value_column, row_num);
232
14
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE
233
234
    void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs,
235
127
               Arena&) const override {
236
127
        auto& state = Base::data(place);
237
127
        const auto& other = Base::data(rhs);
238
        // A partial state without a k never saw any row, so it carries no information.
239
127
        if (other.k == State::NO_K) {
240
0
            return;
241
0
        }
242
127
        if (state.k == State::NO_K) {
243
106
            state.k = other.k;
244
106
        } else if (UNLIKELY(state.k != other.k)) {
245
            // Ordinary partial/final aggregation always shares the same constant k, but the
246
            // public _state/_merge/_union combinators do not encode k in the AggState type, so a
247
            // UNION ALL of states built with different literal k can reach this merge.
248
1
            throw Exception(ErrorCode::INVALID_ARGUMENT,
249
1
                            "{} states have incompatible counts: {} vs {}", get_name(), state.k,
250
1
                            other.k);
251
1
        }
252
126
        if (state.k == 0) {
253
10
            merge_extreme(state, other);
254
10
            return;
255
10
        }
256
116
        merge_values(state, other);
257
116
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE5mergeEPcPKcRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE5mergeEPcPKcRNS_5ArenaE
Line
Count
Source
235
47
               Arena&) const override {
236
47
        auto& state = Base::data(place);
237
47
        const auto& other = Base::data(rhs);
238
        // A partial state without a k never saw any row, so it carries no information.
239
47
        if (other.k == State::NO_K) {
240
0
            return;
241
0
        }
242
47
        if (state.k == State::NO_K) {
243
41
            state.k = other.k;
244
41
        } else if (UNLIKELY(state.k != other.k)) {
245
            // Ordinary partial/final aggregation always shares the same constant k, but the
246
            // public _state/_merge/_union combinators do not encode k in the AggState type, so a
247
            // UNION ALL of states built with different literal k can reach this merge.
248
1
            throw Exception(ErrorCode::INVALID_ARGUMENT,
249
1
                            "{} states have incompatible counts: {} vs {}", get_name(), state.k,
250
1
                            other.k);
251
1
        }
252
46
        if (state.k == 0) {
253
5
            merge_extreme(state, other);
254
5
            return;
255
5
        }
256
41
        merge_values(state, other);
257
41
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE5mergeEPcPKcRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE5mergeEPcPKcRNS_5ArenaE
Line
Count
Source
235
1
               Arena&) const override {
236
1
        auto& state = Base::data(place);
237
1
        const auto& other = Base::data(rhs);
238
        // A partial state without a k never saw any row, so it carries no information.
239
1
        if (other.k == State::NO_K) {
240
0
            return;
241
0
        }
242
1
        if (state.k == State::NO_K) {
243
1
            state.k = other.k;
244
1
        } else if (UNLIKELY(state.k != other.k)) {
245
            // Ordinary partial/final aggregation always shares the same constant k, but the
246
            // public _state/_merge/_union combinators do not encode k in the AggState type, so a
247
            // UNION ALL of states built with different literal k can reach this merge.
248
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
249
0
                            "{} states have incompatible counts: {} vs {}", get_name(), state.k,
250
0
                            other.k);
251
0
        }
252
1
        if (state.k == 0) {
253
0
            merge_extreme(state, other);
254
0
            return;
255
0
        }
256
1
        merge_values(state, other);
257
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE5mergeEPcPKcRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE5mergeEPcPKcRNS_5ArenaE
Line
Count
Source
235
7
               Arena&) const override {
236
7
        auto& state = Base::data(place);
237
7
        const auto& other = Base::data(rhs);
238
        // A partial state without a k never saw any row, so it carries no information.
239
7
        if (other.k == State::NO_K) {
240
0
            return;
241
0
        }
242
7
        if (state.k == State::NO_K) {
243
6
            state.k = other.k;
244
6
        } else if (UNLIKELY(state.k != other.k)) {
245
            // Ordinary partial/final aggregation always shares the same constant k, but the
246
            // public _state/_merge/_union combinators do not encode k in the AggState type, so a
247
            // UNION ALL of states built with different literal k can reach this merge.
248
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
249
0
                            "{} states have incompatible counts: {} vs {}", get_name(), state.k,
250
0
                            other.k);
251
0
        }
252
7
        if (state.k == 0) {
253
0
            merge_extreme(state, other);
254
0
            return;
255
0
        }
256
7
        merge_values(state, other);
257
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE5mergeEPcPKcRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE5mergeEPcPKcRNS_5ArenaE
Line
Count
Source
235
14
               Arena&) const override {
236
14
        auto& state = Base::data(place);
237
14
        const auto& other = Base::data(rhs);
238
        // A partial state without a k never saw any row, so it carries no information.
239
14
        if (other.k == State::NO_K) {
240
0
            return;
241
0
        }
242
14
        if (state.k == State::NO_K) {
243
6
            state.k = other.k;
244
8
        } else if (UNLIKELY(state.k != other.k)) {
245
            // Ordinary partial/final aggregation always shares the same constant k, but the
246
            // public _state/_merge/_union combinators do not encode k in the AggState type, so a
247
            // UNION ALL of states built with different literal k can reach this merge.
248
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
249
0
                            "{} states have incompatible counts: {} vs {}", get_name(), state.k,
250
0
                            other.k);
251
0
        }
252
14
        if (state.k == 0) {
253
0
            merge_extreme(state, other);
254
0
            return;
255
0
        }
256
14
        merge_values(state, other);
257
14
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE5mergeEPcPKcRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE5mergeEPcPKcRNS_5ArenaE
Line
Count
Source
235
5
               Arena&) const override {
236
5
        auto& state = Base::data(place);
237
5
        const auto& other = Base::data(rhs);
238
        // A partial state without a k never saw any row, so it carries no information.
239
5
        if (other.k == State::NO_K) {
240
0
            return;
241
0
        }
242
5
        if (state.k == State::NO_K) {
243
5
            state.k = other.k;
244
5
        } else if (UNLIKELY(state.k != other.k)) {
245
            // Ordinary partial/final aggregation always shares the same constant k, but the
246
            // public _state/_merge/_union combinators do not encode k in the AggState type, so a
247
            // UNION ALL of states built with different literal k can reach this merge.
248
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
249
0
                            "{} states have incompatible counts: {} vs {}", get_name(), state.k,
250
0
                            other.k);
251
0
        }
252
5
        if (state.k == 0) {
253
0
            merge_extreme(state, other);
254
0
            return;
255
0
        }
256
5
        merge_values(state, other);
257
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE5mergeEPcPKcRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE5mergeEPcPKcRNS_5ArenaE
Line
Count
Source
235
33
               Arena&) const override {
236
33
        auto& state = Base::data(place);
237
33
        const auto& other = Base::data(rhs);
238
        // A partial state without a k never saw any row, so it carries no information.
239
33
        if (other.k == State::NO_K) {
240
0
            return;
241
0
        }
242
33
        if (state.k == State::NO_K) {
243
29
            state.k = other.k;
244
29
        } else if (UNLIKELY(state.k != other.k)) {
245
            // Ordinary partial/final aggregation always shares the same constant k, but the
246
            // public _state/_merge/_union combinators do not encode k in the AggState type, so a
247
            // UNION ALL of states built with different literal k can reach this merge.
248
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
249
0
                            "{} states have incompatible counts: {} vs {}", get_name(), state.k,
250
0
                            other.k);
251
0
        }
252
33
        if (state.k == 0) {
253
5
            merge_extreme(state, other);
254
5
            return;
255
5
        }
256
28
        merge_values(state, other);
257
28
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE5mergeEPcPKcRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE5mergeEPcPKcRNS_5ArenaE
Line
Count
Source
235
1
               Arena&) const override {
236
1
        auto& state = Base::data(place);
237
1
        const auto& other = Base::data(rhs);
238
        // A partial state without a k never saw any row, so it carries no information.
239
1
        if (other.k == State::NO_K) {
240
0
            return;
241
0
        }
242
1
        if (state.k == State::NO_K) {
243
1
            state.k = other.k;
244
1
        } else if (UNLIKELY(state.k != other.k)) {
245
            // Ordinary partial/final aggregation always shares the same constant k, but the
246
            // public _state/_merge/_union combinators do not encode k in the AggState type, so a
247
            // UNION ALL of states built with different literal k can reach this merge.
248
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
249
0
                            "{} states have incompatible counts: {} vs {}", get_name(), state.k,
250
0
                            other.k);
251
0
        }
252
1
        if (state.k == 0) {
253
0
            merge_extreme(state, other);
254
0
            return;
255
0
        }
256
1
        merge_values(state, other);
257
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE5mergeEPcPKcRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE5mergeEPcPKcRNS_5ArenaE
Line
Count
Source
235
7
               Arena&) const override {
236
7
        auto& state = Base::data(place);
237
7
        const auto& other = Base::data(rhs);
238
        // A partial state without a k never saw any row, so it carries no information.
239
7
        if (other.k == State::NO_K) {
240
0
            return;
241
0
        }
242
7
        if (state.k == State::NO_K) {
243
6
            state.k = other.k;
244
6
        } else if (UNLIKELY(state.k != other.k)) {
245
            // Ordinary partial/final aggregation always shares the same constant k, but the
246
            // public _state/_merge/_union combinators do not encode k in the AggState type, so a
247
            // UNION ALL of states built with different literal k can reach this merge.
248
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
249
0
                            "{} states have incompatible counts: {} vs {}", get_name(), state.k,
250
0
                            other.k);
251
0
        }
252
7
        if (state.k == 0) {
253
0
            merge_extreme(state, other);
254
0
            return;
255
0
        }
256
7
        merge_values(state, other);
257
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE5mergeEPcPKcRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE5mergeEPcPKcRNS_5ArenaE
Line
Count
Source
235
7
               Arena&) const override {
236
7
        auto& state = Base::data(place);
237
7
        const auto& other = Base::data(rhs);
238
        // A partial state without a k never saw any row, so it carries no information.
239
7
        if (other.k == State::NO_K) {
240
0
            return;
241
0
        }
242
7
        if (state.k == State::NO_K) {
243
6
            state.k = other.k;
244
6
        } else if (UNLIKELY(state.k != other.k)) {
245
            // Ordinary partial/final aggregation always shares the same constant k, but the
246
            // public _state/_merge/_union combinators do not encode k in the AggState type, so a
247
            // UNION ALL of states built with different literal k can reach this merge.
248
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
249
0
                            "{} states have incompatible counts: {} vs {}", get_name(), state.k,
250
0
                            other.k);
251
0
        }
252
7
        if (state.k == 0) {
253
0
            merge_extreme(state, other);
254
0
            return;
255
0
        }
256
7
        merge_values(state, other);
257
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE5mergeEPcPKcRNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE5mergeEPcPKcRNS_5ArenaE
Line
Count
Source
235
5
               Arena&) const override {
236
5
        auto& state = Base::data(place);
237
5
        const auto& other = Base::data(rhs);
238
        // A partial state without a k never saw any row, so it carries no information.
239
5
        if (other.k == State::NO_K) {
240
0
            return;
241
0
        }
242
5
        if (state.k == State::NO_K) {
243
5
            state.k = other.k;
244
5
        } else if (UNLIKELY(state.k != other.k)) {
245
            // Ordinary partial/final aggregation always shares the same constant k, but the
246
            // public _state/_merge/_union combinators do not encode k in the AggState type, so a
247
            // UNION ALL of states built with different literal k can reach this merge.
248
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
249
0
                            "{} states have incompatible counts: {} vs {}", get_name(), state.k,
250
0
                            other.k);
251
0
        }
252
5
        if (state.k == 0) {
253
0
            merge_extreme(state, other);
254
0
            return;
255
0
        }
256
5
        merge_values(state, other);
257
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE5mergeEPcPKcRNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE5mergeEPcPKcRNS_5ArenaE
258
259
119
    void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override {
260
119
        const auto& state = Base::data(place);
261
        // The serialized form keeps the historical flag byte: it is derived from k in the state.
262
119
        buf.write_binary(state.k != State::NO_K);
263
119
        buf.write_binary(state.k);
264
        // The slots are in arrival order and may include dead ones, while the serialized form is
265
        // the sorted (value, count) list the reader rebuilds the tree from.
266
119
        DorisVector<int32_t> order;
267
119
        collect_in_order(state, order);
268
119
        auto sorted_values = remove_nullable(this->argument_types[0])->create_column();
269
119
        sorted_values->reserve(order.size());
270
119
        DorisVector<int64_t> sorted_counts;
271
119
        sorted_counts.reserve(order.size());
272
271
        for (int32_t slot : order) {
273
271
            insert_value(*sorted_values, value_of(state, slot));
274
271
            sorted_counts.push_back(state.slots[slot].count);
275
271
        }
276
119
        auto size = static_cast<int64_t>(sorted_counts.size());
277
119
        buf.write_binary(size);
278
119
        write_column(buf, *sorted_values);
279
119
        if (size != 0) {
280
            // An empty list keeps an empty vector, whose data() is null; passing it to memcpy is
281
            // undefined even for a zero length.
282
97
            buf.write(reinterpret_cast<const char*>(sorted_counts.data()),
283
97
                      sorted_counts.size() * sizeof(int64_t));
284
97
        }
285
119
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE9serializeEPKcRNS_14BufferWritableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE9serializeEPKcRNS_14BufferWritableE
Line
Count
Source
259
47
    void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override {
260
47
        const auto& state = Base::data(place);
261
        // The serialized form keeps the historical flag byte: it is derived from k in the state.
262
47
        buf.write_binary(state.k != State::NO_K);
263
47
        buf.write_binary(state.k);
264
        // The slots are in arrival order and may include dead ones, while the serialized form is
265
        // the sorted (value, count) list the reader rebuilds the tree from.
266
47
        DorisVector<int32_t> order;
267
47
        collect_in_order(state, order);
268
47
        auto sorted_values = remove_nullable(this->argument_types[0])->create_column();
269
47
        sorted_values->reserve(order.size());
270
47
        DorisVector<int64_t> sorted_counts;
271
47
        sorted_counts.reserve(order.size());
272
145
        for (int32_t slot : order) {
273
145
            insert_value(*sorted_values, value_of(state, slot));
274
145
            sorted_counts.push_back(state.slots[slot].count);
275
145
        }
276
47
        auto size = static_cast<int64_t>(sorted_counts.size());
277
47
        buf.write_binary(size);
278
47
        write_column(buf, *sorted_values);
279
47
        if (size != 0) {
280
            // An empty list keeps an empty vector, whose data() is null; passing it to memcpy is
281
            // undefined even for a zero length.
282
38
            buf.write(reinterpret_cast<const char*>(sorted_counts.data()),
283
38
                      sorted_counts.size() * sizeof(int64_t));
284
38
        }
285
47
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE9serializeEPKcRNS_14BufferWritableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE9serializeEPKcRNS_14BufferWritableE
Line
Count
Source
259
1
    void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override {
260
1
        const auto& state = Base::data(place);
261
        // The serialized form keeps the historical flag byte: it is derived from k in the state.
262
1
        buf.write_binary(state.k != State::NO_K);
263
1
        buf.write_binary(state.k);
264
        // The slots are in arrival order and may include dead ones, while the serialized form is
265
        // the sorted (value, count) list the reader rebuilds the tree from.
266
1
        DorisVector<int32_t> order;
267
1
        collect_in_order(state, order);
268
1
        auto sorted_values = remove_nullable(this->argument_types[0])->create_column();
269
1
        sorted_values->reserve(order.size());
270
1
        DorisVector<int64_t> sorted_counts;
271
1
        sorted_counts.reserve(order.size());
272
3
        for (int32_t slot : order) {
273
3
            insert_value(*sorted_values, value_of(state, slot));
274
3
            sorted_counts.push_back(state.slots[slot].count);
275
3
        }
276
1
        auto size = static_cast<int64_t>(sorted_counts.size());
277
1
        buf.write_binary(size);
278
1
        write_column(buf, *sorted_values);
279
1
        if (size != 0) {
280
            // An empty list keeps an empty vector, whose data() is null; passing it to memcpy is
281
            // undefined even for a zero length.
282
1
            buf.write(reinterpret_cast<const char*>(sorted_counts.data()),
283
1
                      sorted_counts.size() * sizeof(int64_t));
284
1
        }
285
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE9serializeEPKcRNS_14BufferWritableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE9serializeEPKcRNS_14BufferWritableE
Line
Count
Source
259
7
    void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override {
260
7
        const auto& state = Base::data(place);
261
        // The serialized form keeps the historical flag byte: it is derived from k in the state.
262
7
        buf.write_binary(state.k != State::NO_K);
263
7
        buf.write_binary(state.k);
264
        // The slots are in arrival order and may include dead ones, while the serialized form is
265
        // the sorted (value, count) list the reader rebuilds the tree from.
266
7
        DorisVector<int32_t> order;
267
7
        collect_in_order(state, order);
268
7
        auto sorted_values = remove_nullable(this->argument_types[0])->create_column();
269
7
        sorted_values->reserve(order.size());
270
7
        DorisVector<int64_t> sorted_counts;
271
7
        sorted_counts.reserve(order.size());
272
10
        for (int32_t slot : order) {
273
10
            insert_value(*sorted_values, value_of(state, slot));
274
10
            sorted_counts.push_back(state.slots[slot].count);
275
10
        }
276
7
        auto size = static_cast<int64_t>(sorted_counts.size());
277
7
        buf.write_binary(size);
278
7
        write_column(buf, *sorted_values);
279
7
        if (size != 0) {
280
            // An empty list keeps an empty vector, whose data() is null; passing it to memcpy is
281
            // undefined even for a zero length.
282
6
            buf.write(reinterpret_cast<const char*>(sorted_counts.data()),
283
6
                      sorted_counts.size() * sizeof(int64_t));
284
6
        }
285
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE9serializeEPKcRNS_14BufferWritableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE9serializeEPKcRNS_14BufferWritableE
Line
Count
Source
259
8
    void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override {
260
8
        const auto& state = Base::data(place);
261
        // The serialized form keeps the historical flag byte: it is derived from k in the state.
262
8
        buf.write_binary(state.k != State::NO_K);
263
8
        buf.write_binary(state.k);
264
        // The slots are in arrival order and may include dead ones, while the serialized form is
265
        // the sorted (value, count) list the reader rebuilds the tree from.
266
8
        DorisVector<int32_t> order;
267
8
        collect_in_order(state, order);
268
8
        auto sorted_values = remove_nullable(this->argument_types[0])->create_column();
269
8
        sorted_values->reserve(order.size());
270
8
        DorisVector<int64_t> sorted_counts;
271
8
        sorted_counts.reserve(order.size());
272
18
        for (int32_t slot : order) {
273
18
            insert_value(*sorted_values, value_of(state, slot));
274
18
            sorted_counts.push_back(state.slots[slot].count);
275
18
        }
276
8
        auto size = static_cast<int64_t>(sorted_counts.size());
277
8
        buf.write_binary(size);
278
8
        write_column(buf, *sorted_values);
279
8
        if (size != 0) {
280
            // An empty list keeps an empty vector, whose data() is null; passing it to memcpy is
281
            // undefined even for a zero length.
282
7
            buf.write(reinterpret_cast<const char*>(sorted_counts.data()),
283
7
                      sorted_counts.size() * sizeof(int64_t));
284
7
        }
285
8
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE9serializeEPKcRNS_14BufferWritableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE9serializeEPKcRNS_14BufferWritableE
Line
Count
Source
259
5
    void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override {
260
5
        const auto& state = Base::data(place);
261
        // The serialized form keeps the historical flag byte: it is derived from k in the state.
262
5
        buf.write_binary(state.k != State::NO_K);
263
5
        buf.write_binary(state.k);
264
        // The slots are in arrival order and may include dead ones, while the serialized form is
265
        // the sorted (value, count) list the reader rebuilds the tree from.
266
5
        DorisVector<int32_t> order;
267
5
        collect_in_order(state, order);
268
5
        auto sorted_values = remove_nullable(this->argument_types[0])->create_column();
269
5
        sorted_values->reserve(order.size());
270
5
        DorisVector<int64_t> sorted_counts;
271
5
        sorted_counts.reserve(order.size());
272
5
        for (int32_t slot : order) {
273
5
            insert_value(*sorted_values, value_of(state, slot));
274
5
            sorted_counts.push_back(state.slots[slot].count);
275
5
        }
276
5
        auto size = static_cast<int64_t>(sorted_counts.size());
277
5
        buf.write_binary(size);
278
5
        write_column(buf, *sorted_values);
279
5
        if (size != 0) {
280
            // An empty list keeps an empty vector, whose data() is null; passing it to memcpy is
281
            // undefined even for a zero length.
282
3
            buf.write(reinterpret_cast<const char*>(sorted_counts.data()),
283
3
                      sorted_counts.size() * sizeof(int64_t));
284
3
        }
285
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE9serializeEPKcRNS_14BufferWritableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE9serializeEPKcRNS_14BufferWritableE
Line
Count
Source
259
31
    void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override {
260
31
        const auto& state = Base::data(place);
261
        // The serialized form keeps the historical flag byte: it is derived from k in the state.
262
31
        buf.write_binary(state.k != State::NO_K);
263
31
        buf.write_binary(state.k);
264
        // The slots are in arrival order and may include dead ones, while the serialized form is
265
        // the sorted (value, count) list the reader rebuilds the tree from.
266
31
        DorisVector<int32_t> order;
267
31
        collect_in_order(state, order);
268
31
        auto sorted_values = remove_nullable(this->argument_types[0])->create_column();
269
31
        sorted_values->reserve(order.size());
270
31
        DorisVector<int64_t> sorted_counts;
271
31
        sorted_counts.reserve(order.size());
272
62
        for (int32_t slot : order) {
273
62
            insert_value(*sorted_values, value_of(state, slot));
274
62
            sorted_counts.push_back(state.slots[slot].count);
275
62
        }
276
31
        auto size = static_cast<int64_t>(sorted_counts.size());
277
31
        buf.write_binary(size);
278
31
        write_column(buf, *sorted_values);
279
31
        if (size != 0) {
280
            // An empty list keeps an empty vector, whose data() is null; passing it to memcpy is
281
            // undefined even for a zero length.
282
26
            buf.write(reinterpret_cast<const char*>(sorted_counts.data()),
283
26
                      sorted_counts.size() * sizeof(int64_t));
284
26
        }
285
31
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE9serializeEPKcRNS_14BufferWritableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE9serializeEPKcRNS_14BufferWritableE
Line
Count
Source
259
1
    void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override {
260
1
        const auto& state = Base::data(place);
261
        // The serialized form keeps the historical flag byte: it is derived from k in the state.
262
1
        buf.write_binary(state.k != State::NO_K);
263
1
        buf.write_binary(state.k);
264
        // The slots are in arrival order and may include dead ones, while the serialized form is
265
        // the sorted (value, count) list the reader rebuilds the tree from.
266
1
        DorisVector<int32_t> order;
267
1
        collect_in_order(state, order);
268
1
        auto sorted_values = remove_nullable(this->argument_types[0])->create_column();
269
1
        sorted_values->reserve(order.size());
270
1
        DorisVector<int64_t> sorted_counts;
271
1
        sorted_counts.reserve(order.size());
272
3
        for (int32_t slot : order) {
273
3
            insert_value(*sorted_values, value_of(state, slot));
274
3
            sorted_counts.push_back(state.slots[slot].count);
275
3
        }
276
1
        auto size = static_cast<int64_t>(sorted_counts.size());
277
1
        buf.write_binary(size);
278
1
        write_column(buf, *sorted_values);
279
1
        if (size != 0) {
280
            // An empty list keeps an empty vector, whose data() is null; passing it to memcpy is
281
            // undefined even for a zero length.
282
1
            buf.write(reinterpret_cast<const char*>(sorted_counts.data()),
283
1
                      sorted_counts.size() * sizeof(int64_t));
284
1
        }
285
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE9serializeEPKcRNS_14BufferWritableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE9serializeEPKcRNS_14BufferWritableE
Line
Count
Source
259
7
    void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override {
260
7
        const auto& state = Base::data(place);
261
        // The serialized form keeps the historical flag byte: it is derived from k in the state.
262
7
        buf.write_binary(state.k != State::NO_K);
263
7
        buf.write_binary(state.k);
264
        // The slots are in arrival order and may include dead ones, while the serialized form is
265
        // the sorted (value, count) list the reader rebuilds the tree from.
266
7
        DorisVector<int32_t> order;
267
7
        collect_in_order(state, order);
268
7
        auto sorted_values = remove_nullable(this->argument_types[0])->create_column();
269
7
        sorted_values->reserve(order.size());
270
7
        DorisVector<int64_t> sorted_counts;
271
7
        sorted_counts.reserve(order.size());
272
10
        for (int32_t slot : order) {
273
10
            insert_value(*sorted_values, value_of(state, slot));
274
10
            sorted_counts.push_back(state.slots[slot].count);
275
10
        }
276
7
        auto size = static_cast<int64_t>(sorted_counts.size());
277
7
        buf.write_binary(size);
278
7
        write_column(buf, *sorted_values);
279
7
        if (size != 0) {
280
            // An empty list keeps an empty vector, whose data() is null; passing it to memcpy is
281
            // undefined even for a zero length.
282
6
            buf.write(reinterpret_cast<const char*>(sorted_counts.data()),
283
6
                      sorted_counts.size() * sizeof(int64_t));
284
6
        }
285
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE9serializeEPKcRNS_14BufferWritableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE9serializeEPKcRNS_14BufferWritableE
Line
Count
Source
259
7
    void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override {
260
7
        const auto& state = Base::data(place);
261
        // The serialized form keeps the historical flag byte: it is derived from k in the state.
262
7
        buf.write_binary(state.k != State::NO_K);
263
7
        buf.write_binary(state.k);
264
        // The slots are in arrival order and may include dead ones, while the serialized form is
265
        // the sorted (value, count) list the reader rebuilds the tree from.
266
7
        DorisVector<int32_t> order;
267
7
        collect_in_order(state, order);
268
7
        auto sorted_values = remove_nullable(this->argument_types[0])->create_column();
269
7
        sorted_values->reserve(order.size());
270
7
        DorisVector<int64_t> sorted_counts;
271
7
        sorted_counts.reserve(order.size());
272
10
        for (int32_t slot : order) {
273
10
            insert_value(*sorted_values, value_of(state, slot));
274
10
            sorted_counts.push_back(state.slots[slot].count);
275
10
        }
276
7
        auto size = static_cast<int64_t>(sorted_counts.size());
277
7
        buf.write_binary(size);
278
7
        write_column(buf, *sorted_values);
279
7
        if (size != 0) {
280
            // An empty list keeps an empty vector, whose data() is null; passing it to memcpy is
281
            // undefined even for a zero length.
282
6
            buf.write(reinterpret_cast<const char*>(sorted_counts.data()),
283
6
                      sorted_counts.size() * sizeof(int64_t));
284
6
        }
285
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE9serializeEPKcRNS_14BufferWritableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE9serializeEPKcRNS_14BufferWritableE
Line
Count
Source
259
5
    void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override {
260
5
        const auto& state = Base::data(place);
261
        // The serialized form keeps the historical flag byte: it is derived from k in the state.
262
5
        buf.write_binary(state.k != State::NO_K);
263
5
        buf.write_binary(state.k);
264
        // The slots are in arrival order and may include dead ones, while the serialized form is
265
        // the sorted (value, count) list the reader rebuilds the tree from.
266
5
        DorisVector<int32_t> order;
267
5
        collect_in_order(state, order);
268
5
        auto sorted_values = remove_nullable(this->argument_types[0])->create_column();
269
5
        sorted_values->reserve(order.size());
270
5
        DorisVector<int64_t> sorted_counts;
271
5
        sorted_counts.reserve(order.size());
272
5
        for (int32_t slot : order) {
273
5
            insert_value(*sorted_values, value_of(state, slot));
274
5
            sorted_counts.push_back(state.slots[slot].count);
275
5
        }
276
5
        auto size = static_cast<int64_t>(sorted_counts.size());
277
5
        buf.write_binary(size);
278
5
        write_column(buf, *sorted_values);
279
5
        if (size != 0) {
280
            // An empty list keeps an empty vector, whose data() is null; passing it to memcpy is
281
            // undefined even for a zero length.
282
3
            buf.write(reinterpret_cast<const char*>(sorted_counts.data()),
283
3
                      sorted_counts.size() * sizeof(int64_t));
284
3
        }
285
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE9serializeEPKcRNS_14BufferWritableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE9serializeEPKcRNS_14BufferWritableE
286
287
    void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf,
288
122
                     Arena&) const override {
289
122
        auto& state = Base::data(place);
290
122
        bool has_k = false;
291
122
        buf.read_binary(has_k);
292
122
        buf.read_binary(state.k);
293
122
        if (!has_k) {
294
1
            state.k = State::NO_K;
295
1
        }
296
122
        int64_t size = 0;
297
122
        buf.read_binary(size);
298
122
        auto values = read_column(buf);
299
122
        DCHECK_EQ(static_cast<int64_t>(values->size()), size);
300
122
        DorisVector<int64_t> counts(static_cast<size_t>(size));
301
122
        if (size != 0) {
302
100
            buf.read(reinterpret_cast<char*>(counts.data()), size * sizeof(int64_t));
303
100
        }
304
122
        DorisVector<Entry> entries;
305
122
        entries.reserve(static_cast<size_t>(size));
306
398
        for (int64_t row = 0; row != size; ++row) {
307
276
            entries.push_back(Entry {value_at(*values, static_cast<size_t>(row)), counts[row]});
308
276
        }
309
122
        assign_sorted(state, std::move(entries));
310
122
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Line
Count
Source
288
49
                     Arena&) const override {
289
49
        auto& state = Base::data(place);
290
49
        bool has_k = false;
291
49
        buf.read_binary(has_k);
292
49
        buf.read_binary(state.k);
293
49
        if (!has_k) {
294
1
            state.k = State::NO_K;
295
1
        }
296
49
        int64_t size = 0;
297
49
        buf.read_binary(size);
298
49
        auto values = read_column(buf);
299
49
        DCHECK_EQ(static_cast<int64_t>(values->size()), size);
300
49
        DorisVector<int64_t> counts(static_cast<size_t>(size));
301
49
        if (size != 0) {
302
40
            buf.read(reinterpret_cast<char*>(counts.data()), size * sizeof(int64_t));
303
40
        }
304
49
        DorisVector<Entry> entries;
305
49
        entries.reserve(static_cast<size_t>(size));
306
197
        for (int64_t row = 0; row != size; ++row) {
307
148
            entries.push_back(Entry {value_at(*values, static_cast<size_t>(row)), counts[row]});
308
148
        }
309
49
        assign_sorted(state, std::move(entries));
310
49
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Line
Count
Source
288
1
                     Arena&) const override {
289
1
        auto& state = Base::data(place);
290
1
        bool has_k = false;
291
1
        buf.read_binary(has_k);
292
1
        buf.read_binary(state.k);
293
1
        if (!has_k) {
294
0
            state.k = State::NO_K;
295
0
        }
296
1
        int64_t size = 0;
297
1
        buf.read_binary(size);
298
1
        auto values = read_column(buf);
299
1
        DCHECK_EQ(static_cast<int64_t>(values->size()), size);
300
1
        DorisVector<int64_t> counts(static_cast<size_t>(size));
301
1
        if (size != 0) {
302
1
            buf.read(reinterpret_cast<char*>(counts.data()), size * sizeof(int64_t));
303
1
        }
304
1
        DorisVector<Entry> entries;
305
1
        entries.reserve(static_cast<size_t>(size));
306
4
        for (int64_t row = 0; row != size; ++row) {
307
3
            entries.push_back(Entry {value_at(*values, static_cast<size_t>(row)), counts[row]});
308
3
        }
309
1
        assign_sorted(state, std::move(entries));
310
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Line
Count
Source
288
7
                     Arena&) const override {
289
7
        auto& state = Base::data(place);
290
7
        bool has_k = false;
291
7
        buf.read_binary(has_k);
292
7
        buf.read_binary(state.k);
293
7
        if (!has_k) {
294
0
            state.k = State::NO_K;
295
0
        }
296
7
        int64_t size = 0;
297
7
        buf.read_binary(size);
298
7
        auto values = read_column(buf);
299
7
        DCHECK_EQ(static_cast<int64_t>(values->size()), size);
300
7
        DorisVector<int64_t> counts(static_cast<size_t>(size));
301
7
        if (size != 0) {
302
6
            buf.read(reinterpret_cast<char*>(counts.data()), size * sizeof(int64_t));
303
6
        }
304
7
        DorisVector<Entry> entries;
305
7
        entries.reserve(static_cast<size_t>(size));
306
17
        for (int64_t row = 0; row != size; ++row) {
307
10
            entries.push_back(Entry {value_at(*values, static_cast<size_t>(row)), counts[row]});
308
10
        }
309
7
        assign_sorted(state, std::move(entries));
310
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Line
Count
Source
288
8
                     Arena&) const override {
289
8
        auto& state = Base::data(place);
290
8
        bool has_k = false;
291
8
        buf.read_binary(has_k);
292
8
        buf.read_binary(state.k);
293
8
        if (!has_k) {
294
0
            state.k = State::NO_K;
295
0
        }
296
8
        int64_t size = 0;
297
8
        buf.read_binary(size);
298
8
        auto values = read_column(buf);
299
8
        DCHECK_EQ(static_cast<int64_t>(values->size()), size);
300
8
        DorisVector<int64_t> counts(static_cast<size_t>(size));
301
8
        if (size != 0) {
302
7
            buf.read(reinterpret_cast<char*>(counts.data()), size * sizeof(int64_t));
303
7
        }
304
8
        DorisVector<Entry> entries;
305
8
        entries.reserve(static_cast<size_t>(size));
306
26
        for (int64_t row = 0; row != size; ++row) {
307
18
            entries.push_back(Entry {value_at(*values, static_cast<size_t>(row)), counts[row]});
308
18
        }
309
8
        assign_sorted(state, std::move(entries));
310
8
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Line
Count
Source
288
5
                     Arena&) const override {
289
5
        auto& state = Base::data(place);
290
5
        bool has_k = false;
291
5
        buf.read_binary(has_k);
292
5
        buf.read_binary(state.k);
293
5
        if (!has_k) {
294
0
            state.k = State::NO_K;
295
0
        }
296
5
        int64_t size = 0;
297
5
        buf.read_binary(size);
298
5
        auto values = read_column(buf);
299
5
        DCHECK_EQ(static_cast<int64_t>(values->size()), size);
300
5
        DorisVector<int64_t> counts(static_cast<size_t>(size));
301
5
        if (size != 0) {
302
3
            buf.read(reinterpret_cast<char*>(counts.data()), size * sizeof(int64_t));
303
3
        }
304
5
        DorisVector<Entry> entries;
305
5
        entries.reserve(static_cast<size_t>(size));
306
10
        for (int64_t row = 0; row != size; ++row) {
307
5
            entries.push_back(Entry {value_at(*values, static_cast<size_t>(row)), counts[row]});
308
5
        }
309
5
        assign_sorted(state, std::move(entries));
310
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Line
Count
Source
288
32
                     Arena&) const override {
289
32
        auto& state = Base::data(place);
290
32
        bool has_k = false;
291
32
        buf.read_binary(has_k);
292
32
        buf.read_binary(state.k);
293
32
        if (!has_k) {
294
0
            state.k = State::NO_K;
295
0
        }
296
32
        int64_t size = 0;
297
32
        buf.read_binary(size);
298
32
        auto values = read_column(buf);
299
32
        DCHECK_EQ(static_cast<int64_t>(values->size()), size);
300
32
        DorisVector<int64_t> counts(static_cast<size_t>(size));
301
32
        if (size != 0) {
302
27
            buf.read(reinterpret_cast<char*>(counts.data()), size * sizeof(int64_t));
303
27
        }
304
32
        DorisVector<Entry> entries;
305
32
        entries.reserve(static_cast<size_t>(size));
306
96
        for (int64_t row = 0; row != size; ++row) {
307
64
            entries.push_back(Entry {value_at(*values, static_cast<size_t>(row)), counts[row]});
308
64
        }
309
32
        assign_sorted(state, std::move(entries));
310
32
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Line
Count
Source
288
1
                     Arena&) const override {
289
1
        auto& state = Base::data(place);
290
1
        bool has_k = false;
291
1
        buf.read_binary(has_k);
292
1
        buf.read_binary(state.k);
293
1
        if (!has_k) {
294
0
            state.k = State::NO_K;
295
0
        }
296
1
        int64_t size = 0;
297
1
        buf.read_binary(size);
298
1
        auto values = read_column(buf);
299
1
        DCHECK_EQ(static_cast<int64_t>(values->size()), size);
300
1
        DorisVector<int64_t> counts(static_cast<size_t>(size));
301
1
        if (size != 0) {
302
1
            buf.read(reinterpret_cast<char*>(counts.data()), size * sizeof(int64_t));
303
1
        }
304
1
        DorisVector<Entry> entries;
305
1
        entries.reserve(static_cast<size_t>(size));
306
4
        for (int64_t row = 0; row != size; ++row) {
307
3
            entries.push_back(Entry {value_at(*values, static_cast<size_t>(row)), counts[row]});
308
3
        }
309
1
        assign_sorted(state, std::move(entries));
310
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Line
Count
Source
288
7
                     Arena&) const override {
289
7
        auto& state = Base::data(place);
290
7
        bool has_k = false;
291
7
        buf.read_binary(has_k);
292
7
        buf.read_binary(state.k);
293
7
        if (!has_k) {
294
0
            state.k = State::NO_K;
295
0
        }
296
7
        int64_t size = 0;
297
7
        buf.read_binary(size);
298
7
        auto values = read_column(buf);
299
7
        DCHECK_EQ(static_cast<int64_t>(values->size()), size);
300
7
        DorisVector<int64_t> counts(static_cast<size_t>(size));
301
7
        if (size != 0) {
302
6
            buf.read(reinterpret_cast<char*>(counts.data()), size * sizeof(int64_t));
303
6
        }
304
7
        DorisVector<Entry> entries;
305
7
        entries.reserve(static_cast<size_t>(size));
306
17
        for (int64_t row = 0; row != size; ++row) {
307
10
            entries.push_back(Entry {value_at(*values, static_cast<size_t>(row)), counts[row]});
308
10
        }
309
7
        assign_sorted(state, std::move(entries));
310
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Line
Count
Source
288
7
                     Arena&) const override {
289
7
        auto& state = Base::data(place);
290
7
        bool has_k = false;
291
7
        buf.read_binary(has_k);
292
7
        buf.read_binary(state.k);
293
7
        if (!has_k) {
294
0
            state.k = State::NO_K;
295
0
        }
296
7
        int64_t size = 0;
297
7
        buf.read_binary(size);
298
7
        auto values = read_column(buf);
299
7
        DCHECK_EQ(static_cast<int64_t>(values->size()), size);
300
7
        DorisVector<int64_t> counts(static_cast<size_t>(size));
301
7
        if (size != 0) {
302
6
            buf.read(reinterpret_cast<char*>(counts.data()), size * sizeof(int64_t));
303
6
        }
304
7
        DorisVector<Entry> entries;
305
7
        entries.reserve(static_cast<size_t>(size));
306
17
        for (int64_t row = 0; row != size; ++row) {
307
10
            entries.push_back(Entry {value_at(*values, static_cast<size_t>(row)), counts[row]});
308
10
        }
309
7
        assign_sorted(state, std::move(entries));
310
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Line
Count
Source
288
5
                     Arena&) const override {
289
5
        auto& state = Base::data(place);
290
5
        bool has_k = false;
291
5
        buf.read_binary(has_k);
292
5
        buf.read_binary(state.k);
293
5
        if (!has_k) {
294
0
            state.k = State::NO_K;
295
0
        }
296
5
        int64_t size = 0;
297
5
        buf.read_binary(size);
298
5
        auto values = read_column(buf);
299
5
        DCHECK_EQ(static_cast<int64_t>(values->size()), size);
300
5
        DorisVector<int64_t> counts(static_cast<size_t>(size));
301
5
        if (size != 0) {
302
3
            buf.read(reinterpret_cast<char*>(counts.data()), size * sizeof(int64_t));
303
3
        }
304
5
        DorisVector<Entry> entries;
305
5
        entries.reserve(static_cast<size_t>(size));
306
10
        for (int64_t row = 0; row != size; ++row) {
307
5
            entries.push_back(Entry {value_at(*values, static_cast<size_t>(row)), counts[row]});
308
5
        }
309
5
        assign_sorted(state, std::move(entries));
310
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE
311
312
153
    void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override {
313
153
        const auto& state = Base::data(place);
314
153
        auto& result_array = assert_cast<ColumnArray&>(to);
315
        // The array element and both fields are nullable in the planned type, but a produced entry
316
        // never is.
317
153
        auto& pair_nullable = assert_cast<ColumnNullable&>(result_array.get_data());
318
153
        auto& pair_column = assert_cast<ColumnStruct&>(pair_nullable.get_nested_column());
319
153
        auto& value_column = assert_cast<ColumnNullable&>(pair_column.get_column(0));
320
153
        auto& count_column = assert_cast<ColumnNullable&>(pair_column.get_column(1));
321
153
        DorisVector<int32_t> order;
322
153
        collect_in_order(state, order);
323
1.41k
        for (int32_t slot : order) {
324
1.41k
            insert_value(value_column.get_nested_column(), value_of(state, slot));
325
1.41k
            value_column.get_null_map_data().push_back(0);
326
1.41k
            assert_cast<ColumnInt64&>(count_column.get_nested_column())
327
1.41k
                    .get_data()
328
1.41k
                    .push_back(state.slots[slot].count);
329
1.41k
            count_column.get_null_map_data().push_back(0);
330
1.41k
            pair_nullable.get_null_map_data().push_back(0);
331
1.41k
        }
332
153
        result_array.get_offsets().push_back(pair_column.size());
333
153
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE18insert_result_intoEPKcRNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Line
Count
Source
312
1
    void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override {
313
1
        const auto& state = Base::data(place);
314
1
        auto& result_array = assert_cast<ColumnArray&>(to);
315
        // The array element and both fields are nullable in the planned type, but a produced entry
316
        // never is.
317
1
        auto& pair_nullable = assert_cast<ColumnNullable&>(result_array.get_data());
318
1
        auto& pair_column = assert_cast<ColumnStruct&>(pair_nullable.get_nested_column());
319
1
        auto& value_column = assert_cast<ColumnNullable&>(pair_column.get_column(0));
320
1
        auto& count_column = assert_cast<ColumnNullable&>(pair_column.get_column(1));
321
1
        DorisVector<int32_t> order;
322
1
        collect_in_order(state, order);
323
1
        for (int32_t slot : order) {
324
1
            insert_value(value_column.get_nested_column(), value_of(state, slot));
325
1
            value_column.get_null_map_data().push_back(0);
326
1
            assert_cast<ColumnInt64&>(count_column.get_nested_column())
327
1
                    .get_data()
328
1
                    .push_back(state.slots[slot].count);
329
1
            count_column.get_null_map_data().push_back(0);
330
1
            pair_nullable.get_null_map_data().push_back(0);
331
1
        }
332
1
        result_array.get_offsets().push_back(pair_column.size());
333
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE18insert_result_intoEPKcRNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Line
Count
Source
312
63
    void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override {
313
63
        const auto& state = Base::data(place);
314
63
        auto& result_array = assert_cast<ColumnArray&>(to);
315
        // The array element and both fields are nullable in the planned type, but a produced entry
316
        // never is.
317
63
        auto& pair_nullable = assert_cast<ColumnNullable&>(result_array.get_data());
318
63
        auto& pair_column = assert_cast<ColumnStruct&>(pair_nullable.get_nested_column());
319
63
        auto& value_column = assert_cast<ColumnNullable&>(pair_column.get_column(0));
320
63
        auto& count_column = assert_cast<ColumnNullable&>(pair_column.get_column(1));
321
63
        DorisVector<int32_t> order;
322
63
        collect_in_order(state, order);
323
739
        for (int32_t slot : order) {
324
739
            insert_value(value_column.get_nested_column(), value_of(state, slot));
325
739
            value_column.get_null_map_data().push_back(0);
326
739
            assert_cast<ColumnInt64&>(count_column.get_nested_column())
327
739
                    .get_data()
328
739
                    .push_back(state.slots[slot].count);
329
739
            count_column.get_null_map_data().push_back(0);
330
739
            pair_nullable.get_null_map_data().push_back(0);
331
739
        }
332
63
        result_array.get_offsets().push_back(pair_column.size());
333
63
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE18insert_result_intoEPKcRNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Line
Count
Source
312
1
    void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override {
313
1
        const auto& state = Base::data(place);
314
1
        auto& result_array = assert_cast<ColumnArray&>(to);
315
        // The array element and both fields are nullable in the planned type, but a produced entry
316
        // never is.
317
1
        auto& pair_nullable = assert_cast<ColumnNullable&>(result_array.get_data());
318
1
        auto& pair_column = assert_cast<ColumnStruct&>(pair_nullable.get_nested_column());
319
1
        auto& value_column = assert_cast<ColumnNullable&>(pair_column.get_column(0));
320
1
        auto& count_column = assert_cast<ColumnNullable&>(pair_column.get_column(1));
321
1
        DorisVector<int32_t> order;
322
1
        collect_in_order(state, order);
323
3
        for (int32_t slot : order) {
324
3
            insert_value(value_column.get_nested_column(), value_of(state, slot));
325
3
            value_column.get_null_map_data().push_back(0);
326
3
            assert_cast<ColumnInt64&>(count_column.get_nested_column())
327
3
                    .get_data()
328
3
                    .push_back(state.slots[slot].count);
329
3
            count_column.get_null_map_data().push_back(0);
330
3
            pair_nullable.get_null_map_data().push_back(0);
331
3
        }
332
1
        result_array.get_offsets().push_back(pair_column.size());
333
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE18insert_result_intoEPKcRNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Line
Count
Source
312
6
    void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override {
313
6
        const auto& state = Base::data(place);
314
6
        auto& result_array = assert_cast<ColumnArray&>(to);
315
        // The array element and both fields are nullable in the planned type, but a produced entry
316
        // never is.
317
6
        auto& pair_nullable = assert_cast<ColumnNullable&>(result_array.get_data());
318
6
        auto& pair_column = assert_cast<ColumnStruct&>(pair_nullable.get_nested_column());
319
6
        auto& value_column = assert_cast<ColumnNullable&>(pair_column.get_column(0));
320
6
        auto& count_column = assert_cast<ColumnNullable&>(pair_column.get_column(1));
321
6
        DorisVector<int32_t> order;
322
6
        collect_in_order(state, order);
323
8
        for (int32_t slot : order) {
324
8
            insert_value(value_column.get_nested_column(), value_of(state, slot));
325
8
            value_column.get_null_map_data().push_back(0);
326
8
            assert_cast<ColumnInt64&>(count_column.get_nested_column())
327
8
                    .get_data()
328
8
                    .push_back(state.slots[slot].count);
329
8
            count_column.get_null_map_data().push_back(0);
330
8
            pair_nullable.get_null_map_data().push_back(0);
331
8
        }
332
6
        result_array.get_offsets().push_back(pair_column.size());
333
6
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE18insert_result_intoEPKcRNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Line
Count
Source
312
17
    void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override {
313
17
        const auto& state = Base::data(place);
314
17
        auto& result_array = assert_cast<ColumnArray&>(to);
315
        // The array element and both fields are nullable in the planned type, but a produced entry
316
        // never is.
317
17
        auto& pair_nullable = assert_cast<ColumnNullable&>(result_array.get_data());
318
17
        auto& pair_column = assert_cast<ColumnStruct&>(pair_nullable.get_nested_column());
319
17
        auto& value_column = assert_cast<ColumnNullable&>(pair_column.get_column(0));
320
17
        auto& count_column = assert_cast<ColumnNullable&>(pair_column.get_column(1));
321
17
        DorisVector<int32_t> order;
322
17
        collect_in_order(state, order);
323
44
        for (int32_t slot : order) {
324
44
            insert_value(value_column.get_nested_column(), value_of(state, slot));
325
44
            value_column.get_null_map_data().push_back(0);
326
44
            assert_cast<ColumnInt64&>(count_column.get_nested_column())
327
44
                    .get_data()
328
44
                    .push_back(state.slots[slot].count);
329
44
            count_column.get_null_map_data().push_back(0);
330
44
            pair_nullable.get_null_map_data().push_back(0);
331
44
        }
332
17
        result_array.get_offsets().push_back(pair_column.size());
333
17
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE18insert_result_intoEPKcRNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Line
Count
Source
312
5
    void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override {
313
5
        const auto& state = Base::data(place);
314
5
        auto& result_array = assert_cast<ColumnArray&>(to);
315
        // The array element and both fields are nullable in the planned type, but a produced entry
316
        // never is.
317
5
        auto& pair_nullable = assert_cast<ColumnNullable&>(result_array.get_data());
318
5
        auto& pair_column = assert_cast<ColumnStruct&>(pair_nullable.get_nested_column());
319
5
        auto& value_column = assert_cast<ColumnNullable&>(pair_column.get_column(0));
320
5
        auto& count_column = assert_cast<ColumnNullable&>(pair_column.get_column(1));
321
5
        DorisVector<int32_t> order;
322
5
        collect_in_order(state, order);
323
5
        for (int32_t slot : order) {
324
5
            insert_value(value_column.get_nested_column(), value_of(state, slot));
325
5
            value_column.get_null_map_data().push_back(0);
326
5
            assert_cast<ColumnInt64&>(count_column.get_nested_column())
327
5
                    .get_data()
328
5
                    .push_back(state.slots[slot].count);
329
5
            count_column.get_null_map_data().push_back(0);
330
5
            pair_nullable.get_null_map_data().push_back(0);
331
5
        }
332
5
        result_array.get_offsets().push_back(pair_column.size());
333
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE18insert_result_intoEPKcRNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Line
Count
Source
312
41
    void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override {
313
41
        const auto& state = Base::data(place);
314
41
        auto& result_array = assert_cast<ColumnArray&>(to);
315
        // The array element and both fields are nullable in the planned type, but a produced entry
316
        // never is.
317
41
        auto& pair_nullable = assert_cast<ColumnNullable&>(result_array.get_data());
318
41
        auto& pair_column = assert_cast<ColumnStruct&>(pair_nullable.get_nested_column());
319
41
        auto& value_column = assert_cast<ColumnNullable&>(pair_column.get_column(0));
320
41
        auto& count_column = assert_cast<ColumnNullable&>(pair_column.get_column(1));
321
41
        DorisVector<int32_t> order;
322
41
        collect_in_order(state, order);
323
585
        for (int32_t slot : order) {
324
585
            insert_value(value_column.get_nested_column(), value_of(state, slot));
325
585
            value_column.get_null_map_data().push_back(0);
326
585
            assert_cast<ColumnInt64&>(count_column.get_nested_column())
327
585
                    .get_data()
328
585
                    .push_back(state.slots[slot].count);
329
585
            count_column.get_null_map_data().push_back(0);
330
585
            pair_nullable.get_null_map_data().push_back(0);
331
585
        }
332
41
        result_array.get_offsets().push_back(pair_column.size());
333
41
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE18insert_result_intoEPKcRNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Line
Count
Source
312
1
    void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override {
313
1
        const auto& state = Base::data(place);
314
1
        auto& result_array = assert_cast<ColumnArray&>(to);
315
        // The array element and both fields are nullable in the planned type, but a produced entry
316
        // never is.
317
1
        auto& pair_nullable = assert_cast<ColumnNullable&>(result_array.get_data());
318
1
        auto& pair_column = assert_cast<ColumnStruct&>(pair_nullable.get_nested_column());
319
1
        auto& value_column = assert_cast<ColumnNullable&>(pair_column.get_column(0));
320
1
        auto& count_column = assert_cast<ColumnNullable&>(pair_column.get_column(1));
321
1
        DorisVector<int32_t> order;
322
1
        collect_in_order(state, order);
323
3
        for (int32_t slot : order) {
324
3
            insert_value(value_column.get_nested_column(), value_of(state, slot));
325
3
            value_column.get_null_map_data().push_back(0);
326
3
            assert_cast<ColumnInt64&>(count_column.get_nested_column())
327
3
                    .get_data()
328
3
                    .push_back(state.slots[slot].count);
329
3
            count_column.get_null_map_data().push_back(0);
330
3
            pair_nullable.get_null_map_data().push_back(0);
331
3
        }
332
1
        result_array.get_offsets().push_back(pair_column.size());
333
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE18insert_result_intoEPKcRNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Line
Count
Source
312
6
    void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override {
313
6
        const auto& state = Base::data(place);
314
6
        auto& result_array = assert_cast<ColumnArray&>(to);
315
        // The array element and both fields are nullable in the planned type, but a produced entry
316
        // never is.
317
6
        auto& pair_nullable = assert_cast<ColumnNullable&>(result_array.get_data());
318
6
        auto& pair_column = assert_cast<ColumnStruct&>(pair_nullable.get_nested_column());
319
6
        auto& value_column = assert_cast<ColumnNullable&>(pair_column.get_column(0));
320
6
        auto& count_column = assert_cast<ColumnNullable&>(pair_column.get_column(1));
321
6
        DorisVector<int32_t> order;
322
6
        collect_in_order(state, order);
323
8
        for (int32_t slot : order) {
324
8
            insert_value(value_column.get_nested_column(), value_of(state, slot));
325
8
            value_column.get_null_map_data().push_back(0);
326
8
            assert_cast<ColumnInt64&>(count_column.get_nested_column())
327
8
                    .get_data()
328
8
                    .push_back(state.slots[slot].count);
329
8
            count_column.get_null_map_data().push_back(0);
330
8
            pair_nullable.get_null_map_data().push_back(0);
331
8
        }
332
6
        result_array.get_offsets().push_back(pair_column.size());
333
6
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE18insert_result_intoEPKcRNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Line
Count
Source
312
7
    void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override {
313
7
        const auto& state = Base::data(place);
314
7
        auto& result_array = assert_cast<ColumnArray&>(to);
315
        // The array element and both fields are nullable in the planned type, but a produced entry
316
        // never is.
317
7
        auto& pair_nullable = assert_cast<ColumnNullable&>(result_array.get_data());
318
7
        auto& pair_column = assert_cast<ColumnStruct&>(pair_nullable.get_nested_column());
319
7
        auto& value_column = assert_cast<ColumnNullable&>(pair_column.get_column(0));
320
7
        auto& count_column = assert_cast<ColumnNullable&>(pair_column.get_column(1));
321
7
        DorisVector<int32_t> order;
322
7
        collect_in_order(state, order);
323
10
        for (int32_t slot : order) {
324
10
            insert_value(value_column.get_nested_column(), value_of(state, slot));
325
10
            value_column.get_null_map_data().push_back(0);
326
10
            assert_cast<ColumnInt64&>(count_column.get_nested_column())
327
10
                    .get_data()
328
10
                    .push_back(state.slots[slot].count);
329
10
            count_column.get_null_map_data().push_back(0);
330
10
            pair_nullable.get_null_map_data().push_back(0);
331
10
        }
332
7
        result_array.get_offsets().push_back(pair_column.size());
333
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE18insert_result_intoEPKcRNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Line
Count
Source
312
5
    void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override {
313
5
        const auto& state = Base::data(place);
314
5
        auto& result_array = assert_cast<ColumnArray&>(to);
315
        // The array element and both fields are nullable in the planned type, but a produced entry
316
        // never is.
317
5
        auto& pair_nullable = assert_cast<ColumnNullable&>(result_array.get_data());
318
5
        auto& pair_column = assert_cast<ColumnStruct&>(pair_nullable.get_nested_column());
319
5
        auto& value_column = assert_cast<ColumnNullable&>(pair_column.get_column(0));
320
5
        auto& count_column = assert_cast<ColumnNullable&>(pair_column.get_column(1));
321
5
        DorisVector<int32_t> order;
322
5
        collect_in_order(state, order);
323
5
        for (int32_t slot : order) {
324
5
            insert_value(value_column.get_nested_column(), value_of(state, slot));
325
5
            value_column.get_null_map_data().push_back(0);
326
5
            assert_cast<ColumnInt64&>(count_column.get_nested_column())
327
5
                    .get_data()
328
5
                    .push_back(state.slots[slot].count);
329
5
            count_column.get_null_map_data().push_back(0);
330
5
            pair_nullable.get_null_map_data().push_back(0);
331
5
        }
332
5
        result_array.get_offsets().push_back(pair_column.size());
333
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE18insert_result_intoEPKcRNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE18insert_result_intoEPKcRNS_7IColumnE
334
335
525
    static DataTypePtr make_return_type(const DataTypePtr& value_type) {
336
        // Both fields are nullable in the planned type: a consumer reads a field through
337
        // element_at, which is always nullable, and named_struct then records nullable fields.
338
        // Produced entries never contain a NULL field.
339
525
        auto pair_type = std::make_shared<DataTypeStruct>(
340
525
                DataTypes {make_nullable(value_type),
341
525
                           make_nullable(std::make_shared<DataTypeInt64>())},
342
525
                Strings {"value", "count"});
343
        // ArrayType defaults contains_null to true on the FE side, so the pair element is nullable
344
        // in the planned type even though the aggregate never produces a NULL entry.
345
525
        return std::make_shared<DataTypeArray>(make_nullable(pair_type));
346
525
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
335
4
    static DataTypePtr make_return_type(const DataTypePtr& value_type) {
336
        // Both fields are nullable in the planned type: a consumer reads a field through
337
        // element_at, which is always nullable, and named_struct then records nullable fields.
338
        // Produced entries never contain a NULL field.
339
4
        auto pair_type = std::make_shared<DataTypeStruct>(
340
4
                DataTypes {make_nullable(value_type),
341
4
                           make_nullable(std::make_shared<DataTypeInt64>())},
342
4
                Strings {"value", "count"});
343
        // ArrayType defaults contains_null to true on the FE side, so the pair element is nullable
344
        // in the planned type even though the aggregate never produces a NULL entry.
345
4
        return std::make_shared<DataTypeArray>(make_nullable(pair_type));
346
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
335
208
    static DataTypePtr make_return_type(const DataTypePtr& value_type) {
336
        // Both fields are nullable in the planned type: a consumer reads a field through
337
        // element_at, which is always nullable, and named_struct then records nullable fields.
338
        // Produced entries never contain a NULL field.
339
208
        auto pair_type = std::make_shared<DataTypeStruct>(
340
208
                DataTypes {make_nullable(value_type),
341
208
                           make_nullable(std::make_shared<DataTypeInt64>())},
342
208
                Strings {"value", "count"});
343
        // ArrayType defaults contains_null to true on the FE side, so the pair element is nullable
344
        // in the planned type even though the aggregate never produces a NULL entry.
345
208
        return std::make_shared<DataTypeArray>(make_nullable(pair_type));
346
208
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
335
19
    static DataTypePtr make_return_type(const DataTypePtr& value_type) {
336
        // Both fields are nullable in the planned type: a consumer reads a field through
337
        // element_at, which is always nullable, and named_struct then records nullable fields.
338
        // Produced entries never contain a NULL field.
339
19
        auto pair_type = std::make_shared<DataTypeStruct>(
340
19
                DataTypes {make_nullable(value_type),
341
19
                           make_nullable(std::make_shared<DataTypeInt64>())},
342
19
                Strings {"value", "count"});
343
        // ArrayType defaults contains_null to true on the FE side, so the pair element is nullable
344
        // in the planned type even though the aggregate never produces a NULL entry.
345
19
        return std::make_shared<DataTypeArray>(make_nullable(pair_type));
346
19
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
335
24
    static DataTypePtr make_return_type(const DataTypePtr& value_type) {
336
        // Both fields are nullable in the planned type: a consumer reads a field through
337
        // element_at, which is always nullable, and named_struct then records nullable fields.
338
        // Produced entries never contain a NULL field.
339
24
        auto pair_type = std::make_shared<DataTypeStruct>(
340
24
                DataTypes {make_nullable(value_type),
341
24
                           make_nullable(std::make_shared<DataTypeInt64>())},
342
24
                Strings {"value", "count"});
343
        // ArrayType defaults contains_null to true on the FE side, so the pair element is nullable
344
        // in the planned type even though the aggregate never produces a NULL entry.
345
24
        return std::make_shared<DataTypeArray>(make_nullable(pair_type));
346
24
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
335
35
    static DataTypePtr make_return_type(const DataTypePtr& value_type) {
336
        // Both fields are nullable in the planned type: a consumer reads a field through
337
        // element_at, which is always nullable, and named_struct then records nullable fields.
338
        // Produced entries never contain a NULL field.
339
35
        auto pair_type = std::make_shared<DataTypeStruct>(
340
35
                DataTypes {make_nullable(value_type),
341
35
                           make_nullable(std::make_shared<DataTypeInt64>())},
342
35
                Strings {"value", "count"});
343
        // ArrayType defaults contains_null to true on the FE side, so the pair element is nullable
344
        // in the planned type even though the aggregate never produces a NULL entry.
345
35
        return std::make_shared<DataTypeArray>(make_nullable(pair_type));
346
35
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
335
19
    static DataTypePtr make_return_type(const DataTypePtr& value_type) {
336
        // Both fields are nullable in the planned type: a consumer reads a field through
337
        // element_at, which is always nullable, and named_struct then records nullable fields.
338
        // Produced entries never contain a NULL field.
339
19
        auto pair_type = std::make_shared<DataTypeStruct>(
340
19
                DataTypes {make_nullable(value_type),
341
19
                           make_nullable(std::make_shared<DataTypeInt64>())},
342
19
                Strings {"value", "count"});
343
        // ArrayType defaults contains_null to true on the FE side, so the pair element is nullable
344
        // in the planned type even though the aggregate never produces a NULL entry.
345
19
        return std::make_shared<DataTypeArray>(make_nullable(pair_type));
346
19
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
335
129
    static DataTypePtr make_return_type(const DataTypePtr& value_type) {
336
        // Both fields are nullable in the planned type: a consumer reads a field through
337
        // element_at, which is always nullable, and named_struct then records nullable fields.
338
        // Produced entries never contain a NULL field.
339
129
        auto pair_type = std::make_shared<DataTypeStruct>(
340
129
                DataTypes {make_nullable(value_type),
341
129
                           make_nullable(std::make_shared<DataTypeInt64>())},
342
129
                Strings {"value", "count"});
343
        // ArrayType defaults contains_null to true on the FE side, so the pair element is nullable
344
        // in the planned type even though the aggregate never produces a NULL entry.
345
129
        return std::make_shared<DataTypeArray>(make_nullable(pair_type));
346
129
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
335
19
    static DataTypePtr make_return_type(const DataTypePtr& value_type) {
336
        // Both fields are nullable in the planned type: a consumer reads a field through
337
        // element_at, which is always nullable, and named_struct then records nullable fields.
338
        // Produced entries never contain a NULL field.
339
19
        auto pair_type = std::make_shared<DataTypeStruct>(
340
19
                DataTypes {make_nullable(value_type),
341
19
                           make_nullable(std::make_shared<DataTypeInt64>())},
342
19
                Strings {"value", "count"});
343
        // ArrayType defaults contains_null to true on the FE side, so the pair element is nullable
344
        // in the planned type even though the aggregate never produces a NULL entry.
345
19
        return std::make_shared<DataTypeArray>(make_nullable(pair_type));
346
19
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
335
24
    static DataTypePtr make_return_type(const DataTypePtr& value_type) {
336
        // Both fields are nullable in the planned type: a consumer reads a field through
337
        // element_at, which is always nullable, and named_struct then records nullable fields.
338
        // Produced entries never contain a NULL field.
339
24
        auto pair_type = std::make_shared<DataTypeStruct>(
340
24
                DataTypes {make_nullable(value_type),
341
24
                           make_nullable(std::make_shared<DataTypeInt64>())},
342
24
                Strings {"value", "count"});
343
        // ArrayType defaults contains_null to true on the FE side, so the pair element is nullable
344
        // in the planned type even though the aggregate never produces a NULL entry.
345
24
        return std::make_shared<DataTypeArray>(make_nullable(pair_type));
346
24
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
335
25
    static DataTypePtr make_return_type(const DataTypePtr& value_type) {
336
        // Both fields are nullable in the planned type: a consumer reads a field through
337
        // element_at, which is always nullable, and named_struct then records nullable fields.
338
        // Produced entries never contain a NULL field.
339
25
        auto pair_type = std::make_shared<DataTypeStruct>(
340
25
                DataTypes {make_nullable(value_type),
341
25
                           make_nullable(std::make_shared<DataTypeInt64>())},
342
25
                Strings {"value", "count"});
343
        // ArrayType defaults contains_null to true on the FE side, so the pair element is nullable
344
        // in the planned type even though the aggregate never produces a NULL entry.
345
25
        return std::make_shared<DataTypeArray>(make_nullable(pair_type));
346
25
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Line
Count
Source
335
19
    static DataTypePtr make_return_type(const DataTypePtr& value_type) {
336
        // Both fields are nullable in the planned type: a consumer reads a field through
337
        // element_at, which is always nullable, and named_struct then records nullable fields.
338
        // Produced entries never contain a NULL field.
339
19
        auto pair_type = std::make_shared<DataTypeStruct>(
340
19
                DataTypes {make_nullable(value_type),
341
19
                           make_nullable(std::make_shared<DataTypeInt64>())},
342
19
                Strings {"value", "count"});
343
        // ArrayType defaults contains_null to true on the FE side, so the pair element is nullable
344
        // in the planned type even though the aggregate never produces a NULL entry.
345
19
        return std::make_shared<DataTypeArray>(make_nullable(pair_type));
346
19
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE16make_return_typeERKSt10shared_ptrIKNS_9IDataTypeEE
347
348
private:
349
    /// The value of the row in `column`. The returned view is valid while the column is alive.
350
23.0k
    static ValueRef value_at(const IColumn& column, size_t row_num) {
351
23.0k
        if constexpr (IS_STRING) {
352
194
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column).get_data_at(
353
194
                    row_num);
354
22.8k
        } else {
355
22.8k
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column)
356
22.8k
                    .get_data()[row_num];
357
22.8k
        }
358
23.0k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE8value_atERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE8value_atERKNS_7IColumnEm
Line
Count
Source
350
1
    static ValueRef value_at(const IColumn& column, size_t row_num) {
351
        if constexpr (IS_STRING) {
352
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column).get_data_at(
353
                    row_num);
354
1
        } else {
355
1
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column)
356
1
                    .get_data()[row_num];
357
1
        }
358
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE8value_atERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE8value_atERKNS_7IColumnEm
Line
Count
Source
350
12.2k
    static ValueRef value_at(const IColumn& column, size_t row_num) {
351
        if constexpr (IS_STRING) {
352
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column).get_data_at(
353
                    row_num);
354
12.2k
        } else {
355
12.2k
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column)
356
12.2k
                    .get_data()[row_num];
357
12.2k
        }
358
12.2k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE8value_atERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE8value_atERKNS_7IColumnEm
Line
Count
Source
350
8
    static ValueRef value_at(const IColumn& column, size_t row_num) {
351
        if constexpr (IS_STRING) {
352
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column).get_data_at(
353
                    row_num);
354
8
        } else {
355
8
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column)
356
8
                    .get_data()[row_num];
357
8
        }
358
8
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE8value_atERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE8value_atERKNS_7IColumnEm
Line
Count
Source
350
55
    static ValueRef value_at(const IColumn& column, size_t row_num) {
351
        if constexpr (IS_STRING) {
352
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column).get_data_at(
353
                    row_num);
354
55
        } else {
355
55
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column)
356
55
                    .get_data()[row_num];
357
55
        }
358
55
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE8value_atERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE8value_atERKNS_7IColumnEm
Line
Count
Source
350
120
    static ValueRef value_at(const IColumn& column, size_t row_num) {
351
120
        if constexpr (IS_STRING) {
352
120
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column).get_data_at(
353
120
                    row_num);
354
        } else {
355
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column)
356
                    .get_data()[row_num];
357
        }
358
120
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE8value_atERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE8value_atERKNS_7IColumnEm
Line
Count
Source
350
20
    static ValueRef value_at(const IColumn& column, size_t row_num) {
351
        if constexpr (IS_STRING) {
352
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column).get_data_at(
353
                    row_num);
354
20
        } else {
355
20
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column)
356
20
                    .get_data()[row_num];
357
20
        }
358
20
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE8value_atERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE8value_atERKNS_7IColumnEm
Line
Count
Source
350
10.3k
    static ValueRef value_at(const IColumn& column, size_t row_num) {
351
        if constexpr (IS_STRING) {
352
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column).get_data_at(
353
                    row_num);
354
10.3k
        } else {
355
10.3k
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column)
356
10.3k
                    .get_data()[row_num];
357
10.3k
        }
358
10.3k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE8value_atERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE8value_atERKNS_7IColumnEm
Line
Count
Source
350
8
    static ValueRef value_at(const IColumn& column, size_t row_num) {
351
        if constexpr (IS_STRING) {
352
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column).get_data_at(
353
                    row_num);
354
8
        } else {
355
8
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column)
356
8
                    .get_data()[row_num];
357
8
        }
358
8
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE8value_atERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE8value_atERKNS_7IColumnEm
Line
Count
Source
350
63
    static ValueRef value_at(const IColumn& column, size_t row_num) {
351
        if constexpr (IS_STRING) {
352
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column).get_data_at(
353
                    row_num);
354
63
        } else {
355
63
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column)
356
63
                    .get_data()[row_num];
357
63
        }
358
63
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE8value_atERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE8value_atERKNS_7IColumnEm
Line
Count
Source
350
74
    static ValueRef value_at(const IColumn& column, size_t row_num) {
351
74
        if constexpr (IS_STRING) {
352
74
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column).get_data_at(
353
74
                    row_num);
354
        } else {
355
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column)
356
                    .get_data()[row_num];
357
        }
358
74
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE8value_atERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE8value_atERKNS_7IColumnEm
Line
Count
Source
350
26
    static ValueRef value_at(const IColumn& column, size_t row_num) {
351
        if constexpr (IS_STRING) {
352
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column).get_data_at(
353
                    row_num);
354
26
        } else {
355
26
            return assert_cast<const ColumnType&, TypeCheckOnRelease::DISABLE>(column)
356
26
                    .get_data()[row_num];
357
26
        }
358
26
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE8value_atERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE8value_atERKNS_7IColumnEm
359
360
    /// Exactly the comparison the value column would apply: CompareFloat for FLOAT/DOUBLE through
361
    /// Compare::compare (the column uses the same helper), the same memcmp helper ColumnString
362
    /// uses for strings, and the column's scale-independent ordering for every other type.
363
39.4k
    static int compare_values(ValueRef lhs, ValueRef rhs) {
364
39.4k
        if constexpr (IS_STRING) {
365
230
            return memcmp_small_allow_overflow15(
366
230
                    reinterpret_cast<const uint8_t*>(lhs.data), lhs.size,
367
230
                    reinterpret_cast<const uint8_t*>(rhs.data), rhs.size);
368
39.2k
        } else {
369
39.2k
            return Compare::compare(lhs, rhs);
370
39.2k
        }
371
39.4k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE14compare_valuesERKhS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE14compare_valuesERKaS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE14compare_valuesERKsS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE14compare_valuesERKiS4_
Line
Count
Source
363
24.9k
    static int compare_values(ValueRef lhs, ValueRef rhs) {
364
        if constexpr (IS_STRING) {
365
            return memcmp_small_allow_overflow15(
366
                    reinterpret_cast<const uint8_t*>(lhs.data), lhs.size,
367
                    reinterpret_cast<const uint8_t*>(rhs.data), rhs.size);
368
24.9k
        } else {
369
24.9k
            return Compare::compare(lhs, rhs);
370
24.9k
        }
371
24.9k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE14compare_valuesERKlS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE14compare_valuesERKnS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE14compare_valuesERKfS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE14compare_valuesERKdS4_
Line
Count
Source
363
8
    static int compare_values(ValueRef lhs, ValueRef rhs) {
364
        if constexpr (IS_STRING) {
365
            return memcmp_small_allow_overflow15(
366
                    reinterpret_cast<const uint8_t*>(lhs.data), lhs.size,
367
                    reinterpret_cast<const uint8_t*>(rhs.data), rhs.size);
368
8
        } else {
369
8
            return Compare::compare(lhs, rhs);
370
8
        }
371
8
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE14compare_valuesERKNS_7DecimalIiEES6_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE14compare_valuesERKNS_7DecimalIlEES6_
Line
Count
Source
363
52
    static int compare_values(ValueRef lhs, ValueRef rhs) {
364
        if constexpr (IS_STRING) {
365
            return memcmp_small_allow_overflow15(
366
                    reinterpret_cast<const uint8_t*>(lhs.data), lhs.size,
367
                    reinterpret_cast<const uint8_t*>(rhs.data), rhs.size);
368
52
        } else {
369
52
            return Compare::compare(lhs, rhs);
370
52
        }
371
52
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE14compare_valuesERKNS_14DecimalV2ValueES5_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE14compare_valuesERKNS_12Decimal128V3ES5_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE14compare_valuesERKNS_7DecimalIN4wide7integerILm256EiEEEES9_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE14compare_valuesENS_9StringRefES3_
Line
Count
Source
363
150
    static int compare_values(ValueRef lhs, ValueRef rhs) {
364
150
        if constexpr (IS_STRING) {
365
150
            return memcmp_small_allow_overflow15(
366
150
                    reinterpret_cast<const uint8_t*>(lhs.data), lhs.size,
367
150
                    reinterpret_cast<const uint8_t*>(rhs.data), rhs.size);
368
        } else {
369
            return Compare::compare(lhs, rhs);
370
        }
371
150
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE14compare_valuesERKNS_16VecDateTimeValueES5_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE14compare_valuesERKNS_16VecDateTimeValueES5_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE14compare_valuesERKNS_11DateV2ValueINS_15DateV2ValueTypeEEES7_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE14compare_valuesERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEES7_
Line
Count
Source
363
14
    static int compare_values(ValueRef lhs, ValueRef rhs) {
364
        if constexpr (IS_STRING) {
365
            return memcmp_small_allow_overflow15(
366
                    reinterpret_cast<const uint8_t*>(lhs.data), lhs.size,
367
                    reinterpret_cast<const uint8_t*>(rhs.data), rhs.size);
368
14
        } else {
369
14
            return Compare::compare(lhs, rhs);
370
14
        }
371
14
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE14compare_valuesERKdS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE14compare_valuesERKNS_16TimeStampNsValueES5_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE14compare_valuesERKNS_16TimestampTzValueES5_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE14compare_valuesERKjS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE14compare_valuesERKoS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE14compare_valuesERKoS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE14compare_valuesERKhS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE14compare_valuesERKaS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE14compare_valuesERKsS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE14compare_valuesERKiS4_
Line
Count
Source
363
14.1k
    static int compare_values(ValueRef lhs, ValueRef rhs) {
364
        if constexpr (IS_STRING) {
365
            return memcmp_small_allow_overflow15(
366
                    reinterpret_cast<const uint8_t*>(lhs.data), lhs.size,
367
                    reinterpret_cast<const uint8_t*>(rhs.data), rhs.size);
368
14.1k
        } else {
369
14.1k
            return Compare::compare(lhs, rhs);
370
14.1k
        }
371
14.1k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE14compare_valuesERKlS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE14compare_valuesERKnS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE14compare_valuesERKfS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE14compare_valuesERKdS4_
Line
Count
Source
363
8
    static int compare_values(ValueRef lhs, ValueRef rhs) {
364
        if constexpr (IS_STRING) {
365
            return memcmp_small_allow_overflow15(
366
                    reinterpret_cast<const uint8_t*>(lhs.data), lhs.size,
367
                    reinterpret_cast<const uint8_t*>(rhs.data), rhs.size);
368
8
        } else {
369
8
            return Compare::compare(lhs, rhs);
370
8
        }
371
8
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE14compare_valuesERKNS_7DecimalIiEES6_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE14compare_valuesERKNS_7DecimalIlEES6_
Line
Count
Source
363
63
    static int compare_values(ValueRef lhs, ValueRef rhs) {
364
        if constexpr (IS_STRING) {
365
            return memcmp_small_allow_overflow15(
366
                    reinterpret_cast<const uint8_t*>(lhs.data), lhs.size,
367
                    reinterpret_cast<const uint8_t*>(rhs.data), rhs.size);
368
63
        } else {
369
63
            return Compare::compare(lhs, rhs);
370
63
        }
371
63
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE14compare_valuesERKNS_14DecimalV2ValueES5_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE14compare_valuesERKNS_12Decimal128V3ES5_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE14compare_valuesERKNS_7DecimalIN4wide7integerILm256EiEEEES9_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE14compare_valuesENS_9StringRefES3_
Line
Count
Source
363
80
    static int compare_values(ValueRef lhs, ValueRef rhs) {
364
80
        if constexpr (IS_STRING) {
365
80
            return memcmp_small_allow_overflow15(
366
80
                    reinterpret_cast<const uint8_t*>(lhs.data), lhs.size,
367
80
                    reinterpret_cast<const uint8_t*>(rhs.data), rhs.size);
368
        } else {
369
            return Compare::compare(lhs, rhs);
370
        }
371
80
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE14compare_valuesERKNS_16VecDateTimeValueES5_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE14compare_valuesERKNS_16VecDateTimeValueES5_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE14compare_valuesERKNS_11DateV2ValueINS_15DateV2ValueTypeEEES7_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE14compare_valuesERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEES7_
Line
Count
Source
363
24
    static int compare_values(ValueRef lhs, ValueRef rhs) {
364
        if constexpr (IS_STRING) {
365
            return memcmp_small_allow_overflow15(
366
                    reinterpret_cast<const uint8_t*>(lhs.data), lhs.size,
367
                    reinterpret_cast<const uint8_t*>(rhs.data), rhs.size);
368
24
        } else {
369
24
            return Compare::compare(lhs, rhs);
370
24
        }
371
24
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE14compare_valuesERKdS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE14compare_valuesERKNS_16TimeStampNsValueES5_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE14compare_valuesERKNS_16TimestampTzValueES5_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE14compare_valuesERKjS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE14compare_valuesERKoS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE14compare_valuesERKoS4_
372
373
    /// The value stored in `slot`.
374
43.9k
    static ValueRef value_of(const State& state, int32_t slot) {
375
43.9k
        const Payload& payload = state.slots[slot].payload;
376
43.9k
        if constexpr (IS_STRING) {
377
402
            return StringRef(state.bytes.data() + payload.offset, payload.length);
378
43.5k
        } else {
379
43.5k
            return payload;
380
43.5k
        }
381
43.9k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_2EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_3EEEi
Line
Count
Source
374
1
    static ValueRef value_of(const State& state, int32_t slot) {
375
1
        const Payload& payload = state.slots[slot].payload;
376
        if constexpr (IS_STRING) {
377
            return StringRef(state.bytes.data() + payload.offset, payload.length);
378
1
        } else {
379
1
            return payload;
380
1
        }
381
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_4EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_5EEEi
Line
Count
Source
374
27.7k
    static ValueRef value_of(const State& state, int32_t slot) {
375
27.7k
        const Payload& payload = state.slots[slot].payload;
376
        if constexpr (IS_STRING) {
377
            return StringRef(state.bytes.data() + payload.offset, payload.length);
378
27.7k
        } else {
379
27.7k
            return payload;
380
27.7k
        }
381
27.7k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_6EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_7EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_8EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_9EEEi
Line
Count
Source
374
19
    static ValueRef value_of(const State& state, int32_t slot) {
375
19
        const Payload& payload = state.slots[slot].payload;
376
        if constexpr (IS_STRING) {
377
            return StringRef(state.bytes.data() + payload.offset, payload.length);
378
19
        } else {
379
19
            return payload;
380
19
        }
381
19
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_28EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_29EEEi
Line
Count
Source
374
85
    static ValueRef value_of(const State& state, int32_t slot) {
375
85
        const Payload& payload = state.slots[slot].payload;
376
        if constexpr (IS_STRING) {
377
            return StringRef(state.bytes.data() + payload.offset, payload.length);
378
85
        } else {
379
85
            return payload;
380
85
        }
381
85
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_20EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_30EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_35EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_10EEEi
Line
Count
Source
374
278
    static ValueRef value_of(const State& state, int32_t slot) {
375
278
        const Payload& payload = state.slots[slot].payload;
376
278
        if constexpr (IS_STRING) {
377
278
            return StringRef(state.bytes.data() + payload.offset, payload.length);
378
        } else {
379
            return payload;
380
        }
381
278
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_11EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_12EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_25EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_26EEEi
Line
Count
Source
374
31
    static ValueRef value_of(const State& state, int32_t slot) {
375
31
        const Payload& payload = state.slots[slot].payload;
376
        if constexpr (IS_STRING) {
377
            return StringRef(state.bytes.data() + payload.offset, payload.length);
378
31
        } else {
379
31
            return payload;
380
31
        }
381
31
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_27EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_43EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_42EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_36EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_37EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE8value_ofERKNS_22AggregateTopKCountDataILS1_44EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_2EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_3EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_4EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_5EEEi
Line
Count
Source
374
15.5k
    static ValueRef value_of(const State& state, int32_t slot) {
375
15.5k
        const Payload& payload = state.slots[slot].payload;
376
        if constexpr (IS_STRING) {
377
            return StringRef(state.bytes.data() + payload.offset, payload.length);
378
15.5k
        } else {
379
15.5k
            return payload;
380
15.5k
        }
381
15.5k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_6EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_7EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_8EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_9EEEi
Line
Count
Source
374
19
    static ValueRef value_of(const State& state, int32_t slot) {
375
19
        const Payload& payload = state.slots[slot].payload;
376
        if constexpr (IS_STRING) {
377
            return StringRef(state.bytes.data() + payload.offset, payload.length);
378
19
        } else {
379
19
            return payload;
380
19
        }
381
19
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_28EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_29EEEi
Line
Count
Source
374
102
    static ValueRef value_of(const State& state, int32_t slot) {
375
102
        const Payload& payload = state.slots[slot].payload;
376
        if constexpr (IS_STRING) {
377
            return StringRef(state.bytes.data() + payload.offset, payload.length);
378
102
        } else {
379
102
            return payload;
380
102
        }
381
102
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_20EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_30EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_35EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_10EEEi
Line
Count
Source
374
124
    static ValueRef value_of(const State& state, int32_t slot) {
375
124
        const Payload& payload = state.slots[slot].payload;
376
124
        if constexpr (IS_STRING) {
377
124
            return StringRef(state.bytes.data() + payload.offset, payload.length);
378
        } else {
379
            return payload;
380
        }
381
124
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_11EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_12EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_25EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_26EEEi
Line
Count
Source
374
43
    static ValueRef value_of(const State& state, int32_t slot) {
375
43
        const Payload& payload = state.slots[slot].payload;
376
        if constexpr (IS_STRING) {
377
            return StringRef(state.bytes.data() + payload.offset, payload.length);
378
43
        } else {
379
43
            return payload;
380
43
        }
381
43
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_27EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_43EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_42EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_36EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_37EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE8value_ofERKNS_22AggregateTopKCountDataILS1_44EEEi
382
383
    /// Copies `value` into `slot`'s payload, appending its bytes to the arena for strings.
384
3.38k
    static void set_value(State& state, int32_t slot, ValueRef value) {
385
3.38k
        if constexpr (IS_STRING) {
386
95
            Payload& payload = state.slots[slot].payload;
387
95
            payload.offset = state.bytes.size();
388
95
            payload.length = value.size;
389
95
            if (value.size != 0) {
390
95
                state.bytes.insert(value.data, value.data + value.size);
391
95
            }
392
95
            state.live_payload_bytes += value.size;
393
3.29k
        } else {
394
3.29k
            state.slots[slot].payload = value;
395
3.29k
        }
396
3.38k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_2EEEiRKh
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_3EEEiRKa
Line
Count
Source
384
1
    static void set_value(State& state, int32_t slot, ValueRef value) {
385
        if constexpr (IS_STRING) {
386
            Payload& payload = state.slots[slot].payload;
387
            payload.offset = state.bytes.size();
388
            payload.length = value.size;
389
            if (value.size != 0) {
390
                state.bytes.insert(value.data, value.data + value.size);
391
            }
392
            state.live_payload_bytes += value.size;
393
1
        } else {
394
1
            state.slots[slot].payload = value;
395
1
        }
396
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_4EEEiRKs
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_5EEEiRKi
Line
Count
Source
384
2.44k
    static void set_value(State& state, int32_t slot, ValueRef value) {
385
        if constexpr (IS_STRING) {
386
            Payload& payload = state.slots[slot].payload;
387
            payload.offset = state.bytes.size();
388
            payload.length = value.size;
389
            if (value.size != 0) {
390
                state.bytes.insert(value.data, value.data + value.size);
391
            }
392
            state.live_payload_bytes += value.size;
393
2.44k
        } else {
394
2.44k
            state.slots[slot].payload = value;
395
2.44k
        }
396
2.44k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_6EEEiRKl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_7EEEiRKn
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_8EEEiRKf
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_9EEEiRKd
Line
Count
Source
384
3
    static void set_value(State& state, int32_t slot, ValueRef value) {
385
        if constexpr (IS_STRING) {
386
            Payload& payload = state.slots[slot].payload;
387
            payload.offset = state.bytes.size();
388
            payload.length = value.size;
389
            if (value.size != 0) {
390
                state.bytes.insert(value.data, value.data + value.size);
391
            }
392
            state.live_payload_bytes += value.size;
393
3
        } else {
394
3
            state.slots[slot].payload = value;
395
3
        }
396
3
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_28EEEiRKNS_7DecimalIiEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_29EEEiRKNS_7DecimalIlEE
Line
Count
Source
384
16
    static void set_value(State& state, int32_t slot, ValueRef value) {
385
        if constexpr (IS_STRING) {
386
            Payload& payload = state.slots[slot].payload;
387
            payload.offset = state.bytes.size();
388
            payload.length = value.size;
389
            if (value.size != 0) {
390
                state.bytes.insert(value.data, value.data + value.size);
391
            }
392
            state.live_payload_bytes += value.size;
393
16
        } else {
394
16
            state.slots[slot].payload = value;
395
16
        }
396
16
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_20EEEiRKNS_14DecimalV2ValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_30EEEiRKNS_12Decimal128V3E
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_35EEEiRKNS_7DecimalIN4wide7integerILm256EiEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_10EEEiNS_9StringRefE
Line
Count
Source
384
62
    static void set_value(State& state, int32_t slot, ValueRef value) {
385
62
        if constexpr (IS_STRING) {
386
62
            Payload& payload = state.slots[slot].payload;
387
62
            payload.offset = state.bytes.size();
388
62
            payload.length = value.size;
389
62
            if (value.size != 0) {
390
62
                state.bytes.insert(value.data, value.data + value.size);
391
62
            }
392
62
            state.live_payload_bytes += value.size;
393
        } else {
394
            state.slots[slot].payload = value;
395
        }
396
62
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_11EEEiRKNS_16VecDateTimeValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_12EEEiRKNS_16VecDateTimeValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_25EEEiRKNS_11DateV2ValueINS_15DateV2ValueTypeEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_26EEEiRKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE
Line
Count
Source
384
7
    static void set_value(State& state, int32_t slot, ValueRef value) {
385
        if constexpr (IS_STRING) {
386
            Payload& payload = state.slots[slot].payload;
387
            payload.offset = state.bytes.size();
388
            payload.length = value.size;
389
            if (value.size != 0) {
390
                state.bytes.insert(value.data, value.data + value.size);
391
            }
392
            state.live_payload_bytes += value.size;
393
7
        } else {
394
7
            state.slots[slot].payload = value;
395
7
        }
396
7
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_27EEEiRKd
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_43EEEiRKNS_16TimeStampNsValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_42EEEiRKNS_16TimestampTzValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_36EEEiRKj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_37EEEiRKo
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE9set_valueERNS_22AggregateTopKCountDataILS1_44EEEiRKo
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_2EEEiRKh
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_3EEEiRKa
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_4EEEiRKs
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_5EEEiRKi
Line
Count
Source
384
780
    static void set_value(State& state, int32_t slot, ValueRef value) {
385
        if constexpr (IS_STRING) {
386
            Payload& payload = state.slots[slot].payload;
387
            payload.offset = state.bytes.size();
388
            payload.length = value.size;
389
            if (value.size != 0) {
390
                state.bytes.insert(value.data, value.data + value.size);
391
            }
392
            state.live_payload_bytes += value.size;
393
780
        } else {
394
780
            state.slots[slot].payload = value;
395
780
        }
396
780
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_6EEEiRKl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_7EEEiRKn
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_8EEEiRKf
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_9EEEiRKd
Line
Count
Source
384
3
    static void set_value(State& state, int32_t slot, ValueRef value) {
385
        if constexpr (IS_STRING) {
386
            Payload& payload = state.slots[slot].payload;
387
            payload.offset = state.bytes.size();
388
            payload.length = value.size;
389
            if (value.size != 0) {
390
                state.bytes.insert(value.data, value.data + value.size);
391
            }
392
            state.live_payload_bytes += value.size;
393
3
        } else {
394
3
            state.slots[slot].payload = value;
395
3
        }
396
3
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_28EEEiRKNS_7DecimalIiEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_29EEEiRKNS_7DecimalIlEE
Line
Count
Source
384
26
    static void set_value(State& state, int32_t slot, ValueRef value) {
385
        if constexpr (IS_STRING) {
386
            Payload& payload = state.slots[slot].payload;
387
            payload.offset = state.bytes.size();
388
            payload.length = value.size;
389
            if (value.size != 0) {
390
                state.bytes.insert(value.data, value.data + value.size);
391
            }
392
            state.live_payload_bytes += value.size;
393
26
        } else {
394
26
            state.slots[slot].payload = value;
395
26
        }
396
26
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_20EEEiRKNS_14DecimalV2ValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_30EEEiRKNS_12Decimal128V3E
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_35EEEiRKNS_7DecimalIN4wide7integerILm256EiEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_10EEEiNS_9StringRefE
Line
Count
Source
384
33
    static void set_value(State& state, int32_t slot, ValueRef value) {
385
33
        if constexpr (IS_STRING) {
386
33
            Payload& payload = state.slots[slot].payload;
387
33
            payload.offset = state.bytes.size();
388
33
            payload.length = value.size;
389
33
            if (value.size != 0) {
390
33
                state.bytes.insert(value.data, value.data + value.size);
391
33
            }
392
33
            state.live_payload_bytes += value.size;
393
        } else {
394
            state.slots[slot].payload = value;
395
        }
396
33
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_11EEEiRKNS_16VecDateTimeValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_12EEEiRKNS_16VecDateTimeValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_25EEEiRKNS_11DateV2ValueINS_15DateV2ValueTypeEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_26EEEiRKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE
Line
Count
Source
384
12
    static void set_value(State& state, int32_t slot, ValueRef value) {
385
        if constexpr (IS_STRING) {
386
            Payload& payload = state.slots[slot].payload;
387
            payload.offset = state.bytes.size();
388
            payload.length = value.size;
389
            if (value.size != 0) {
390
                state.bytes.insert(value.data, value.data + value.size);
391
            }
392
            state.live_payload_bytes += value.size;
393
12
        } else {
394
12
            state.slots[slot].payload = value;
395
12
        }
396
12
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_27EEEiRKd
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_43EEEiRKNS_16TimeStampNsValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_42EEEiRKNS_16TimestampTzValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_36EEEiRKj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_37EEEiRKo
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE9set_valueERNS_22AggregateTopKCountDataILS1_44EEEiRKo
397
398
    /// Replaces the state's only stored value (the k == 0 replace path). A string's arena is reset
399
    /// with it, so the discarded bytes do not accumulate across replacements.
400
8
    static void replace_value(State& state, int32_t slot, ValueRef value) {
401
8
        if constexpr (IS_STRING) {
402
0
            state.bytes.clear();
403
0
            state.live_payload_bytes = 0;
404
0
            state.dead_payload_bytes = 0;
405
0
        }
406
8
        set_value(state, slot, value);
407
8
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_2EEEiRKh
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_3EEEiRKa
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_4EEEiRKs
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_5EEEiRKi
Line
Count
Source
400
2
    static void replace_value(State& state, int32_t slot, ValueRef value) {
401
        if constexpr (IS_STRING) {
402
            state.bytes.clear();
403
            state.live_payload_bytes = 0;
404
            state.dead_payload_bytes = 0;
405
        }
406
2
        set_value(state, slot, value);
407
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_6EEEiRKl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_7EEEiRKn
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_8EEEiRKf
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_9EEEiRKd
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_28EEEiRKNS_7DecimalIiEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_29EEEiRKNS_7DecimalIlEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_20EEEiRKNS_14DecimalV2ValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_30EEEiRKNS_12Decimal128V3E
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_35EEEiRKNS_7DecimalIN4wide7integerILm256EiEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_10EEEiNS_9StringRefE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_11EEEiRKNS_16VecDateTimeValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_12EEEiRKNS_16VecDateTimeValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_25EEEiRKNS_11DateV2ValueINS_15DateV2ValueTypeEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_26EEEiRKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_27EEEiRKd
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_43EEEiRKNS_16TimeStampNsValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_42EEEiRKNS_16TimestampTzValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_36EEEiRKj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_37EEEiRKo
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE13replace_valueERNS_22AggregateTopKCountDataILS1_44EEEiRKo
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_2EEEiRKh
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_3EEEiRKa
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_4EEEiRKs
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_5EEEiRKi
Line
Count
Source
400
6
    static void replace_value(State& state, int32_t slot, ValueRef value) {
401
        if constexpr (IS_STRING) {
402
            state.bytes.clear();
403
            state.live_payload_bytes = 0;
404
            state.dead_payload_bytes = 0;
405
        }
406
6
        set_value(state, slot, value);
407
6
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_6EEEiRKl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_7EEEiRKn
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_8EEEiRKf
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_9EEEiRKd
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_28EEEiRKNS_7DecimalIiEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_29EEEiRKNS_7DecimalIlEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_20EEEiRKNS_14DecimalV2ValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_30EEEiRKNS_12Decimal128V3E
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_35EEEiRKNS_7DecimalIN4wide7integerILm256EiEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_10EEEiNS_9StringRefE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_11EEEiRKNS_16VecDateTimeValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_12EEEiRKNS_16VecDateTimeValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_25EEEiRKNS_11DateV2ValueINS_15DateV2ValueTypeEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_26EEEiRKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_27EEEiRKd
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_43EEEiRKNS_16TimeStampNsValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_42EEEiRKNS_16TimestampTzValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_36EEEiRKj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_37EEEiRKo
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE13replace_valueERNS_22AggregateTopKCountDataILS1_44EEEiRKo
408
409
    /// Called when `slot` is evicted: a string's bytes stay in the arena until the next compaction.
410
1.95k
    static void evict_value(State& state, int32_t slot) {
411
1.95k
        if constexpr (IS_STRING) {
412
32
            const size_t length = state.slots[slot].payload.length;
413
32
            state.live_payload_bytes -= length;
414
32
            state.dead_payload_bytes += length;
415
32
        }
416
1.95k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_2EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_3EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_4EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_5EEEi
Line
Count
Source
410
1.73k
    static void evict_value(State& state, int32_t slot) {
411
        if constexpr (IS_STRING) {
412
            const size_t length = state.slots[slot].payload.length;
413
            state.live_payload_bytes -= length;
414
            state.dead_payload_bytes += length;
415
        }
416
1.73k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_6EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_7EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_8EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_9EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_28EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_29EEEi
Line
Count
Source
410
4
    static void evict_value(State& state, int32_t slot) {
411
        if constexpr (IS_STRING) {
412
            const size_t length = state.slots[slot].payload.length;
413
            state.live_payload_bytes -= length;
414
            state.dead_payload_bytes += length;
415
        }
416
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_20EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_30EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_35EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_10EEEi
Line
Count
Source
410
13
    static void evict_value(State& state, int32_t slot) {
411
13
        if constexpr (IS_STRING) {
412
13
            const size_t length = state.slots[slot].payload.length;
413
13
            state.live_payload_bytes -= length;
414
13
            state.dead_payload_bytes += length;
415
13
        }
416
13
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_11EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_12EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_25EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_26EEEi
Line
Count
Source
410
1
    static void evict_value(State& state, int32_t slot) {
411
        if constexpr (IS_STRING) {
412
            const size_t length = state.slots[slot].payload.length;
413
            state.live_payload_bytes -= length;
414
            state.dead_payload_bytes += length;
415
        }
416
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_27EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_43EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_42EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_36EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_37EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE11evict_valueERNS_22AggregateTopKCountDataILS1_44EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_2EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_3EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_4EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_5EEEi
Line
Count
Source
410
161
    static void evict_value(State& state, int32_t slot) {
411
        if constexpr (IS_STRING) {
412
            const size_t length = state.slots[slot].payload.length;
413
            state.live_payload_bytes -= length;
414
            state.dead_payload_bytes += length;
415
        }
416
161
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_6EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_7EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_8EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_9EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_28EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_29EEEi
Line
Count
Source
410
14
    static void evict_value(State& state, int32_t slot) {
411
        if constexpr (IS_STRING) {
412
            const size_t length = state.slots[slot].payload.length;
413
            state.live_payload_bytes -= length;
414
            state.dead_payload_bytes += length;
415
        }
416
14
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_20EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_30EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_35EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_10EEEi
Line
Count
Source
410
19
    static void evict_value(State& state, int32_t slot) {
411
19
        if constexpr (IS_STRING) {
412
19
            const size_t length = state.slots[slot].payload.length;
413
19
            state.live_payload_bytes -= length;
414
19
            state.dead_payload_bytes += length;
415
19
        }
416
19
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_11EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_12EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_25EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_26EEEi
Line
Count
Source
410
6
    static void evict_value(State& state, int32_t slot) {
411
        if constexpr (IS_STRING) {
412
            const size_t length = state.slots[slot].payload.length;
413
            state.live_payload_bytes -= length;
414
            state.dead_payload_bytes += length;
415
        }
416
6
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_27EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_43EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_42EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_36EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_37EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE11evict_valueERNS_22AggregateTopKCountDataILS1_44EEEi
417
418
    /// Whether the discarded string payload outgrew the live one and a compaction should reclaim it.
419
22.6k
    static bool evicted_payload_exceeds_live(const State& state) {
420
22.6k
        if constexpr (IS_STRING) {
421
161
            return state.dead_payload_bytes > state.live_payload_bytes;
422
161
        }
423
0
        return false;
424
22.6k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_2EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_3EEE
Line
Count
Source
419
1
    static bool evicted_payload_exceeds_live(const State& state) {
420
        if constexpr (IS_STRING) {
421
            return state.dead_payload_bytes > state.live_payload_bytes;
422
        }
423
1
        return false;
424
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_4EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_5EEE
Line
Count
Source
419
12.0k
    static bool evicted_payload_exceeds_live(const State& state) {
420
        if constexpr (IS_STRING) {
421
            return state.dead_payload_bytes > state.live_payload_bytes;
422
        }
423
12.0k
        return false;
424
12.0k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_6EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_7EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_8EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_9EEE
Line
Count
Source
419
5
    static bool evicted_payload_exceeds_live(const State& state) {
420
        if constexpr (IS_STRING) {
421
            return state.dead_payload_bytes > state.live_payload_bytes;
422
        }
423
5
        return false;
424
5
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_28EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_29EEE
Line
Count
Source
419
42
    static bool evicted_payload_exceeds_live(const State& state) {
420
        if constexpr (IS_STRING) {
421
            return state.dead_payload_bytes > state.live_payload_bytes;
422
        }
423
42
        return false;
424
42
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_20EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_30EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_35EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_10EEE
Line
Count
Source
419
102
    static bool evicted_payload_exceeds_live(const State& state) {
420
102
        if constexpr (IS_STRING) {
421
102
            return state.dead_payload_bytes > state.live_payload_bytes;
422
102
        }
423
0
        return false;
424
102
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_11EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_12EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_25EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_26EEE
Line
Count
Source
419
15
    static bool evicted_payload_exceeds_live(const State& state) {
420
        if constexpr (IS_STRING) {
421
            return state.dead_payload_bytes > state.live_payload_bytes;
422
        }
423
15
        return false;
424
15
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_27EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_43EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_42EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_36EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_37EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_44EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_2EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_3EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_4EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_5EEE
Line
Count
Source
419
10.2k
    static bool evicted_payload_exceeds_live(const State& state) {
420
        if constexpr (IS_STRING) {
421
            return state.dead_payload_bytes > state.live_payload_bytes;
422
        }
423
10.2k
        return false;
424
10.2k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_6EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_7EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_8EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_9EEE
Line
Count
Source
419
5
    static bool evicted_payload_exceeds_live(const State& state) {
420
        if constexpr (IS_STRING) {
421
            return state.dead_payload_bytes > state.live_payload_bytes;
422
        }
423
5
        return false;
424
5
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_28EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_29EEE
Line
Count
Source
419
49
    static bool evicted_payload_exceeds_live(const State& state) {
420
        if constexpr (IS_STRING) {
421
            return state.dead_payload_bytes > state.live_payload_bytes;
422
        }
423
49
        return false;
424
49
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_20EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_30EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_35EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_10EEE
Line
Count
Source
419
59
    static bool evicted_payload_exceeds_live(const State& state) {
420
59
        if constexpr (IS_STRING) {
421
59
            return state.dead_payload_bytes > state.live_payload_bytes;
422
59
        }
423
0
        return false;
424
59
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_11EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_12EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_25EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_26EEE
Line
Count
Source
419
19
    static bool evicted_payload_exceeds_live(const State& state) {
420
        if constexpr (IS_STRING) {
421
            return state.dead_payload_bytes > state.live_payload_bytes;
422
        }
423
19
        return false;
424
19
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_27EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_43EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_42EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_36EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_37EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE28evicted_payload_exceeds_liveERKNS_22AggregateTopKCountDataILS1_44EEE
425
426
3.38k
    static Slot make_slot(int64_t count, uint32_t priority) {
427
3.38k
        Slot slot;
428
3.38k
        slot.count = count;
429
3.38k
        slot.priority = priority;
430
3.38k
        return slot;
431
3.38k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE9make_slotElj
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE9make_slotElj
Line
Count
Source
426
1
    static Slot make_slot(int64_t count, uint32_t priority) {
427
1
        Slot slot;
428
1
        slot.count = count;
429
1
        slot.priority = priority;
430
1
        return slot;
431
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE9make_slotElj
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE9make_slotElj
Line
Count
Source
426
2.44k
    static Slot make_slot(int64_t count, uint32_t priority) {
427
2.44k
        Slot slot;
428
2.44k
        slot.count = count;
429
2.44k
        slot.priority = priority;
430
2.44k
        return slot;
431
2.44k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE9make_slotElj
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE9make_slotElj
Line
Count
Source
426
3
    static Slot make_slot(int64_t count, uint32_t priority) {
427
3
        Slot slot;
428
3
        slot.count = count;
429
3
        slot.priority = priority;
430
3
        return slot;
431
3
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE9make_slotElj
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE9make_slotElj
Line
Count
Source
426
16
    static Slot make_slot(int64_t count, uint32_t priority) {
427
16
        Slot slot;
428
16
        slot.count = count;
429
16
        slot.priority = priority;
430
16
        return slot;
431
16
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE9make_slotElj
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE9make_slotElj
Line
Count
Source
426
62
    static Slot make_slot(int64_t count, uint32_t priority) {
427
62
        Slot slot;
428
62
        slot.count = count;
429
62
        slot.priority = priority;
430
62
        return slot;
431
62
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE9make_slotElj
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE9make_slotElj
Line
Count
Source
426
7
    static Slot make_slot(int64_t count, uint32_t priority) {
427
7
        Slot slot;
428
7
        slot.count = count;
429
7
        slot.priority = priority;
430
7
        return slot;
431
7
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE9make_slotElj
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE9make_slotElj
Line
Count
Source
426
774
    static Slot make_slot(int64_t count, uint32_t priority) {
427
774
        Slot slot;
428
774
        slot.count = count;
429
774
        slot.priority = priority;
430
774
        return slot;
431
774
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE9make_slotElj
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE9make_slotElj
Line
Count
Source
426
3
    static Slot make_slot(int64_t count, uint32_t priority) {
427
3
        Slot slot;
428
3
        slot.count = count;
429
3
        slot.priority = priority;
430
3
        return slot;
431
3
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE9make_slotElj
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE9make_slotElj
Line
Count
Source
426
26
    static Slot make_slot(int64_t count, uint32_t priority) {
427
26
        Slot slot;
428
26
        slot.count = count;
429
26
        slot.priority = priority;
430
26
        return slot;
431
26
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE9make_slotElj
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE9make_slotElj
Line
Count
Source
426
33
    static Slot make_slot(int64_t count, uint32_t priority) {
427
33
        Slot slot;
428
33
        slot.count = count;
429
33
        slot.priority = priority;
430
33
        return slot;
431
33
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE9make_slotElj
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE9make_slotElj
Line
Count
Source
426
12
    static Slot make_slot(int64_t count, uint32_t priority) {
427
12
        Slot slot;
428
12
        slot.count = count;
429
12
        slot.priority = priority;
430
12
        return slot;
431
12
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE9make_slotElj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE9make_slotElj
432
433
1.68k
    static void insert_value(IColumn& column, ValueRef value) {
434
1.68k
        if constexpr (IS_STRING) {
435
82
            assert_cast<ColumnString&>(column).insert_data(value.data, value.size);
436
1.60k
        } else {
437
1.60k
            assert_cast<ColumnType&>(column).get_data().push_back(value);
438
1.60k
        }
439
1.68k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE12insert_valueERNS_7IColumnERKh
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE12insert_valueERNS_7IColumnERKa
Line
Count
Source
433
1
    static void insert_value(IColumn& column, ValueRef value) {
434
        if constexpr (IS_STRING) {
435
            assert_cast<ColumnString&>(column).insert_data(value.data, value.size);
436
1
        } else {
437
1
            assert_cast<ColumnType&>(column).get_data().push_back(value);
438
1
        }
439
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE12insert_valueERNS_7IColumnERKs
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE12insert_valueERNS_7IColumnERKi
Line
Count
Source
433
884
    static void insert_value(IColumn& column, ValueRef value) {
434
        if constexpr (IS_STRING) {
435
            assert_cast<ColumnString&>(column).insert_data(value.data, value.size);
436
884
        } else {
437
884
            assert_cast<ColumnType&>(column).get_data().push_back(value);
438
884
        }
439
884
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE12insert_valueERNS_7IColumnERKl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE12insert_valueERNS_7IColumnERKn
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE12insert_valueERNS_7IColumnERKf
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE12insert_valueERNS_7IColumnERKd
Line
Count
Source
433
6
    static void insert_value(IColumn& column, ValueRef value) {
434
        if constexpr (IS_STRING) {
435
            assert_cast<ColumnString&>(column).insert_data(value.data, value.size);
436
6
        } else {
437
6
            assert_cast<ColumnType&>(column).get_data().push_back(value);
438
6
        }
439
6
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE12insert_valueERNS_7IColumnERKNS_7DecimalIiEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE12insert_valueERNS_7IColumnERKNS_7DecimalIlEE
Line
Count
Source
433
18
    static void insert_value(IColumn& column, ValueRef value) {
434
        if constexpr (IS_STRING) {
435
            assert_cast<ColumnString&>(column).insert_data(value.data, value.size);
436
18
        } else {
437
18
            assert_cast<ColumnType&>(column).get_data().push_back(value);
438
18
        }
439
18
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE12insert_valueERNS_7IColumnERKNS_14DecimalV2ValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE12insert_valueERNS_7IColumnERKNS_12Decimal128V3E
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE12insert_valueERNS_7IColumnERKNS_7DecimalIN4wide7integerILm256EiEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE12insert_valueERNS_7IColumnENS_9StringRefE
Line
Count
Source
433
62
    static void insert_value(IColumn& column, ValueRef value) {
434
62
        if constexpr (IS_STRING) {
435
62
            assert_cast<ColumnString&>(column).insert_data(value.data, value.size);
436
        } else {
437
            assert_cast<ColumnType&>(column).get_data().push_back(value);
438
        }
439
62
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE12insert_valueERNS_7IColumnERKNS_16VecDateTimeValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE12insert_valueERNS_7IColumnERKNS_16VecDateTimeValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE12insert_valueERNS_7IColumnERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE12insert_valueERNS_7IColumnERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE
Line
Count
Source
433
10
    static void insert_value(IColumn& column, ValueRef value) {
434
        if constexpr (IS_STRING) {
435
            assert_cast<ColumnString&>(column).insert_data(value.data, value.size);
436
10
        } else {
437
10
            assert_cast<ColumnType&>(column).get_data().push_back(value);
438
10
        }
439
10
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE12insert_valueERNS_7IColumnERKd
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE12insert_valueERNS_7IColumnERKNS_16TimeStampNsValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE12insert_valueERNS_7IColumnERKNS_16TimestampTzValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE12insert_valueERNS_7IColumnERKj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE12insert_valueERNS_7IColumnERKo
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE12insert_valueERNS_7IColumnERKo
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE12insert_valueERNS_7IColumnERKh
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE12insert_valueERNS_7IColumnERKa
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE12insert_valueERNS_7IColumnERKs
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE12insert_valueERNS_7IColumnERKi
Line
Count
Source
433
647
    static void insert_value(IColumn& column, ValueRef value) {
434
        if constexpr (IS_STRING) {
435
            assert_cast<ColumnString&>(column).insert_data(value.data, value.size);
436
647
        } else {
437
647
            assert_cast<ColumnType&>(column).get_data().push_back(value);
438
647
        }
439
647
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE12insert_valueERNS_7IColumnERKl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE12insert_valueERNS_7IColumnERKn
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE12insert_valueERNS_7IColumnERKf
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE12insert_valueERNS_7IColumnERKd
Line
Count
Source
433
6
    static void insert_value(IColumn& column, ValueRef value) {
434
        if constexpr (IS_STRING) {
435
            assert_cast<ColumnString&>(column).insert_data(value.data, value.size);
436
6
        } else {
437
6
            assert_cast<ColumnType&>(column).get_data().push_back(value);
438
6
        }
439
6
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE12insert_valueERNS_7IColumnERKNS_7DecimalIiEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE12insert_valueERNS_7IColumnERKNS_7DecimalIlEE
Line
Count
Source
433
18
    static void insert_value(IColumn& column, ValueRef value) {
434
        if constexpr (IS_STRING) {
435
            assert_cast<ColumnString&>(column).insert_data(value.data, value.size);
436
18
        } else {
437
18
            assert_cast<ColumnType&>(column).get_data().push_back(value);
438
18
        }
439
18
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE12insert_valueERNS_7IColumnERKNS_14DecimalV2ValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE12insert_valueERNS_7IColumnERKNS_12Decimal128V3E
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE12insert_valueERNS_7IColumnERKNS_7DecimalIN4wide7integerILm256EiEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE12insert_valueERNS_7IColumnENS_9StringRefE
Line
Count
Source
433
20
    static void insert_value(IColumn& column, ValueRef value) {
434
20
        if constexpr (IS_STRING) {
435
20
            assert_cast<ColumnString&>(column).insert_data(value.data, value.size);
436
        } else {
437
            assert_cast<ColumnType&>(column).get_data().push_back(value);
438
        }
439
20
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE12insert_valueERNS_7IColumnERKNS_16VecDateTimeValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE12insert_valueERNS_7IColumnERKNS_16VecDateTimeValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE12insert_valueERNS_7IColumnERKNS_11DateV2ValueINS_15DateV2ValueTypeEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE12insert_valueERNS_7IColumnERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEE
Line
Count
Source
433
10
    static void insert_value(IColumn& column, ValueRef value) {
434
        if constexpr (IS_STRING) {
435
            assert_cast<ColumnString&>(column).insert_data(value.data, value.size);
436
10
        } else {
437
10
            assert_cast<ColumnType&>(column).get_data().push_back(value);
438
10
        }
439
10
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE12insert_valueERNS_7IColumnERKd
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE12insert_valueERNS_7IColumnERKNS_16TimeStampNsValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE12insert_valueERNS_7IColumnERKNS_16TimestampTzValueE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE12insert_valueERNS_7IColumnERKj
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE12insert_valueERNS_7IColumnERKo
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE12insert_valueERNS_7IColumnERKo
440
441
    /// True when `cmp` puts the left operand before the right one in the aggregate's order.
442
18.8k
    static bool comes_before(int cmp) { return IsMin ? cmp < 0 : cmp > 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE12comes_beforeEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE12comes_beforeEi
Line
Count
Source
442
14.6k
    static bool comes_before(int cmp) { return IsMin ? cmp < 0 : cmp > 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE12comes_beforeEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE12comes_beforeEi
Line
Count
Source
442
4
    static bool comes_before(int cmp) { return IsMin ? cmp < 0 : cmp > 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE12comes_beforeEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE12comes_beforeEi
Line
Count
Source
442
16
    static bool comes_before(int cmp) { return IsMin ? cmp < 0 : cmp > 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE12comes_beforeEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE12comes_beforeEi
Line
Count
Source
442
74
    static bool comes_before(int cmp) { return IsMin ? cmp < 0 : cmp > 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE12comes_beforeEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE12comes_beforeEi
Line
Count
Source
442
3
    static bool comes_before(int cmp) { return IsMin ? cmp < 0 : cmp > 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE12comes_beforeEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE12comes_beforeEi
Line
Count
Source
442
4.00k
    static bool comes_before(int cmp) { return IsMin ? cmp < 0 : cmp > 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE12comes_beforeEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE12comes_beforeEi
Line
Count
Source
442
4
    static bool comes_before(int cmp) { return IsMin ? cmp < 0 : cmp > 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE12comes_beforeEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE12comes_beforeEi
Line
Count
Source
442
29
    static bool comes_before(int cmp) { return IsMin ? cmp < 0 : cmp > 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE12comes_beforeEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE12comes_beforeEi
Line
Count
Source
442
40
    static bool comes_before(int cmp) { return IsMin ? cmp < 0 : cmp > 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE12comes_beforeEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE12comes_beforeEi
Line
Count
Source
442
12
    static bool comes_before(int cmp) { return IsMin ? cmp < 0 : cmp > 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE12comes_beforeEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE12comes_beforeEi
443
444
    /// True when `cmp`, which compares a value with the worst retained one, puts it after it: the
445
    /// value is worse and cannot enter the list.
446
20.5k
    static bool is_worse(int cmp) { return IsMin ? cmp > 0 : cmp < 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE8is_worseEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE8is_worseEi
Line
Count
Source
446
10.2k
    static bool is_worse(int cmp) { return IsMin ? cmp > 0 : cmp < 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE8is_worseEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE8is_worseEi
Line
Count
Source
446
2
    static bool is_worse(int cmp) { return IsMin ? cmp > 0 : cmp < 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE8is_worseEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE8is_worseEi
Line
Count
Source
446
27
    static bool is_worse(int cmp) { return IsMin ? cmp > 0 : cmp < 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE8is_worseEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE8is_worseEi
Line
Count
Source
446
67
    static bool is_worse(int cmp) { return IsMin ? cmp > 0 : cmp < 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE8is_worseEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE8is_worseEi
Line
Count
Source
446
11
    static bool is_worse(int cmp) { return IsMin ? cmp > 0 : cmp < 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE8is_worseEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE8is_worseEi
Line
Count
Source
446
10.0k
    static bool is_worse(int cmp) { return IsMin ? cmp > 0 : cmp < 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE8is_worseEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE8is_worseEi
Line
Count
Source
446
2
    static bool is_worse(int cmp) { return IsMin ? cmp > 0 : cmp < 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE8is_worseEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE8is_worseEi
Line
Count
Source
446
27
    static bool is_worse(int cmp) { return IsMin ? cmp > 0 : cmp < 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE8is_worseEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE8is_worseEi
Line
Count
Source
446
30
    static bool is_worse(int cmp) { return IsMin ? cmp > 0 : cmp < 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE8is_worseEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE8is_worseEi
Line
Count
Source
446
11
    static bool is_worse(int cmp) { return IsMin ? cmp > 0 : cmp < 0; }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE8is_worseEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE8is_worseEi
447
448
    /// splitmix32. The priorities only have to be independent enough to keep the treap balanced;
449
    /// a per-state sequence keeps the shape reproducible for the same insertion order.
450
5.13k
    static uint32_t next_priority(State& state) {
451
5.13k
        uint32_t z = (state.rng += 0x9E3779B9U);
452
5.13k
        z = (z ^ (z >> 16)) * 0x21F0AAADU;
453
5.13k
        z = (z ^ (z >> 15)) * 0x735A2D97U;
454
5.13k
        return z ^ (z >> 15);
455
5.13k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_2EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_3EEE
Line
Count
Source
450
1
    static uint32_t next_priority(State& state) {
451
1
        uint32_t z = (state.rng += 0x9E3779B9U);
452
1
        z = (z ^ (z >> 16)) * 0x21F0AAADU;
453
1
        z = (z ^ (z >> 15)) * 0x735A2D97U;
454
1
        return z ^ (z >> 15);
455
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_4EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_5EEE
Line
Count
Source
450
3.82k
    static uint32_t next_priority(State& state) {
451
3.82k
        uint32_t z = (state.rng += 0x9E3779B9U);
452
3.82k
        z = (z ^ (z >> 16)) * 0x21F0AAADU;
453
3.82k
        z = (z ^ (z >> 15)) * 0x735A2D97U;
454
3.82k
        return z ^ (z >> 15);
455
3.82k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_6EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_7EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_8EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_9EEE
Line
Count
Source
450
9
    static uint32_t next_priority(State& state) {
451
9
        uint32_t z = (state.rng += 0x9E3779B9U);
452
9
        z = (z ^ (z >> 16)) * 0x21F0AAADU;
453
9
        z = (z ^ (z >> 15)) * 0x735A2D97U;
454
9
        return z ^ (z >> 15);
455
9
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_28EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_29EEE
Line
Count
Source
450
34
    static uint32_t next_priority(State& state) {
451
34
        uint32_t z = (state.rng += 0x9E3779B9U);
452
34
        z = (z ^ (z >> 16)) * 0x21F0AAADU;
453
34
        z = (z ^ (z >> 15)) * 0x735A2D97U;
454
34
        return z ^ (z >> 15);
455
34
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_20EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_30EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_35EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_10EEE
Line
Count
Source
450
112
    static uint32_t next_priority(State& state) {
451
112
        uint32_t z = (state.rng += 0x9E3779B9U);
452
112
        z = (z ^ (z >> 16)) * 0x21F0AAADU;
453
112
        z = (z ^ (z >> 15)) * 0x735A2D97U;
454
112
        return z ^ (z >> 15);
455
112
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_11EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_12EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_25EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_26EEE
Line
Count
Source
450
16
    static uint32_t next_priority(State& state) {
451
16
        uint32_t z = (state.rng += 0x9E3779B9U);
452
16
        z = (z ^ (z >> 16)) * 0x21F0AAADU;
453
16
        z = (z ^ (z >> 15)) * 0x735A2D97U;
454
16
        return z ^ (z >> 15);
455
16
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_27EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_43EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_42EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_36EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_37EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE13next_priorityERNS_22AggregateTopKCountDataILS1_44EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_2EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_3EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_4EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_5EEE
Line
Count
Source
450
999
    static uint32_t next_priority(State& state) {
451
999
        uint32_t z = (state.rng += 0x9E3779B9U);
452
999
        z = (z ^ (z >> 16)) * 0x21F0AAADU;
453
999
        z = (z ^ (z >> 15)) * 0x735A2D97U;
454
999
        return z ^ (z >> 15);
455
999
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_6EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_7EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_8EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_9EEE
Line
Count
Source
450
9
    static uint32_t next_priority(State& state) {
451
9
        uint32_t z = (state.rng += 0x9E3779B9U);
452
9
        z = (z ^ (z >> 16)) * 0x21F0AAADU;
453
9
        z = (z ^ (z >> 15)) * 0x735A2D97U;
454
9
        return z ^ (z >> 15);
455
9
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_28EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_29EEE
Line
Count
Source
450
50
    static uint32_t next_priority(State& state) {
451
50
        uint32_t z = (state.rng += 0x9E3779B9U);
452
50
        z = (z ^ (z >> 16)) * 0x21F0AAADU;
453
50
        z = (z ^ (z >> 15)) * 0x735A2D97U;
454
50
        return z ^ (z >> 15);
455
50
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_20EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_30EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_35EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_10EEE
Line
Count
Source
450
59
    static uint32_t next_priority(State& state) {
451
59
        uint32_t z = (state.rng += 0x9E3779B9U);
452
59
        z = (z ^ (z >> 16)) * 0x21F0AAADU;
453
59
        z = (z ^ (z >> 15)) * 0x735A2D97U;
454
59
        return z ^ (z >> 15);
455
59
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_11EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_12EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_25EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_26EEE
Line
Count
Source
450
23
    static uint32_t next_priority(State& state) {
451
23
        uint32_t z = (state.rng += 0x9E3779B9U);
452
23
        z = (z ^ (z >> 16)) * 0x21F0AAADU;
453
23
        z = (z ^ (z >> 15)) * 0x735A2D97U;
454
23
        return z ^ (z >> 15);
455
23
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_27EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_43EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_42EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_36EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_37EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE13next_priorityERNS_22AggregateTopKCountDataILS1_44EEE
456
457
1.23k
    static int compare_slots(const State& state, int32_t lhs, int32_t rhs) {
458
1.23k
        return compare_values(value_of(state, lhs), value_of(state, rhs));
459
1.23k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_2EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_3EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_4EEEii
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_5EEEii
Line
Count
Source
457
632
    static int compare_slots(const State& state, int32_t lhs, int32_t rhs) {
458
632
        return compare_values(value_of(state, lhs), value_of(state, rhs));
459
632
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_6EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_7EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_8EEEii
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_9EEEii
Line
Count
Source
457
2
    static int compare_slots(const State& state, int32_t lhs, int32_t rhs) {
458
2
        return compare_values(value_of(state, lhs), value_of(state, rhs));
459
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_28EEEii
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_29EEEii
Line
Count
Source
457
4
    static int compare_slots(const State& state, int32_t lhs, int32_t rhs) {
458
4
        return compare_values(value_of(state, lhs), value_of(state, rhs));
459
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_20EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_30EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_35EEEii
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_10EEEii
Line
Count
Source
457
24
    static int compare_slots(const State& state, int32_t lhs, int32_t rhs) {
458
24
        return compare_values(value_of(state, lhs), value_of(state, rhs));
459
24
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_11EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_12EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_25EEEii
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_26EEEii
Line
Count
Source
457
2
    static int compare_slots(const State& state, int32_t lhs, int32_t rhs) {
458
2
        return compare_values(value_of(state, lhs), value_of(state, rhs));
459
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_27EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_43EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_42EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_36EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_37EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_44EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_2EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_3EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_4EEEii
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_5EEEii
Line
Count
Source
457
560
    static int compare_slots(const State& state, int32_t lhs, int32_t rhs) {
458
560
        return compare_values(value_of(state, lhs), value_of(state, rhs));
459
560
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_6EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_7EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_8EEEii
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_9EEEii
Line
Count
Source
457
2
    static int compare_slots(const State& state, int32_t lhs, int32_t rhs) {
458
2
        return compare_values(value_of(state, lhs), value_of(state, rhs));
459
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_28EEEii
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_29EEEii
Line
Count
Source
457
4
    static int compare_slots(const State& state, int32_t lhs, int32_t rhs) {
458
4
        return compare_values(value_of(state, lhs), value_of(state, rhs));
459
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_20EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_30EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_35EEEii
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_10EEEii
Line
Count
Source
457
5
    static int compare_slots(const State& state, int32_t lhs, int32_t rhs) {
458
5
        return compare_values(value_of(state, lhs), value_of(state, rhs));
459
5
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_11EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_12EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_25EEEii
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_26EEEii
Line
Count
Source
457
2
    static int compare_slots(const State& state, int32_t lhs, int32_t rhs) {
458
2
        return compare_values(value_of(state, lhs), value_of(state, rhs));
459
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_27EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_43EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_42EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_36EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_37EEEii
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE13compare_slotsERKNS_22AggregateTopKCountDataILS1_44EEEii
460
461
    /// The treap links are int32_t, so a state can index at most INT32_MAX + 1 slots.
462
    static constexpr size_t MAX_SLOTS =
463
            static_cast<size_t>(std::numeric_limits<int32_t>::max()) + 1;
464
465
    /// k has no upper bound and the FE cannot see the state size, so the representational limit is
466
    /// enforced where a state actually grows. A merge can exceed it as well: two states each
467
    /// within the limit can hold more distinct values together than one can index.
468
3.67k
    static void check_slot_capacity(size_t size) {
469
3.67k
        if (UNLIKELY(size > MAX_SLOTS)) {
470
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
471
0
                            "min_topk/max_topk cannot keep more than {} distinct values",
472
0
                            static_cast<int64_t>(MAX_SLOTS));
473
0
        }
474
3.67k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE19check_slot_capacityEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE19check_slot_capacityEm
Line
Count
Source
468
1
    static void check_slot_capacity(size_t size) {
469
1
        if (UNLIKELY(size > MAX_SLOTS)) {
470
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
471
0
                            "min_topk/max_topk cannot keep more than {} distinct values",
472
0
                            static_cast<int64_t>(MAX_SLOTS));
473
0
        }
474
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE19check_slot_capacityEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE19check_slot_capacityEm
Line
Count
Source
468
2.56k
    static void check_slot_capacity(size_t size) {
469
2.56k
        if (UNLIKELY(size > MAX_SLOTS)) {
470
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
471
0
                            "min_topk/max_topk cannot keep more than {} distinct values",
472
0
                            static_cast<int64_t>(MAX_SLOTS));
473
0
        }
474
2.56k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE19check_slot_capacityEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE19check_slot_capacityEm
Line
Count
Source
468
6
    static void check_slot_capacity(size_t size) {
469
6
        if (UNLIKELY(size > MAX_SLOTS)) {
470
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
471
0
                            "min_topk/max_topk cannot keep more than {} distinct values",
472
0
                            static_cast<int64_t>(MAX_SLOTS));
473
0
        }
474
6
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE19check_slot_capacityEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE19check_slot_capacityEm
Line
Count
Source
468
31
    static void check_slot_capacity(size_t size) {
469
31
        if (UNLIKELY(size > MAX_SLOTS)) {
470
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
471
0
                            "min_topk/max_topk cannot keep more than {} distinct values",
472
0
                            static_cast<int64_t>(MAX_SLOTS));
473
0
        }
474
31
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE19check_slot_capacityEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE19check_slot_capacityEm
Line
Count
Source
468
81
    static void check_slot_capacity(size_t size) {
469
81
        if (UNLIKELY(size > MAX_SLOTS)) {
470
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
471
0
                            "min_topk/max_topk cannot keep more than {} distinct values",
472
0
                            static_cast<int64_t>(MAX_SLOTS));
473
0
        }
474
81
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE19check_slot_capacityEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE19check_slot_capacityEm
Line
Count
Source
468
16
    static void check_slot_capacity(size_t size) {
469
16
        if (UNLIKELY(size > MAX_SLOTS)) {
470
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
471
0
                            "min_topk/max_topk cannot keep more than {} distinct values",
472
0
                            static_cast<int64_t>(MAX_SLOTS));
473
0
        }
474
16
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE19check_slot_capacityEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE19check_slot_capacityEm
Line
Count
Source
468
852
    static void check_slot_capacity(size_t size) {
469
852
        if (UNLIKELY(size > MAX_SLOTS)) {
470
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
471
0
                            "min_topk/max_topk cannot keep more than {} distinct values",
472
0
                            static_cast<int64_t>(MAX_SLOTS));
473
0
        }
474
852
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE19check_slot_capacityEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE19check_slot_capacityEm
Line
Count
Source
468
6
    static void check_slot_capacity(size_t size) {
469
6
        if (UNLIKELY(size > MAX_SLOTS)) {
470
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
471
0
                            "min_topk/max_topk cannot keep more than {} distinct values",
472
0
                            static_cast<int64_t>(MAX_SLOTS));
473
0
        }
474
6
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE19check_slot_capacityEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE19check_slot_capacityEm
Line
Count
Source
468
44
    static void check_slot_capacity(size_t size) {
469
44
        if (UNLIKELY(size > MAX_SLOTS)) {
470
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
471
0
                            "min_topk/max_topk cannot keep more than {} distinct values",
472
0
                            static_cast<int64_t>(MAX_SLOTS));
473
0
        }
474
44
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE19check_slot_capacityEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE19check_slot_capacityEm
Line
Count
Source
468
51
    static void check_slot_capacity(size_t size) {
469
51
        if (UNLIKELY(size > MAX_SLOTS)) {
470
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
471
0
                            "min_topk/max_topk cannot keep more than {} distinct values",
472
0
                            static_cast<int64_t>(MAX_SLOTS));
473
0
        }
474
51
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE19check_slot_capacityEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE19check_slot_capacityEm
Line
Count
Source
468
22
    static void check_slot_capacity(size_t size) {
469
22
        if (UNLIKELY(size > MAX_SLOTS)) {
470
0
            throw Exception(ErrorCode::INVALID_ARGUMENT,
471
0
                            "min_topk/max_topk cannot keep more than {} distinct values",
472
0
                            static_cast<int64_t>(MAX_SLOTS));
473
0
        }
474
22
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE19check_slot_capacityEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE19check_slot_capacityEm
475
476
    /// Appends (value, count) as the next slot.
477
3.37k
    static int32_t append_slot(State& state, ValueRef value, int64_t count) {
478
3.37k
        check_slot_capacity(state.slots.size() + 1);
479
3.37k
        auto slot = static_cast<int32_t>(state.slots.size());
480
3.37k
        state.slots.push_back(make_slot(count, next_priority(state)));
481
3.37k
        set_value(state, slot, value);
482
3.37k
        ++state.live;
483
3.37k
        return slot;
484
3.37k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_2EEERKhl
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_3EEERKal
Line
Count
Source
477
1
    static int32_t append_slot(State& state, ValueRef value, int64_t count) {
478
1
        check_slot_capacity(state.slots.size() + 1);
479
1
        auto slot = static_cast<int32_t>(state.slots.size());
480
1
        state.slots.push_back(make_slot(count, next_priority(state)));
481
1
        set_value(state, slot, value);
482
1
        ++state.live;
483
1
        return slot;
484
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_4EEERKsl
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_5EEERKil
Line
Count
Source
477
2.44k
    static int32_t append_slot(State& state, ValueRef value, int64_t count) {
478
2.44k
        check_slot_capacity(state.slots.size() + 1);
479
2.44k
        auto slot = static_cast<int32_t>(state.slots.size());
480
2.44k
        state.slots.push_back(make_slot(count, next_priority(state)));
481
2.44k
        set_value(state, slot, value);
482
2.44k
        ++state.live;
483
2.44k
        return slot;
484
2.44k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_6EEERKll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_7EEERKnl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_8EEERKfl
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_9EEERKdl
Line
Count
Source
477
3
    static int32_t append_slot(State& state, ValueRef value, int64_t count) {
478
3
        check_slot_capacity(state.slots.size() + 1);
479
3
        auto slot = static_cast<int32_t>(state.slots.size());
480
3
        state.slots.push_back(make_slot(count, next_priority(state)));
481
3
        set_value(state, slot, value);
482
3
        ++state.live;
483
3
        return slot;
484
3
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_28EEERKNS_7DecimalIiEEl
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_29EEERKNS_7DecimalIlEEl
Line
Count
Source
477
16
    static int32_t append_slot(State& state, ValueRef value, int64_t count) {
478
16
        check_slot_capacity(state.slots.size() + 1);
479
16
        auto slot = static_cast<int32_t>(state.slots.size());
480
16
        state.slots.push_back(make_slot(count, next_priority(state)));
481
16
        set_value(state, slot, value);
482
16
        ++state.live;
483
16
        return slot;
484
16
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_20EEERKNS_14DecimalV2ValueEl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_30EEERKNS_12Decimal128V3El
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_35EEERKNS_7DecimalIN4wide7integerILm256EiEEEEl
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_10EEENS_9StringRefEl
Line
Count
Source
477
62
    static int32_t append_slot(State& state, ValueRef value, int64_t count) {
478
62
        check_slot_capacity(state.slots.size() + 1);
479
62
        auto slot = static_cast<int32_t>(state.slots.size());
480
62
        state.slots.push_back(make_slot(count, next_priority(state)));
481
62
        set_value(state, slot, value);
482
62
        ++state.live;
483
62
        return slot;
484
62
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_11EEERKNS_16VecDateTimeValueEl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_12EEERKNS_16VecDateTimeValueEl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_25EEERKNS_11DateV2ValueINS_15DateV2ValueTypeEEEl
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_26EEERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEEl
Line
Count
Source
477
7
    static int32_t append_slot(State& state, ValueRef value, int64_t count) {
478
7
        check_slot_capacity(state.slots.size() + 1);
479
7
        auto slot = static_cast<int32_t>(state.slots.size());
480
7
        state.slots.push_back(make_slot(count, next_priority(state)));
481
7
        set_value(state, slot, value);
482
7
        ++state.live;
483
7
        return slot;
484
7
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_27EEERKdl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_43EEERKNS_16TimeStampNsValueEl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_42EEERKNS_16TimestampTzValueEl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_36EEERKjl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_37EEERKol
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_44EEERKol
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_2EEERKhl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_3EEERKal
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_4EEERKsl
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_5EEERKil
Line
Count
Source
477
774
    static int32_t append_slot(State& state, ValueRef value, int64_t count) {
478
774
        check_slot_capacity(state.slots.size() + 1);
479
774
        auto slot = static_cast<int32_t>(state.slots.size());
480
774
        state.slots.push_back(make_slot(count, next_priority(state)));
481
774
        set_value(state, slot, value);
482
774
        ++state.live;
483
774
        return slot;
484
774
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_6EEERKll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_7EEERKnl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_8EEERKfl
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_9EEERKdl
Line
Count
Source
477
3
    static int32_t append_slot(State& state, ValueRef value, int64_t count) {
478
3
        check_slot_capacity(state.slots.size() + 1);
479
3
        auto slot = static_cast<int32_t>(state.slots.size());
480
3
        state.slots.push_back(make_slot(count, next_priority(state)));
481
3
        set_value(state, slot, value);
482
3
        ++state.live;
483
3
        return slot;
484
3
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_28EEERKNS_7DecimalIiEEl
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_29EEERKNS_7DecimalIlEEl
Line
Count
Source
477
26
    static int32_t append_slot(State& state, ValueRef value, int64_t count) {
478
26
        check_slot_capacity(state.slots.size() + 1);
479
26
        auto slot = static_cast<int32_t>(state.slots.size());
480
26
        state.slots.push_back(make_slot(count, next_priority(state)));
481
26
        set_value(state, slot, value);
482
26
        ++state.live;
483
26
        return slot;
484
26
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_20EEERKNS_14DecimalV2ValueEl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_30EEERKNS_12Decimal128V3El
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_35EEERKNS_7DecimalIN4wide7integerILm256EiEEEEl
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_10EEENS_9StringRefEl
Line
Count
Source
477
32
    static int32_t append_slot(State& state, ValueRef value, int64_t count) {
478
32
        check_slot_capacity(state.slots.size() + 1);
479
32
        auto slot = static_cast<int32_t>(state.slots.size());
480
32
        state.slots.push_back(make_slot(count, next_priority(state)));
481
32
        set_value(state, slot, value);
482
32
        ++state.live;
483
32
        return slot;
484
32
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_11EEERKNS_16VecDateTimeValueEl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_12EEERKNS_16VecDateTimeValueEl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_25EEERKNS_11DateV2ValueINS_15DateV2ValueTypeEEEl
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_26EEERKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEEl
Line
Count
Source
477
12
    static int32_t append_slot(State& state, ValueRef value, int64_t count) {
478
12
        check_slot_capacity(state.slots.size() + 1);
479
12
        auto slot = static_cast<int32_t>(state.slots.size());
480
12
        state.slots.push_back(make_slot(count, next_priority(state)));
481
12
        set_value(state, slot, value);
482
12
        ++state.live;
483
12
        return slot;
484
12
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_27EEERKdl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_43EEERKNS_16TimeStampNsValueEl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_42EEERKNS_16TimestampTzValueEl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_36EEERKjl
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_37EEERKol
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_44EEERKol
485
486
11
    static int32_t append_slot(State& state, const IColumn& column, size_t row_num, int64_t count) {
487
11
        return append_slot(state, value_at(column, row_num), count);
488
11
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_2EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_3EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_4EEERKNS_7IColumnEml
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_5EEERKNS_7IColumnEml
Line
Count
Source
486
6
    static int32_t append_slot(State& state, const IColumn& column, size_t row_num, int64_t count) {
487
6
        return append_slot(state, value_at(column, row_num), count);
488
6
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_6EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_7EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_8EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_9EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_28EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_29EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_20EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_30EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_35EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_10EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_11EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_12EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_25EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_26EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_27EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_43EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_42EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_36EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_37EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE11append_slotERNS_22AggregateTopKCountDataILS1_44EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_2EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_3EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_4EEERKNS_7IColumnEml
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_5EEERKNS_7IColumnEml
Line
Count
Source
486
5
    static int32_t append_slot(State& state, const IColumn& column, size_t row_num, int64_t count) {
487
5
        return append_slot(state, value_at(column, row_num), count);
488
5
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_6EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_7EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_8EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_9EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_28EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_29EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_20EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_30EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_35EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_10EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_11EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_12EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_25EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_26EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_27EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_43EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_42EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_36EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_37EEERKNS_7IColumnEml
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE11append_slotERNS_22AggregateTopKCountDataILS1_44EEERKNS_7IColumnEml
489
490
    /// Rotates the subtree rooted at `node` right: the left child becomes the root and `node` its
491
    /// right child. The in-order sequence is unchanged, so the treap stays ordered.
492
2.38k
    static int32_t rotate_right(State& state, int32_t node) {
493
2.38k
        int32_t pivot = state.slots[node].left;
494
2.38k
        state.slots[node].left = state.slots[pivot].right;
495
2.38k
        state.slots[pivot].right = node;
496
2.38k
        return pivot;
497
2.38k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_2EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_3EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_4EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_5EEEi
Line
Count
Source
492
2.17k
    static int32_t rotate_right(State& state, int32_t node) {
493
2.17k
        int32_t pivot = state.slots[node].left;
494
2.17k
        state.slots[node].left = state.slots[pivot].right;
495
2.17k
        state.slots[pivot].right = node;
496
2.17k
        return pivot;
497
2.17k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_6EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_7EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_8EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_9EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_28EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_29EEEi
Line
Count
Source
492
3
    static int32_t rotate_right(State& state, int32_t node) {
493
3
        int32_t pivot = state.slots[node].left;
494
3
        state.slots[node].left = state.slots[pivot].right;
495
3
        state.slots[pivot].right = node;
496
3
        return pivot;
497
3
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_20EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_30EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_35EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_10EEEi
Line
Count
Source
492
15
    static int32_t rotate_right(State& state, int32_t node) {
493
15
        int32_t pivot = state.slots[node].left;
494
15
        state.slots[node].left = state.slots[pivot].right;
495
15
        state.slots[pivot].right = node;
496
15
        return pivot;
497
15
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_11EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_12EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_25EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_26EEEi
Line
Count
Source
492
2
    static int32_t rotate_right(State& state, int32_t node) {
493
2
        int32_t pivot = state.slots[node].left;
494
2
        state.slots[node].left = state.slots[pivot].right;
495
2
        state.slots[pivot].right = node;
496
2
        return pivot;
497
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_27EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_43EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_42EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_36EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_37EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE12rotate_rightERNS_22AggregateTopKCountDataILS1_44EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_2EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_3EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_4EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_5EEEi
Line
Count
Source
492
170
    static int32_t rotate_right(State& state, int32_t node) {
493
170
        int32_t pivot = state.slots[node].left;
494
170
        state.slots[node].left = state.slots[pivot].right;
495
170
        state.slots[pivot].right = node;
496
170
        return pivot;
497
170
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_6EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_7EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_8EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_9EEEi
Line
Count
Source
492
1
    static int32_t rotate_right(State& state, int32_t node) {
493
1
        int32_t pivot = state.slots[node].left;
494
1
        state.slots[node].left = state.slots[pivot].right;
495
1
        state.slots[pivot].right = node;
496
1
        return pivot;
497
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_28EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_29EEEi
Line
Count
Source
492
9
    static int32_t rotate_right(State& state, int32_t node) {
493
9
        int32_t pivot = state.slots[node].left;
494
9
        state.slots[node].left = state.slots[pivot].right;
495
9
        state.slots[pivot].right = node;
496
9
        return pivot;
497
9
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_20EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_30EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_35EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_10EEEi
Line
Count
Source
492
12
    static int32_t rotate_right(State& state, int32_t node) {
493
12
        int32_t pivot = state.slots[node].left;
494
12
        state.slots[node].left = state.slots[pivot].right;
495
12
        state.slots[pivot].right = node;
496
12
        return pivot;
497
12
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_11EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_12EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_25EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_26EEEi
Line
Count
Source
492
2
    static int32_t rotate_right(State& state, int32_t node) {
493
2
        int32_t pivot = state.slots[node].left;
494
2
        state.slots[node].left = state.slots[pivot].right;
495
2
        state.slots[pivot].right = node;
496
2
        return pivot;
497
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_27EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_43EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_42EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_36EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_37EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE12rotate_rightERNS_22AggregateTopKCountDataILS1_44EEEi
498
499
813
    static int32_t rotate_left(State& state, int32_t node) {
500
813
        int32_t pivot = state.slots[node].right;
501
813
        state.slots[node].right = state.slots[pivot].left;
502
813
        state.slots[pivot].left = node;
503
813
        return pivot;
504
813
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_2EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_3EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_4EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_5EEEi
Line
Count
Source
499
174
    static int32_t rotate_left(State& state, int32_t node) {
500
174
        int32_t pivot = state.slots[node].right;
501
174
        state.slots[node].right = state.slots[pivot].left;
502
174
        state.slots[pivot].left = node;
503
174
        return pivot;
504
174
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_6EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_7EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_8EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_9EEEi
Line
Count
Source
499
1
    static int32_t rotate_left(State& state, int32_t node) {
500
1
        int32_t pivot = state.slots[node].right;
501
1
        state.slots[node].right = state.slots[pivot].left;
502
1
        state.slots[pivot].left = node;
503
1
        return pivot;
504
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_28EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_29EEEi
Line
Count
Source
499
2
    static int32_t rotate_left(State& state, int32_t node) {
500
2
        int32_t pivot = state.slots[node].right;
501
2
        state.slots[node].right = state.slots[pivot].left;
502
2
        state.slots[pivot].left = node;
503
2
        return pivot;
504
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_20EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_30EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_35EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_10EEEi
Line
Count
Source
499
14
    static int32_t rotate_left(State& state, int32_t node) {
500
14
        int32_t pivot = state.slots[node].right;
501
14
        state.slots[node].right = state.slots[pivot].left;
502
14
        state.slots[pivot].left = node;
503
14
        return pivot;
504
14
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_11EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_12EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_25EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_26EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_27EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_43EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_42EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_36EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_37EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE11rotate_leftERNS_22AggregateTopKCountDataILS1_44EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_2EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_3EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_4EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_5EEEi
Line
Count
Source
499
608
    static int32_t rotate_left(State& state, int32_t node) {
500
608
        int32_t pivot = state.slots[node].right;
501
608
        state.slots[node].right = state.slots[pivot].left;
502
608
        state.slots[pivot].left = node;
503
608
        return pivot;
504
608
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_6EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_7EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_8EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_9EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_28EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_29EEEi
Line
Count
Source
499
2
    static int32_t rotate_left(State& state, int32_t node) {
500
2
        int32_t pivot = state.slots[node].right;
501
2
        state.slots[node].right = state.slots[pivot].left;
502
2
        state.slots[pivot].left = node;
503
2
        return pivot;
504
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_20EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_30EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_35EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_10EEEi
Line
Count
Source
499
10
    static int32_t rotate_left(State& state, int32_t node) {
500
10
        int32_t pivot = state.slots[node].right;
501
10
        state.slots[node].right = state.slots[pivot].left;
502
10
        state.slots[pivot].left = node;
503
10
        return pivot;
504
10
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_11EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_12EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_25EEEi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_26EEEi
Line
Count
Source
499
2
    static int32_t rotate_left(State& state, int32_t node) {
500
2
        int32_t pivot = state.slots[node].right;
501
2
        state.slots[node].right = state.slots[pivot].left;
502
2
        state.slots[pivot].left = node;
503
2
        return pivot;
504
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_27EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_43EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_42EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_36EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_37EEEi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE11rotate_leftERNS_22AggregateTopKCountDataILS1_44EEEi
505
506
    /// One descent that performs the whole per-row update: an equal value bumps its count and
507
    /// reports no insertion; a missing value is linked as a new slot at the leaf and rotated up
508
    /// while the recursion unwinds. `inserted_slot` receives the new slot, NO_SLOT on a hit.
509
    /// The count is the number of rows the caller adds (1 for add, the singleton's count for a
510
    /// merge).
511
    static int32_t add_or_increment(State& state, int32_t node, ValueRef value, int64_t count,
512
22.2k
                                    int32_t* inserted_slot) {
513
22.2k
        if (node == State::NO_SLOT) {
514
3.36k
            *inserted_slot = append_slot(state, value, count);
515
3.36k
            return *inserted_slot;
516
3.36k
        }
517
18.8k
        int cmp = compare_values(value_of(state, node), value);
518
18.8k
        if (cmp == 0) {
519
102
            state.slots[node].count = checked_add(state.slots[node].count, count);
520
102
            return node;
521
102
        }
522
18.7k
        if (comes_before(cmp)) {
523
            // The stored value is the better one, so the input belongs in the right subtree.
524
4.18k
            state.slots[node].right =
525
4.18k
                    add_or_increment(state, state.slots[node].right, value, count, inserted_slot);
526
4.18k
            if (state.slots[state.slots[node].right].priority > state.slots[node].priority) {
527
813
                return rotate_left(state, node);
528
813
            }
529
14.5k
        } else {
530
14.5k
            state.slots[node].left =
531
14.5k
                    add_or_increment(state, state.slots[node].left, value, count, inserted_slot);
532
14.5k
            if (state.slots[state.slots[node].left].priority > state.slots[node].priority) {
533
2.38k
                return rotate_right(state, node);
534
2.38k
            }
535
14.5k
        }
536
15.5k
        return node;
537
18.7k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_2EEEiRKhlPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_3EEEiRKalPi
Line
Count
Source
512
1
                                    int32_t* inserted_slot) {
513
1
        if (node == State::NO_SLOT) {
514
1
            *inserted_slot = append_slot(state, value, count);
515
1
            return *inserted_slot;
516
1
        }
517
0
        int cmp = compare_values(value_of(state, node), value);
518
0
        if (cmp == 0) {
519
0
            state.slots[node].count = checked_add(state.slots[node].count, count);
520
0
            return node;
521
0
        }
522
0
        if (comes_before(cmp)) {
523
            // The stored value is the better one, so the input belongs in the right subtree.
524
0
            state.slots[node].right =
525
0
                    add_or_increment(state, state.slots[node].right, value, count, inserted_slot);
526
0
            if (state.slots[state.slots[node].right].priority > state.slots[node].priority) {
527
0
                return rotate_left(state, node);
528
0
            }
529
0
        } else {
530
0
            state.slots[node].left =
531
0
                    add_or_increment(state, state.slots[node].left, value, count, inserted_slot);
532
0
            if (state.slots[state.slots[node].left].priority > state.slots[node].priority) {
533
0
                return rotate_right(state, node);
534
0
            }
535
0
        }
536
0
        return node;
537
0
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_4EEEiRKslPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_5EEEiRKilPi
Line
Count
Source
512
17.0k
                                    int32_t* inserted_slot) {
513
17.0k
        if (node == State::NO_SLOT) {
514
2.43k
            *inserted_slot = append_slot(state, value, count);
515
2.43k
            return *inserted_slot;
516
2.43k
        }
517
14.6k
        int cmp = compare_values(value_of(state, node), value);
518
14.6k
        if (cmp == 0) {
519
43
            state.slots[node].count = checked_add(state.slots[node].count, count);
520
43
            return node;
521
43
        }
522
14.6k
        if (comes_before(cmp)) {
523
            // The stored value is the better one, so the input belongs in the right subtree.
524
566
            state.slots[node].right =
525
566
                    add_or_increment(state, state.slots[node].right, value, count, inserted_slot);
526
566
            if (state.slots[state.slots[node].right].priority > state.slots[node].priority) {
527
174
                return rotate_left(state, node);
528
174
            }
529
14.0k
        } else {
530
14.0k
            state.slots[node].left =
531
14.0k
                    add_or_increment(state, state.slots[node].left, value, count, inserted_slot);
532
14.0k
            if (state.slots[state.slots[node].left].priority > state.slots[node].priority) {
533
2.17k
                return rotate_right(state, node);
534
2.17k
            }
535
14.0k
        }
536
12.2k
        return node;
537
14.6k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_6EEEiRKllPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_7EEEiRKnlPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_8EEEiRKflPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_9EEEiRKdlPi
Line
Count
Source
512
9
                                    int32_t* inserted_slot) {
513
9
        if (node == State::NO_SLOT) {
514
3
            *inserted_slot = append_slot(state, value, count);
515
3
            return *inserted_slot;
516
3
        }
517
6
        int cmp = compare_values(value_of(state, node), value);
518
6
        if (cmp == 0) {
519
2
            state.slots[node].count = checked_add(state.slots[node].count, count);
520
2
            return node;
521
2
        }
522
4
        if (comes_before(cmp)) {
523
            // The stored value is the better one, so the input belongs in the right subtree.
524
3
            state.slots[node].right =
525
3
                    add_or_increment(state, state.slots[node].right, value, count, inserted_slot);
526
3
            if (state.slots[state.slots[node].right].priority > state.slots[node].priority) {
527
1
                return rotate_left(state, node);
528
1
            }
529
3
        } else {
530
1
            state.slots[node].left =
531
1
                    add_or_increment(state, state.slots[node].left, value, count, inserted_slot);
532
1
            if (state.slots[state.slots[node].left].priority > state.slots[node].priority) {
533
0
                return rotate_right(state, node);
534
0
            }
535
1
        }
536
3
        return node;
537
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_28EEEiRKNS_7DecimalIiEElPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_29EEEiRKNS_7DecimalIlEElPi
Line
Count
Source
512
39
                                    int32_t* inserted_slot) {
513
39
        if (node == State::NO_SLOT) {
514
16
            *inserted_slot = append_slot(state, value, count);
515
16
            return *inserted_slot;
516
16
        }
517
23
        int cmp = compare_values(value_of(state, node), value);
518
23
        if (cmp == 0) {
519
9
            state.slots[node].count = checked_add(state.slots[node].count, count);
520
9
            return node;
521
9
        }
522
14
        if (comes_before(cmp)) {
523
            // The stored value is the better one, so the input belongs in the right subtree.
524
5
            state.slots[node].right =
525
5
                    add_or_increment(state, state.slots[node].right, value, count, inserted_slot);
526
5
            if (state.slots[state.slots[node].right].priority > state.slots[node].priority) {
527
2
                return rotate_left(state, node);
528
2
            }
529
9
        } else {
530
9
            state.slots[node].left =
531
9
                    add_or_increment(state, state.slots[node].left, value, count, inserted_slot);
532
9
            if (state.slots[state.slots[node].left].priority > state.slots[node].priority) {
533
3
                return rotate_right(state, node);
534
3
            }
535
9
        }
536
9
        return node;
537
14
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_20EEEiRKNS_14DecimalV2ValueElPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_30EEEiRKNS_12Decimal128V3ElPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_35EEEiRKNS_7DecimalIN4wide7integerILm256EiEEEElPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_10EEEiNS_9StringRefElPi
Line
Count
Source
512
142
                                    int32_t* inserted_slot) {
513
142
        if (node == State::NO_SLOT) {
514
62
            *inserted_slot = append_slot(state, value, count);
515
62
            return *inserted_slot;
516
62
        }
517
80
        int cmp = compare_values(value_of(state, node), value);
518
80
        if (cmp == 0) {
519
8
            state.slots[node].count = checked_add(state.slots[node].count, count);
520
8
            return node;
521
8
        }
522
72
        if (comes_before(cmp)) {
523
            // The stored value is the better one, so the input belongs in the right subtree.
524
40
            state.slots[node].right =
525
40
                    add_or_increment(state, state.slots[node].right, value, count, inserted_slot);
526
40
            if (state.slots[state.slots[node].right].priority > state.slots[node].priority) {
527
14
                return rotate_left(state, node);
528
14
            }
529
40
        } else {
530
32
            state.slots[node].left =
531
32
                    add_or_increment(state, state.slots[node].left, value, count, inserted_slot);
532
32
            if (state.slots[state.slots[node].left].priority > state.slots[node].priority) {
533
15
                return rotate_right(state, node);
534
15
            }
535
32
        }
536
43
        return node;
537
72
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_11EEEiRKNS_16VecDateTimeValueElPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_12EEEiRKNS_16VecDateTimeValueElPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_25EEEiRKNS_11DateV2ValueINS_15DateV2ValueTypeEEElPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_26EEEiRKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEElPi
Line
Count
Source
512
10
                                    int32_t* inserted_slot) {
513
10
        if (node == State::NO_SLOT) {
514
7
            *inserted_slot = append_slot(state, value, count);
515
7
            return *inserted_slot;
516
7
        }
517
3
        int cmp = compare_values(value_of(state, node), value);
518
3
        if (cmp == 0) {
519
0
            state.slots[node].count = checked_add(state.slots[node].count, count);
520
0
            return node;
521
0
        }
522
3
        if (comes_before(cmp)) {
523
            // The stored value is the better one, so the input belongs in the right subtree.
524
1
            state.slots[node].right =
525
1
                    add_or_increment(state, state.slots[node].right, value, count, inserted_slot);
526
1
            if (state.slots[state.slots[node].right].priority > state.slots[node].priority) {
527
0
                return rotate_left(state, node);
528
0
            }
529
2
        } else {
530
2
            state.slots[node].left =
531
2
                    add_or_increment(state, state.slots[node].left, value, count, inserted_slot);
532
2
            if (state.slots[state.slots[node].left].priority > state.slots[node].priority) {
533
2
                return rotate_right(state, node);
534
2
            }
535
2
        }
536
1
        return node;
537
3
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_27EEEiRKdlPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_43EEEiRKNS_16TimeStampNsValueElPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_42EEEiRKNS_16TimestampTzValueElPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_36EEEiRKjlPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_37EEEiRKolPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_44EEEiRKolPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_2EEEiRKhlPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_3EEEiRKalPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_4EEEiRKslPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_5EEEiRKilPi
Line
Count
Source
512
4.76k
                                    int32_t* inserted_slot) {
513
4.76k
        if (node == State::NO_SLOT) {
514
765
            *inserted_slot = append_slot(state, value, count);
515
765
            return *inserted_slot;
516
765
        }
517
4.00k
        int cmp = compare_values(value_of(state, node), value);
518
4.00k
        if (cmp == 0) {
519
23
            state.slots[node].count = checked_add(state.slots[node].count, count);
520
23
            return node;
521
23
        }
522
3.97k
        if (comes_before(cmp)) {
523
            // The stored value is the better one, so the input belongs in the right subtree.
524
3.55k
            state.slots[node].right =
525
3.55k
                    add_or_increment(state, state.slots[node].right, value, count, inserted_slot);
526
3.55k
            if (state.slots[state.slots[node].right].priority > state.slots[node].priority) {
527
608
                return rotate_left(state, node);
528
608
            }
529
3.55k
        } else {
530
427
            state.slots[node].left =
531
427
                    add_or_increment(state, state.slots[node].left, value, count, inserted_slot);
532
427
            if (state.slots[state.slots[node].left].priority > state.slots[node].priority) {
533
170
                return rotate_right(state, node);
534
170
            }
535
427
        }
536
3.19k
        return node;
537
3.97k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_6EEEiRKllPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_7EEEiRKnlPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_8EEEiRKflPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_9EEEiRKdlPi
Line
Count
Source
512
9
                                    int32_t* inserted_slot) {
513
9
        if (node == State::NO_SLOT) {
514
3
            *inserted_slot = append_slot(state, value, count);
515
3
            return *inserted_slot;
516
3
        }
517
6
        int cmp = compare_values(value_of(state, node), value);
518
6
        if (cmp == 0) {
519
2
            state.slots[node].count = checked_add(state.slots[node].count, count);
520
2
            return node;
521
2
        }
522
4
        if (comes_before(cmp)) {
523
            // The stored value is the better one, so the input belongs in the right subtree.
524
1
            state.slots[node].right =
525
1
                    add_or_increment(state, state.slots[node].right, value, count, inserted_slot);
526
1
            if (state.slots[state.slots[node].right].priority > state.slots[node].priority) {
527
0
                return rotate_left(state, node);
528
0
            }
529
3
        } else {
530
3
            state.slots[node].left =
531
3
                    add_or_increment(state, state.slots[node].left, value, count, inserted_slot);
532
3
            if (state.slots[state.slots[node].left].priority > state.slots[node].priority) {
533
1
                return rotate_right(state, node);
534
1
            }
535
3
        }
536
3
        return node;
537
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_28EEEiRKNS_7DecimalIiEElPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_29EEEiRKNS_7DecimalIlEElPi
Line
Count
Source
512
60
                                    int32_t* inserted_slot) {
513
60
        if (node == State::NO_SLOT) {
514
26
            *inserted_slot = append_slot(state, value, count);
515
26
            return *inserted_slot;
516
26
        }
517
34
        int cmp = compare_values(value_of(state, node), value);
518
34
        if (cmp == 0) {
519
7
            state.slots[node].count = checked_add(state.slots[node].count, count);
520
7
            return node;
521
7
        }
522
27
        if (comes_before(cmp)) {
523
            // The stored value is the better one, so the input belongs in the right subtree.
524
2
            state.slots[node].right =
525
2
                    add_or_increment(state, state.slots[node].right, value, count, inserted_slot);
526
2
            if (state.slots[state.slots[node].right].priority > state.slots[node].priority) {
527
2
                return rotate_left(state, node);
528
2
            }
529
25
        } else {
530
25
            state.slots[node].left =
531
25
                    add_or_increment(state, state.slots[node].left, value, count, inserted_slot);
532
25
            if (state.slots[state.slots[node].left].priority > state.slots[node].priority) {
533
9
                return rotate_right(state, node);
534
9
            }
535
25
        }
536
16
        return node;
537
27
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_20EEEiRKNS_14DecimalV2ValueElPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_30EEEiRKNS_12Decimal128V3ElPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_35EEEiRKNS_7DecimalIN4wide7integerILm256EiEEEElPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_10EEEiNS_9StringRefElPi
Line
Count
Source
512
77
                                    int32_t* inserted_slot) {
513
77
        if (node == State::NO_SLOT) {
514
32
            *inserted_slot = append_slot(state, value, count);
515
32
            return *inserted_slot;
516
32
        }
517
45
        int cmp = compare_values(value_of(state, node), value);
518
45
        if (cmp == 0) {
519
7
            state.slots[node].count = checked_add(state.slots[node].count, count);
520
7
            return node;
521
7
        }
522
38
        if (comes_before(cmp)) {
523
            // The stored value is the better one, so the input belongs in the right subtree.
524
15
            state.slots[node].right =
525
15
                    add_or_increment(state, state.slots[node].right, value, count, inserted_slot);
526
15
            if (state.slots[state.slots[node].right].priority > state.slots[node].priority) {
527
10
                return rotate_left(state, node);
528
10
            }
529
23
        } else {
530
23
            state.slots[node].left =
531
23
                    add_or_increment(state, state.slots[node].left, value, count, inserted_slot);
532
23
            if (state.slots[state.slots[node].left].priority > state.slots[node].priority) {
533
12
                return rotate_right(state, node);
534
12
            }
535
23
        }
536
16
        return node;
537
38
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_11EEEiRKNS_16VecDateTimeValueElPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_12EEEiRKNS_16VecDateTimeValueElPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_25EEEiRKNS_11DateV2ValueINS_15DateV2ValueTypeEEElPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_26EEEiRKNS_11DateV2ValueINS_19DateTimeV2ValueTypeEEElPi
Line
Count
Source
512
25
                                    int32_t* inserted_slot) {
513
25
        if (node == State::NO_SLOT) {
514
12
            *inserted_slot = append_slot(state, value, count);
515
12
            return *inserted_slot;
516
12
        }
517
13
        int cmp = compare_values(value_of(state, node), value);
518
13
        if (cmp == 0) {
519
1
            state.slots[node].count = checked_add(state.slots[node].count, count);
520
1
            return node;
521
1
        }
522
12
        if (comes_before(cmp)) {
523
            // The stored value is the better one, so the input belongs in the right subtree.
524
3
            state.slots[node].right =
525
3
                    add_or_increment(state, state.slots[node].right, value, count, inserted_slot);
526
3
            if (state.slots[state.slots[node].right].priority > state.slots[node].priority) {
527
2
                return rotate_left(state, node);
528
2
            }
529
9
        } else {
530
9
            state.slots[node].left =
531
9
                    add_or_increment(state, state.slots[node].left, value, count, inserted_slot);
532
9
            if (state.slots[state.slots[node].left].priority > state.slots[node].priority) {
533
2
                return rotate_right(state, node);
534
2
            }
535
9
        }
536
8
        return node;
537
12
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_27EEEiRKdlPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_43EEEiRKNS_16TimeStampNsValueElPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_42EEEiRKNS_16TimestampTzValueElPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_36EEEiRKjlPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_37EEEiRKolPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE16add_or_incrementERNS_22AggregateTopKCountDataILS1_44EEEiRKolPi
538
539
    /// Removes the last entry in the aggregate's order (the largest value for MIN) and returns the
540
    /// new subtree root. That entry has no right child, so its left subtree takes its place; the
541
    /// child's priority is below the parent's, so no rotation is needed.
542
11.4k
    static int32_t erase_worst(State& state, int32_t node, int32_t* removed) {
543
11.4k
        if (state.slots[node].right == State::NO_SLOT) {
544
1.95k
            *removed = node;
545
1.95k
            return state.slots[node].left;
546
1.95k
        }
547
9.52k
        state.slots[node].right = erase_worst(state, state.slots[node].right, removed);
548
9.52k
        return node;
549
11.4k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_2EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_3EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_4EEEiPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_5EEEiPi
Line
Count
Source
542
10.9k
    static int32_t erase_worst(State& state, int32_t node, int32_t* removed) {
543
10.9k
        if (state.slots[node].right == State::NO_SLOT) {
544
1.73k
            *removed = node;
545
1.73k
            return state.slots[node].left;
546
1.73k
        }
547
9.16k
        state.slots[node].right = erase_worst(state, state.slots[node].right, removed);
548
9.16k
        return node;
549
10.9k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_6EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_7EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_8EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_9EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_28EEEiPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_29EEEiPi
Line
Count
Source
542
8
    static int32_t erase_worst(State& state, int32_t node, int32_t* removed) {
543
8
        if (state.slots[node].right == State::NO_SLOT) {
544
4
            *removed = node;
545
4
            return state.slots[node].left;
546
4
        }
547
4
        state.slots[node].right = erase_worst(state, state.slots[node].right, removed);
548
4
        return node;
549
8
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_20EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_30EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_35EEEiPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_10EEEiPi
Line
Count
Source
542
39
    static int32_t erase_worst(State& state, int32_t node, int32_t* removed) {
543
39
        if (state.slots[node].right == State::NO_SLOT) {
544
13
            *removed = node;
545
13
            return state.slots[node].left;
546
13
        }
547
26
        state.slots[node].right = erase_worst(state, state.slots[node].right, removed);
548
26
        return node;
549
39
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_11EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_12EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_25EEEiPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_26EEEiPi
Line
Count
Source
542
3
    static int32_t erase_worst(State& state, int32_t node, int32_t* removed) {
543
3
        if (state.slots[node].right == State::NO_SLOT) {
544
1
            *removed = node;
545
1
            return state.slots[node].left;
546
1
        }
547
2
        state.slots[node].right = erase_worst(state, state.slots[node].right, removed);
548
2
        return node;
549
3
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_27EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_43EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_42EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_36EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_37EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE11erase_worstERNS_22AggregateTopKCountDataILS1_44EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_2EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_3EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_4EEEiPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_5EEEiPi
Line
Count
Source
542
464
    static int32_t erase_worst(State& state, int32_t node, int32_t* removed) {
543
464
        if (state.slots[node].right == State::NO_SLOT) {
544
161
            *removed = node;
545
161
            return state.slots[node].left;
546
161
        }
547
303
        state.slots[node].right = erase_worst(state, state.slots[node].right, removed);
548
303
        return node;
549
464
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_6EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_7EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_8EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_9EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_28EEEiPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_29EEEiPi
Line
Count
Source
542
25
    static int32_t erase_worst(State& state, int32_t node, int32_t* removed) {
543
25
        if (state.slots[node].right == State::NO_SLOT) {
544
14
            *removed = node;
545
14
            return state.slots[node].left;
546
14
        }
547
11
        state.slots[node].right = erase_worst(state, state.slots[node].right, removed);
548
11
        return node;
549
25
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_20EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_30EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_35EEEiPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_10EEEiPi
Line
Count
Source
542
36
    static int32_t erase_worst(State& state, int32_t node, int32_t* removed) {
543
36
        if (state.slots[node].right == State::NO_SLOT) {
544
19
            *removed = node;
545
19
            return state.slots[node].left;
546
19
        }
547
17
        state.slots[node].right = erase_worst(state, state.slots[node].right, removed);
548
17
        return node;
549
36
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_11EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_12EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_25EEEiPi
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_26EEEiPi
Line
Count
Source
542
10
    static int32_t erase_worst(State& state, int32_t node, int32_t* removed) {
543
10
        if (state.slots[node].right == State::NO_SLOT) {
544
6
            *removed = node;
545
6
            return state.slots[node].left;
546
6
        }
547
4
        state.slots[node].right = erase_worst(state, state.slots[node].right, removed);
548
4
        return node;
549
10
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_27EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_43EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_42EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_36EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_37EEEiPi
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE11erase_worstERNS_22AggregateTopKCountDataILS1_44EEEiPi
550
551
2.20k
    static void refresh_worst(State& state) {
552
2.20k
        int32_t node = state.root;
553
11.7k
        while (node != State::NO_SLOT && state.slots[node].right != State::NO_SLOT) {
554
9.59k
            node = state.slots[node].right;
555
9.59k
        }
556
2.20k
        state.worst = node;
557
2.20k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_2EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_3EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_4EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_5EEE
Line
Count
Source
551
1.84k
    static void refresh_worst(State& state) {
552
1.84k
        int32_t node = state.root;
553
11.0k
        while (node != State::NO_SLOT && state.slots[node].right != State::NO_SLOT) {
554
9.19k
            node = state.slots[node].right;
555
9.19k
        }
556
1.84k
        state.worst = node;
557
1.84k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_6EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_7EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_8EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_9EEE
Line
Count
Source
551
2
    static void refresh_worst(State& state) {
552
2
        int32_t node = state.root;
553
2
        while (node != State::NO_SLOT && state.slots[node].right != State::NO_SLOT) {
554
0
            node = state.slots[node].right;
555
0
        }
556
2
        state.worst = node;
557
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_28EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_29EEE
Line
Count
Source
551
15
    static void refresh_worst(State& state) {
552
15
        int32_t node = state.root;
553
21
        while (node != State::NO_SLOT && state.slots[node].right != State::NO_SLOT) {
554
6
            node = state.slots[node].right;
555
6
        }
556
15
        state.worst = node;
557
15
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_20EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_30EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_35EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_10EEE
Line
Count
Source
551
28
    static void refresh_worst(State& state) {
552
28
        int32_t node = state.root;
553
65
        while (node != State::NO_SLOT && state.slots[node].right != State::NO_SLOT) {
554
37
            node = state.slots[node].right;
555
37
        }
556
28
        state.worst = node;
557
28
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_11EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_12EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_25EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_26EEE
Line
Count
Source
551
8
    static void refresh_worst(State& state) {
552
8
        int32_t node = state.root;
553
10
        while (node != State::NO_SLOT && state.slots[node].right != State::NO_SLOT) {
554
2
            node = state.slots[node].right;
555
2
        }
556
8
        state.worst = node;
557
8
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_27EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_43EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_42EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_36EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_37EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE13refresh_worstERNS_22AggregateTopKCountDataILS1_44EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_2EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_3EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_4EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_5EEE
Line
Count
Source
551
227
    static void refresh_worst(State& state) {
552
227
        int32_t node = state.root;
553
555
        while (node != State::NO_SLOT && state.slots[node].right != State::NO_SLOT) {
554
328
            node = state.slots[node].right;
555
328
        }
556
227
        state.worst = node;
557
227
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_6EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_7EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_8EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_9EEE
Line
Count
Source
551
2
    static void refresh_worst(State& state) {
552
2
        int32_t node = state.root;
553
3
        while (node != State::NO_SLOT && state.slots[node].right != State::NO_SLOT) {
554
1
            node = state.slots[node].right;
555
1
        }
556
2
        state.worst = node;
557
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_28EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_29EEE
Line
Count
Source
551
28
    static void refresh_worst(State& state) {
552
28
        int32_t node = state.root;
553
37
        while (node != State::NO_SLOT && state.slots[node].right != State::NO_SLOT) {
554
9
            node = state.slots[node].right;
555
9
        }
556
28
        state.worst = node;
557
28
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_20EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_30EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_35EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_10EEE
Line
Count
Source
551
34
    static void refresh_worst(State& state) {
552
34
        int32_t node = state.root;
553
48
        while (node != State::NO_SLOT && state.slots[node].right != State::NO_SLOT) {
554
14
            node = state.slots[node].right;
555
14
        }
556
34
        state.worst = node;
557
34
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_11EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_12EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_25EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_26EEE
Line
Count
Source
551
14
    static void refresh_worst(State& state) {
552
14
        int32_t node = state.root;
553
17
        while (node != State::NO_SLOT && state.slots[node].right != State::NO_SLOT) {
554
3
            node = state.slots[node].right;
555
3
        }
556
14
        state.worst = node;
557
14
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_27EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_43EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_42EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_36EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_37EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE13refresh_worstERNS_22AggregateTopKCountDataILS1_44EEE
558
559
    /// The first live slot in the aggregate's order, i.e. the best value the state holds.
560
14
    static int32_t best_slot(const State& state) {
561
14
        int32_t node = state.root;
562
24
        while (node != State::NO_SLOT && state.slots[node].left != State::NO_SLOT) {
563
10
            node = state.slots[node].left;
564
10
        }
565
14
        return node;
566
14
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_2EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_3EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_4EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_5EEE
Line
Count
Source
560
4
    static int32_t best_slot(const State& state) {
561
4
        int32_t node = state.root;
562
9
        while (node != State::NO_SLOT && state.slots[node].left != State::NO_SLOT) {
563
5
            node = state.slots[node].left;
564
5
        }
565
4
        return node;
566
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_6EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_7EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_8EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_9EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_28EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_29EEE
Line
Count
Source
560
1
    static int32_t best_slot(const State& state) {
561
1
        int32_t node = state.root;
562
1
        while (node != State::NO_SLOT && state.slots[node].left != State::NO_SLOT) {
563
0
            node = state.slots[node].left;
564
0
        }
565
1
        return node;
566
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_20EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_30EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_35EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_10EEE
Line
Count
Source
560
3
    static int32_t best_slot(const State& state) {
561
3
        int32_t node = state.root;
562
4
        while (node != State::NO_SLOT && state.slots[node].left != State::NO_SLOT) {
563
1
            node = state.slots[node].left;
564
1
        }
565
3
        return node;
566
3
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_11EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_12EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_25EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_26EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_27EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_43EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_42EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_36EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_37EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE9best_slotERKNS_22AggregateTopKCountDataILS1_44EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_2EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_3EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_4EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_5EEE
Line
Count
Source
560
4
    static int32_t best_slot(const State& state) {
561
4
        int32_t node = state.root;
562
7
        while (node != State::NO_SLOT && state.slots[node].left != State::NO_SLOT) {
563
3
            node = state.slots[node].left;
564
3
        }
565
4
        return node;
566
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_6EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_7EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_8EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_9EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_28EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_29EEE
Line
Count
Source
560
1
    static int32_t best_slot(const State& state) {
561
1
        int32_t node = state.root;
562
2
        while (node != State::NO_SLOT && state.slots[node].left != State::NO_SLOT) {
563
1
            node = state.slots[node].left;
564
1
        }
565
1
        return node;
566
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_20EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_30EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_35EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_10EEE
Line
Count
Source
560
1
    static int32_t best_slot(const State& state) {
561
1
        int32_t node = state.root;
562
1
        while (node != State::NO_SLOT && state.slots[node].left != State::NO_SLOT) {
563
0
            node = state.slots[node].left;
564
0
        }
565
1
        return node;
566
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_11EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_12EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_25EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_26EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_27EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_43EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_42EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_36EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_37EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE9best_slotERKNS_22AggregateTopKCountDataILS1_44EEE
567
568
    /// Slots in the aggregate's order, i.e. the order of the result array.
569
447
    static void collect_in_order(const State& state, DorisVector<int32_t>& slots) {
570
447
        slots.reserve(static_cast<size_t>(state.live));
571
447
        DorisVector<int32_t> stack;
572
447
        stack.reserve(64);
573
447
        int32_t node = state.root;
574
3.64k
        while (node != State::NO_SLOT || !stack.empty()) {
575
6.39k
            while (node != State::NO_SLOT) {
576
3.19k
                stack.push_back(node);
577
3.19k
                node = state.slots[node].left;
578
3.19k
            }
579
3.19k
            node = stack.back();
580
3.19k
            stack.pop_back();
581
            // Only live slots are reachable from the root; an evicted slot has no row count.
582
3.19k
            DCHECK_GE(state.slots[node].count, 0);
583
3.19k
            slots.push_back(node);
584
3.19k
            node = state.slots[node].right;
585
3.19k
        }
586
447
        DCHECK_EQ(static_cast<int64_t>(slots.size()), state.live);
587
447
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_2EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_3EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
569
1
    static void collect_in_order(const State& state, DorisVector<int32_t>& slots) {
570
1
        slots.reserve(static_cast<size_t>(state.live));
571
1
        DorisVector<int32_t> stack;
572
1
        stack.reserve(64);
573
1
        int32_t node = state.root;
574
2
        while (node != State::NO_SLOT || !stack.empty()) {
575
2
            while (node != State::NO_SLOT) {
576
1
                stack.push_back(node);
577
1
                node = state.slots[node].left;
578
1
            }
579
1
            node = stack.back();
580
1
            stack.pop_back();
581
            // Only live slots are reachable from the root; an evicted slot has no row count.
582
1
            DCHECK_GE(state.slots[node].count, 0);
583
1
            slots.push_back(node);
584
1
            node = state.slots[node].right;
585
1
        }
586
        DCHECK_EQ(static_cast<int64_t>(slots.size()), state.live);
587
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_4EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_5EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
569
184
    static void collect_in_order(const State& state, DorisVector<int32_t>& slots) {
570
184
        slots.reserve(static_cast<size_t>(state.live));
571
184
        DorisVector<int32_t> stack;
572
184
        stack.reserve(64);
573
184
        int32_t node = state.root;
574
2.31k
        while (node != State::NO_SLOT || !stack.empty()) {
575
4.26k
            while (node != State::NO_SLOT) {
576
2.13k
                stack.push_back(node);
577
2.13k
                node = state.slots[node].left;
578
2.13k
            }
579
2.13k
            node = stack.back();
580
2.13k
            stack.pop_back();
581
            // Only live slots are reachable from the root; an evicted slot has no row count.
582
2.13k
            DCHECK_GE(state.slots[node].count, 0);
583
2.13k
            slots.push_back(node);
584
2.13k
            node = state.slots[node].right;
585
2.13k
        }
586
        DCHECK_EQ(static_cast<int64_t>(slots.size()), state.live);
587
184
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_6EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_7EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_8EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_9EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
569
4
    static void collect_in_order(const State& state, DorisVector<int32_t>& slots) {
570
4
        slots.reserve(static_cast<size_t>(state.live));
571
4
        DorisVector<int32_t> stack;
572
4
        stack.reserve(64);
573
4
        int32_t node = state.root;
574
13
        while (node != State::NO_SLOT || !stack.empty()) {
575
18
            while (node != State::NO_SLOT) {
576
9
                stack.push_back(node);
577
9
                node = state.slots[node].left;
578
9
            }
579
9
            node = stack.back();
580
9
            stack.pop_back();
581
            // Only live slots are reachable from the root; an evicted slot has no row count.
582
9
            DCHECK_GE(state.slots[node].count, 0);
583
9
            slots.push_back(node);
584
9
            node = state.slots[node].right;
585
9
        }
586
        DCHECK_EQ(static_cast<int64_t>(slots.size()), state.live);
587
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_28EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_29EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
569
21
    static void collect_in_order(const State& state, DorisVector<int32_t>& slots) {
570
21
        slots.reserve(static_cast<size_t>(state.live));
571
21
        DorisVector<int32_t> stack;
572
21
        stack.reserve(64);
573
21
        int32_t node = state.root;
574
49
        while (node != State::NO_SLOT || !stack.empty()) {
575
56
            while (node != State::NO_SLOT) {
576
28
                stack.push_back(node);
577
28
                node = state.slots[node].left;
578
28
            }
579
28
            node = stack.back();
580
28
            stack.pop_back();
581
            // Only live slots are reachable from the root; an evicted slot has no row count.
582
28
            DCHECK_GE(state.slots[node].count, 0);
583
28
            slots.push_back(node);
584
28
            node = state.slots[node].right;
585
28
        }
586
        DCHECK_EQ(static_cast<int64_t>(slots.size()), state.live);
587
21
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_20EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_30EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_35EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_10EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
569
36
    static void collect_in_order(const State& state, DorisVector<int32_t>& slots) {
570
36
        slots.reserve(static_cast<size_t>(state.live));
571
36
        DorisVector<int32_t> stack;
572
36
        stack.reserve(64);
573
36
        int32_t node = state.root;
574
132
        while (node != State::NO_SLOT || !stack.empty()) {
575
192
            while (node != State::NO_SLOT) {
576
96
                stack.push_back(node);
577
96
                node = state.slots[node].left;
578
96
            }
579
96
            node = stack.back();
580
96
            stack.pop_back();
581
            // Only live slots are reachable from the root; an evicted slot has no row count.
582
96
            DCHECK_GE(state.slots[node].count, 0);
583
96
            slots.push_back(node);
584
96
            node = state.slots[node].right;
585
96
        }
586
        DCHECK_EQ(static_cast<int64_t>(slots.size()), state.live);
587
36
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_11EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_12EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_25EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_26EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
569
14
    static void collect_in_order(const State& state, DorisVector<int32_t>& slots) {
570
14
        slots.reserve(static_cast<size_t>(state.live));
571
14
        DorisVector<int32_t> stack;
572
14
        stack.reserve(64);
573
14
        int32_t node = state.root;
574
28
        while (node != State::NO_SLOT || !stack.empty()) {
575
28
            while (node != State::NO_SLOT) {
576
14
                stack.push_back(node);
577
14
                node = state.slots[node].left;
578
14
            }
579
14
            node = stack.back();
580
14
            stack.pop_back();
581
            // Only live slots are reachable from the root; an evicted slot has no row count.
582
14
            DCHECK_GE(state.slots[node].count, 0);
583
14
            slots.push_back(node);
584
14
            node = state.slots[node].right;
585
14
        }
586
        DCHECK_EQ(static_cast<int64_t>(slots.size()), state.live);
587
14
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_27EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_43EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_42EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_36EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_37EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_44EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_2EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_3EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_4EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_5EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
569
118
    static void collect_in_order(const State& state, DorisVector<int32_t>& slots) {
570
118
        slots.reserve(static_cast<size_t>(state.live));
571
118
        DorisVector<int32_t> stack;
572
118
        stack.reserve(64);
573
118
        int32_t node = state.root;
574
940
        while (node != State::NO_SLOT || !stack.empty()) {
575
1.64k
            while (node != State::NO_SLOT) {
576
822
                stack.push_back(node);
577
822
                node = state.slots[node].left;
578
822
            }
579
822
            node = stack.back();
580
822
            stack.pop_back();
581
            // Only live slots are reachable from the root; an evicted slot has no row count.
582
822
            DCHECK_GE(state.slots[node].count, 0);
583
822
            slots.push_back(node);
584
822
            node = state.slots[node].right;
585
822
        }
586
        DCHECK_EQ(static_cast<int64_t>(slots.size()), state.live);
587
118
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_6EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_7EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_8EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_9EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
569
4
    static void collect_in_order(const State& state, DorisVector<int32_t>& slots) {
570
4
        slots.reserve(static_cast<size_t>(state.live));
571
4
        DorisVector<int32_t> stack;
572
4
        stack.reserve(64);
573
4
        int32_t node = state.root;
574
13
        while (node != State::NO_SLOT || !stack.empty()) {
575
18
            while (node != State::NO_SLOT) {
576
9
                stack.push_back(node);
577
9
                node = state.slots[node].left;
578
9
            }
579
9
            node = stack.back();
580
9
            stack.pop_back();
581
            // Only live slots are reachable from the root; an evicted slot has no row count.
582
9
            DCHECK_GE(state.slots[node].count, 0);
583
9
            slots.push_back(node);
584
9
            node = state.slots[node].right;
585
9
        }
586
        DCHECK_EQ(static_cast<int64_t>(slots.size()), state.live);
587
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_28EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_29EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
569
24
    static void collect_in_order(const State& state, DorisVector<int32_t>& slots) {
570
24
        slots.reserve(static_cast<size_t>(state.live));
571
24
        DorisVector<int32_t> stack;
572
24
        stack.reserve(64);
573
24
        int32_t node = state.root;
574
58
        while (node != State::NO_SLOT || !stack.empty()) {
575
68
            while (node != State::NO_SLOT) {
576
34
                stack.push_back(node);
577
34
                node = state.slots[node].left;
578
34
            }
579
34
            node = stack.back();
580
34
            stack.pop_back();
581
            // Only live slots are reachable from the root; an evicted slot has no row count.
582
34
            DCHECK_GE(state.slots[node].count, 0);
583
34
            slots.push_back(node);
584
34
            node = state.slots[node].right;
585
34
        }
586
        DCHECK_EQ(static_cast<int64_t>(slots.size()), state.live);
587
24
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_20EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_30EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_35EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_10EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
569
26
    static void collect_in_order(const State& state, DorisVector<int32_t>& slots) {
570
26
        slots.reserve(static_cast<size_t>(state.live));
571
26
        DorisVector<int32_t> stack;
572
26
        stack.reserve(64);
573
26
        int32_t node = state.root;
574
64
        while (node != State::NO_SLOT || !stack.empty()) {
575
76
            while (node != State::NO_SLOT) {
576
38
                stack.push_back(node);
577
38
                node = state.slots[node].left;
578
38
            }
579
38
            node = stack.back();
580
38
            stack.pop_back();
581
            // Only live slots are reachable from the root; an evicted slot has no row count.
582
38
            DCHECK_GE(state.slots[node].count, 0);
583
38
            slots.push_back(node);
584
38
            node = state.slots[node].right;
585
38
        }
586
        DCHECK_EQ(static_cast<int64_t>(slots.size()), state.live);
587
26
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_11EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_12EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_25EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_26EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
569
15
    static void collect_in_order(const State& state, DorisVector<int32_t>& slots) {
570
15
        slots.reserve(static_cast<size_t>(state.live));
571
15
        DorisVector<int32_t> stack;
572
15
        stack.reserve(64);
573
15
        int32_t node = state.root;
574
31
        while (node != State::NO_SLOT || !stack.empty()) {
575
32
            while (node != State::NO_SLOT) {
576
16
                stack.push_back(node);
577
16
                node = state.slots[node].left;
578
16
            }
579
16
            node = stack.back();
580
16
            stack.pop_back();
581
            // Only live slots are reachable from the root; an evicted slot has no row count.
582
16
            DCHECK_GE(state.slots[node].count, 0);
583
16
            slots.push_back(node);
584
16
            node = state.slots[node].right;
585
16
        }
586
        DCHECK_EQ(static_cast<int64_t>(slots.size()), state.live);
587
15
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_27EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_43EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_42EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_36EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_37EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE16collect_in_orderERKNS_22AggregateTopKCountDataILS1_44EEERSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
588
589
    /// Rebuilds the tree from `values`, already in the aggregate's order.
590
    /// The treap is built in O(size) as a Cartesian tree over the fresh priorities.
591
247
    static void assign_sorted(State& state, DorisVector<Entry> values) {
592
247
        const size_t size = values.size();
593
247
        check_slot_capacity(size);
594
247
        state.slots.assign(size, Slot {});
595
2.00k
        for (size_t slot = 0; slot != size; ++slot) {
596
1.75k
            state.slots[slot].count = values[slot].count;
597
1.75k
        }
598
247
        if constexpr (IS_STRING) {
599
            // The entries may point into this state's own arena, so the new arena is built aside
600
            // and swapped in before the old one is dropped.
601
30
            PaddedPODArray<char, 32> bytes;
602
30
            size_t live_bytes = 0;
603
106
            for (size_t slot = 0; slot != size; ++slot) {
604
76
                const StringRef value = values[slot].value;
605
76
                Payload& payload = state.slots[slot].payload;
606
76
                payload.offset = bytes.size();
607
76
                payload.length = value.size;
608
76
                if (value.size != 0) {
609
76
                    bytes.insert(value.data, value.data + value.size);
610
76
                }
611
76
                live_bytes += value.size;
612
76
            }
613
30
            state.bytes.swap(bytes);
614
30
            state.live_payload_bytes = live_bytes;
615
30
            state.dead_payload_bytes = 0;
616
217
        } else {
617
1.89k
            for (size_t slot = 0; slot != size; ++slot) {
618
1.67k
                state.slots[slot].payload = values[slot].value;
619
1.67k
            }
620
217
        }
621
247
        state.live = static_cast<uint32_t>(size);
622
247
        state.dead = 0;
623
247
        DorisVector<int32_t> stack;
624
247
        stack.reserve(size);
625
2.00k
        for (size_t slot = 0; slot != size; ++slot) {
626
1.75k
            state.slots[slot].priority = next_priority(state);
627
1.75k
            int32_t last = State::NO_SLOT;
628
3.11k
            while (!stack.empty() &&
629
3.11k
                   state.slots[stack.back()].priority < state.slots[slot].priority) {
630
1.35k
                last = stack.back();
631
1.35k
                stack.pop_back();
632
1.35k
            }
633
1.75k
            state.slots[slot].left = last;
634
1.75k
            if (!stack.empty()) {
635
1.37k
                state.slots[stack.back()].right = static_cast<int32_t>(slot);
636
1.37k
            }
637
1.75k
            stack.push_back(static_cast<int32_t>(slot));
638
1.75k
        }
639
247
        state.root = stack.empty() ? State::NO_SLOT : stack.front();
640
247
        refresh_worst(state);
641
247
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_2EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_3EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_4EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_5EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
591
107
    static void assign_sorted(State& state, DorisVector<Entry> values) {
592
107
        const size_t size = values.size();
593
107
        check_slot_capacity(size);
594
107
        state.slots.assign(size, Slot {});
595
1.48k
        for (size_t slot = 0; slot != size; ++slot) {
596
1.38k
            state.slots[slot].count = values[slot].count;
597
1.38k
        }
598
        if constexpr (IS_STRING) {
599
            // The entries may point into this state's own arena, so the new arena is built aside
600
            // and swapped in before the old one is dropped.
601
            PaddedPODArray<char, 32> bytes;
602
            size_t live_bytes = 0;
603
            for (size_t slot = 0; slot != size; ++slot) {
604
                const StringRef value = values[slot].value;
605
                Payload& payload = state.slots[slot].payload;
606
                payload.offset = bytes.size();
607
                payload.length = value.size;
608
                if (value.size != 0) {
609
                    bytes.insert(value.data, value.data + value.size);
610
                }
611
                live_bytes += value.size;
612
            }
613
            state.bytes.swap(bytes);
614
            state.live_payload_bytes = live_bytes;
615
            state.dead_payload_bytes = 0;
616
107
        } else {
617
1.48k
            for (size_t slot = 0; slot != size; ++slot) {
618
1.38k
                state.slots[slot].payload = values[slot].value;
619
1.38k
            }
620
107
        }
621
107
        state.live = static_cast<uint32_t>(size);
622
107
        state.dead = 0;
623
107
        DorisVector<int32_t> stack;
624
107
        stack.reserve(size);
625
1.48k
        for (size_t slot = 0; slot != size; ++slot) {
626
1.38k
            state.slots[slot].priority = next_priority(state);
627
1.38k
            int32_t last = State::NO_SLOT;
628
2.57k
            while (!stack.empty() &&
629
2.57k
                   state.slots[stack.back()].priority < state.slots[slot].priority) {
630
1.19k
                last = stack.back();
631
1.19k
                stack.pop_back();
632
1.19k
            }
633
1.38k
            state.slots[slot].left = last;
634
1.38k
            if (!stack.empty()) {
635
1.20k
                state.slots[stack.back()].right = static_cast<int32_t>(slot);
636
1.20k
            }
637
1.38k
            stack.push_back(static_cast<int32_t>(slot));
638
1.38k
        }
639
107
        state.root = stack.empty() ? State::NO_SLOT : stack.front();
640
107
        refresh_worst(state);
641
107
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_6EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_7EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_8EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_9EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
591
2
    static void assign_sorted(State& state, DorisVector<Entry> values) {
592
2
        const size_t size = values.size();
593
2
        check_slot_capacity(size);
594
2
        state.slots.assign(size, Slot {});
595
8
        for (size_t slot = 0; slot != size; ++slot) {
596
6
            state.slots[slot].count = values[slot].count;
597
6
        }
598
        if constexpr (IS_STRING) {
599
            // The entries may point into this state's own arena, so the new arena is built aside
600
            // and swapped in before the old one is dropped.
601
            PaddedPODArray<char, 32> bytes;
602
            size_t live_bytes = 0;
603
            for (size_t slot = 0; slot != size; ++slot) {
604
                const StringRef value = values[slot].value;
605
                Payload& payload = state.slots[slot].payload;
606
                payload.offset = bytes.size();
607
                payload.length = value.size;
608
                if (value.size != 0) {
609
                    bytes.insert(value.data, value.data + value.size);
610
                }
611
                live_bytes += value.size;
612
            }
613
            state.bytes.swap(bytes);
614
            state.live_payload_bytes = live_bytes;
615
            state.dead_payload_bytes = 0;
616
2
        } else {
617
8
            for (size_t slot = 0; slot != size; ++slot) {
618
6
                state.slots[slot].payload = values[slot].value;
619
6
            }
620
2
        }
621
2
        state.live = static_cast<uint32_t>(size);
622
2
        state.dead = 0;
623
2
        DorisVector<int32_t> stack;
624
2
        stack.reserve(size);
625
8
        for (size_t slot = 0; slot != size; ++slot) {
626
6
            state.slots[slot].priority = next_priority(state);
627
6
            int32_t last = State::NO_SLOT;
628
10
            while (!stack.empty() &&
629
10
                   state.slots[stack.back()].priority < state.slots[slot].priority) {
630
4
                last = stack.back();
631
4
                stack.pop_back();
632
4
            }
633
6
            state.slots[slot].left = last;
634
6
            if (!stack.empty()) {
635
1
                state.slots[stack.back()].right = static_cast<int32_t>(slot);
636
1
            }
637
6
            stack.push_back(static_cast<int32_t>(slot));
638
6
        }
639
2
        state.root = stack.empty() ? State::NO_SLOT : stack.front();
640
2
        refresh_worst(state);
641
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_28EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_29EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
591
11
    static void assign_sorted(State& state, DorisVector<Entry> values) {
592
11
        const size_t size = values.size();
593
11
        check_slot_capacity(size);
594
11
        state.slots.assign(size, Slot {});
595
29
        for (size_t slot = 0; slot != size; ++slot) {
596
18
            state.slots[slot].count = values[slot].count;
597
18
        }
598
        if constexpr (IS_STRING) {
599
            // The entries may point into this state's own arena, so the new arena is built aside
600
            // and swapped in before the old one is dropped.
601
            PaddedPODArray<char, 32> bytes;
602
            size_t live_bytes = 0;
603
            for (size_t slot = 0; slot != size; ++slot) {
604
                const StringRef value = values[slot].value;
605
                Payload& payload = state.slots[slot].payload;
606
                payload.offset = bytes.size();
607
                payload.length = value.size;
608
                if (value.size != 0) {
609
                    bytes.insert(value.data, value.data + value.size);
610
                }
611
                live_bytes += value.size;
612
            }
613
            state.bytes.swap(bytes);
614
            state.live_payload_bytes = live_bytes;
615
            state.dead_payload_bytes = 0;
616
11
        } else {
617
29
            for (size_t slot = 0; slot != size; ++slot) {
618
18
                state.slots[slot].payload = values[slot].value;
619
18
            }
620
11
        }
621
11
        state.live = static_cast<uint32_t>(size);
622
11
        state.dead = 0;
623
11
        DorisVector<int32_t> stack;
624
11
        stack.reserve(size);
625
29
        for (size_t slot = 0; slot != size; ++slot) {
626
18
            state.slots[slot].priority = next_priority(state);
627
18
            int32_t last = State::NO_SLOT;
628
22
            while (!stack.empty() &&
629
22
                   state.slots[stack.back()].priority < state.slots[slot].priority) {
630
4
                last = stack.back();
631
4
                stack.pop_back();
632
4
            }
633
18
            state.slots[slot].left = last;
634
18
            if (!stack.empty()) {
635
4
                state.slots[stack.back()].right = static_cast<int32_t>(slot);
636
4
            }
637
18
            stack.push_back(static_cast<int32_t>(slot));
638
18
        }
639
11
        state.root = stack.empty() ? State::NO_SLOT : stack.front();
640
11
        refresh_worst(state);
641
11
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_20EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_30EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_35EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_10EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
591
15
    static void assign_sorted(State& state, DorisVector<Entry> values) {
592
15
        const size_t size = values.size();
593
15
        check_slot_capacity(size);
594
15
        state.slots.assign(size, Slot {});
595
65
        for (size_t slot = 0; slot != size; ++slot) {
596
50
            state.slots[slot].count = values[slot].count;
597
50
        }
598
15
        if constexpr (IS_STRING) {
599
            // The entries may point into this state's own arena, so the new arena is built aside
600
            // and swapped in before the old one is dropped.
601
15
            PaddedPODArray<char, 32> bytes;
602
15
            size_t live_bytes = 0;
603
65
            for (size_t slot = 0; slot != size; ++slot) {
604
50
                const StringRef value = values[slot].value;
605
50
                Payload& payload = state.slots[slot].payload;
606
50
                payload.offset = bytes.size();
607
50
                payload.length = value.size;
608
50
                if (value.size != 0) {
609
50
                    bytes.insert(value.data, value.data + value.size);
610
50
                }
611
50
                live_bytes += value.size;
612
50
            }
613
15
            state.bytes.swap(bytes);
614
15
            state.live_payload_bytes = live_bytes;
615
15
            state.dead_payload_bytes = 0;
616
        } else {
617
            for (size_t slot = 0; slot != size; ++slot) {
618
                state.slots[slot].payload = values[slot].value;
619
            }
620
        }
621
15
        state.live = static_cast<uint32_t>(size);
622
15
        state.dead = 0;
623
15
        DorisVector<int32_t> stack;
624
15
        stack.reserve(size);
625
65
        for (size_t slot = 0; slot != size; ++slot) {
626
50
            state.slots[slot].priority = next_priority(state);
627
50
            int32_t last = State::NO_SLOT;
628
69
            while (!stack.empty() &&
629
69
                   state.slots[stack.back()].priority < state.slots[slot].priority) {
630
19
                last = stack.back();
631
19
                stack.pop_back();
632
19
            }
633
50
            state.slots[slot].left = last;
634
50
            if (!stack.empty()) {
635
25
                state.slots[stack.back()].right = static_cast<int32_t>(slot);
636
25
            }
637
50
            stack.push_back(static_cast<int32_t>(slot));
638
50
        }
639
15
        state.root = stack.empty() ? State::NO_SLOT : stack.front();
640
15
        refresh_worst(state);
641
15
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_11EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_12EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_25EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_26EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
591
7
    static void assign_sorted(State& state, DorisVector<Entry> values) {
592
7
        const size_t size = values.size();
593
7
        check_slot_capacity(size);
594
7
        state.slots.assign(size, Slot {});
595
16
        for (size_t slot = 0; slot != size; ++slot) {
596
9
            state.slots[slot].count = values[slot].count;
597
9
        }
598
        if constexpr (IS_STRING) {
599
            // The entries may point into this state's own arena, so the new arena is built aside
600
            // and swapped in before the old one is dropped.
601
            PaddedPODArray<char, 32> bytes;
602
            size_t live_bytes = 0;
603
            for (size_t slot = 0; slot != size; ++slot) {
604
                const StringRef value = values[slot].value;
605
                Payload& payload = state.slots[slot].payload;
606
                payload.offset = bytes.size();
607
                payload.length = value.size;
608
                if (value.size != 0) {
609
                    bytes.insert(value.data, value.data + value.size);
610
                }
611
                live_bytes += value.size;
612
            }
613
            state.bytes.swap(bytes);
614
            state.live_payload_bytes = live_bytes;
615
            state.dead_payload_bytes = 0;
616
7
        } else {
617
16
            for (size_t slot = 0; slot != size; ++slot) {
618
9
                state.slots[slot].payload = values[slot].value;
619
9
            }
620
7
        }
621
7
        state.live = static_cast<uint32_t>(size);
622
7
        state.dead = 0;
623
7
        DorisVector<int32_t> stack;
624
7
        stack.reserve(size);
625
16
        for (size_t slot = 0; slot != size; ++slot) {
626
9
            state.slots[slot].priority = next_priority(state);
627
9
            int32_t last = State::NO_SLOT;
628
12
            while (!stack.empty() &&
629
12
                   state.slots[stack.back()].priority < state.slots[slot].priority) {
630
3
                last = stack.back();
631
3
                stack.pop_back();
632
3
            }
633
9
            state.slots[slot].left = last;
634
9
            if (!stack.empty()) {
635
1
                state.slots[stack.back()].right = static_cast<int32_t>(slot);
636
1
            }
637
9
            stack.push_back(static_cast<int32_t>(slot));
638
9
        }
639
7
        state.root = stack.empty() ? State::NO_SLOT : stack.front();
640
7
        refresh_worst(state);
641
7
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_27EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_43EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_42EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_36EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_37EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE13assign_sortedERNS_22AggregateTopKCountDataILS1_44EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_2EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_3EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_4EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_5EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
591
66
    static void assign_sorted(State& state, DorisVector<Entry> values) {
592
66
        const size_t size = values.size();
593
66
        check_slot_capacity(size);
594
66
        state.slots.assign(size, Slot {});
595
291
        for (size_t slot = 0; slot != size; ++slot) {
596
225
            state.slots[slot].count = values[slot].count;
597
225
        }
598
        if constexpr (IS_STRING) {
599
            // The entries may point into this state's own arena, so the new arena is built aside
600
            // and swapped in before the old one is dropped.
601
            PaddedPODArray<char, 32> bytes;
602
            size_t live_bytes = 0;
603
            for (size_t slot = 0; slot != size; ++slot) {
604
                const StringRef value = values[slot].value;
605
                Payload& payload = state.slots[slot].payload;
606
                payload.offset = bytes.size();
607
                payload.length = value.size;
608
                if (value.size != 0) {
609
                    bytes.insert(value.data, value.data + value.size);
610
                }
611
                live_bytes += value.size;
612
            }
613
            state.bytes.swap(bytes);
614
            state.live_payload_bytes = live_bytes;
615
            state.dead_payload_bytes = 0;
616
66
        } else {
617
291
            for (size_t slot = 0; slot != size; ++slot) {
618
225
                state.slots[slot].payload = values[slot].value;
619
225
            }
620
66
        }
621
66
        state.live = static_cast<uint32_t>(size);
622
66
        state.dead = 0;
623
66
        DorisVector<int32_t> stack;
624
66
        stack.reserve(size);
625
291
        for (size_t slot = 0; slot != size; ++slot) {
626
225
            state.slots[slot].priority = next_priority(state);
627
225
            int32_t last = State::NO_SLOT;
628
338
            while (!stack.empty() &&
629
338
                   state.slots[stack.back()].priority < state.slots[slot].priority) {
630
113
                last = stack.back();
631
113
                stack.pop_back();
632
113
            }
633
225
            state.slots[slot].left = last;
634
225
            if (!stack.empty()) {
635
124
                state.slots[stack.back()].right = static_cast<int32_t>(slot);
636
124
            }
637
225
            stack.push_back(static_cast<int32_t>(slot));
638
225
        }
639
66
        state.root = stack.empty() ? State::NO_SLOT : stack.front();
640
66
        refresh_worst(state);
641
66
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_6EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_7EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_8EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_9EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
591
2
    static void assign_sorted(State& state, DorisVector<Entry> values) {
592
2
        const size_t size = values.size();
593
2
        check_slot_capacity(size);
594
2
        state.slots.assign(size, Slot {});
595
8
        for (size_t slot = 0; slot != size; ++slot) {
596
6
            state.slots[slot].count = values[slot].count;
597
6
        }
598
        if constexpr (IS_STRING) {
599
            // The entries may point into this state's own arena, so the new arena is built aside
600
            // and swapped in before the old one is dropped.
601
            PaddedPODArray<char, 32> bytes;
602
            size_t live_bytes = 0;
603
            for (size_t slot = 0; slot != size; ++slot) {
604
                const StringRef value = values[slot].value;
605
                Payload& payload = state.slots[slot].payload;
606
                payload.offset = bytes.size();
607
                payload.length = value.size;
608
                if (value.size != 0) {
609
                    bytes.insert(value.data, value.data + value.size);
610
                }
611
                live_bytes += value.size;
612
            }
613
            state.bytes.swap(bytes);
614
            state.live_payload_bytes = live_bytes;
615
            state.dead_payload_bytes = 0;
616
2
        } else {
617
8
            for (size_t slot = 0; slot != size; ++slot) {
618
6
                state.slots[slot].payload = values[slot].value;
619
6
            }
620
2
        }
621
2
        state.live = static_cast<uint32_t>(size);
622
2
        state.dead = 0;
623
2
        DorisVector<int32_t> stack;
624
2
        stack.reserve(size);
625
8
        for (size_t slot = 0; slot != size; ++slot) {
626
6
            state.slots[slot].priority = next_priority(state);
627
6
            int32_t last = State::NO_SLOT;
628
9
            while (!stack.empty() &&
629
9
                   state.slots[stack.back()].priority < state.slots[slot].priority) {
630
3
                last = stack.back();
631
3
                stack.pop_back();
632
3
            }
633
6
            state.slots[slot].left = last;
634
6
            if (!stack.empty()) {
635
2
                state.slots[stack.back()].right = static_cast<int32_t>(slot);
636
2
            }
637
6
            stack.push_back(static_cast<int32_t>(slot));
638
6
        }
639
2
        state.root = stack.empty() ? State::NO_SLOT : stack.front();
640
2
        refresh_worst(state);
641
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_28EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_29EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
591
14
    static void assign_sorted(State& state, DorisVector<Entry> values) {
592
14
        const size_t size = values.size();
593
14
        check_slot_capacity(size);
594
14
        state.slots.assign(size, Slot {});
595
38
        for (size_t slot = 0; slot != size; ++slot) {
596
24
            state.slots[slot].count = values[slot].count;
597
24
        }
598
        if constexpr (IS_STRING) {
599
            // The entries may point into this state's own arena, so the new arena is built aside
600
            // and swapped in before the old one is dropped.
601
            PaddedPODArray<char, 32> bytes;
602
            size_t live_bytes = 0;
603
            for (size_t slot = 0; slot != size; ++slot) {
604
                const StringRef value = values[slot].value;
605
                Payload& payload = state.slots[slot].payload;
606
                payload.offset = bytes.size();
607
                payload.length = value.size;
608
                if (value.size != 0) {
609
                    bytes.insert(value.data, value.data + value.size);
610
                }
611
                live_bytes += value.size;
612
            }
613
            state.bytes.swap(bytes);
614
            state.live_payload_bytes = live_bytes;
615
            state.dead_payload_bytes = 0;
616
14
        } else {
617
38
            for (size_t slot = 0; slot != size; ++slot) {
618
24
                state.slots[slot].payload = values[slot].value;
619
24
            }
620
14
        }
621
14
        state.live = static_cast<uint32_t>(size);
622
14
        state.dead = 0;
623
14
        DorisVector<int32_t> stack;
624
14
        stack.reserve(size);
625
38
        for (size_t slot = 0; slot != size; ++slot) {
626
24
            state.slots[slot].priority = next_priority(state);
627
24
            int32_t last = State::NO_SLOT;
628
32
            while (!stack.empty() &&
629
32
                   state.slots[stack.back()].priority < state.slots[slot].priority) {
630
8
                last = stack.back();
631
8
                stack.pop_back();
632
8
            }
633
24
            state.slots[slot].left = last;
634
24
            if (!stack.empty()) {
635
3
                state.slots[stack.back()].right = static_cast<int32_t>(slot);
636
3
            }
637
24
            stack.push_back(static_cast<int32_t>(slot));
638
24
        }
639
14
        state.root = stack.empty() ? State::NO_SLOT : stack.front();
640
14
        refresh_worst(state);
641
14
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_20EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_30EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_35EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_10EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
591
15
    static void assign_sorted(State& state, DorisVector<Entry> values) {
592
15
        const size_t size = values.size();
593
15
        check_slot_capacity(size);
594
15
        state.slots.assign(size, Slot {});
595
41
        for (size_t slot = 0; slot != size; ++slot) {
596
26
            state.slots[slot].count = values[slot].count;
597
26
        }
598
15
        if constexpr (IS_STRING) {
599
            // The entries may point into this state's own arena, so the new arena is built aside
600
            // and swapped in before the old one is dropped.
601
15
            PaddedPODArray<char, 32> bytes;
602
15
            size_t live_bytes = 0;
603
41
            for (size_t slot = 0; slot != size; ++slot) {
604
26
                const StringRef value = values[slot].value;
605
26
                Payload& payload = state.slots[slot].payload;
606
26
                payload.offset = bytes.size();
607
26
                payload.length = value.size;
608
26
                if (value.size != 0) {
609
26
                    bytes.insert(value.data, value.data + value.size);
610
26
                }
611
26
                live_bytes += value.size;
612
26
            }
613
15
            state.bytes.swap(bytes);
614
15
            state.live_payload_bytes = live_bytes;
615
15
            state.dead_payload_bytes = 0;
616
        } else {
617
            for (size_t slot = 0; slot != size; ++slot) {
618
                state.slots[slot].payload = values[slot].value;
619
            }
620
        }
621
15
        state.live = static_cast<uint32_t>(size);
622
15
        state.dead = 0;
623
15
        DorisVector<int32_t> stack;
624
15
        stack.reserve(size);
625
41
        for (size_t slot = 0; slot != size; ++slot) {
626
26
            state.slots[slot].priority = next_priority(state);
627
26
            int32_t last = State::NO_SLOT;
628
31
            while (!stack.empty() &&
629
31
                   state.slots[stack.back()].priority < state.slots[slot].priority) {
630
5
                last = stack.back();
631
5
                stack.pop_back();
632
5
            }
633
26
            state.slots[slot].left = last;
634
26
            if (!stack.empty()) {
635
7
                state.slots[stack.back()].right = static_cast<int32_t>(slot);
636
7
            }
637
26
            stack.push_back(static_cast<int32_t>(slot));
638
26
        }
639
15
        state.root = stack.empty() ? State::NO_SLOT : stack.front();
640
15
        refresh_worst(state);
641
15
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_11EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_12EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_25EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_26EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Line
Count
Source
591
8
    static void assign_sorted(State& state, DorisVector<Entry> values) {
592
8
        const size_t size = values.size();
593
8
        check_slot_capacity(size);
594
8
        state.slots.assign(size, Slot {});
595
19
        for (size_t slot = 0; slot != size; ++slot) {
596
11
            state.slots[slot].count = values[slot].count;
597
11
        }
598
        if constexpr (IS_STRING) {
599
            // The entries may point into this state's own arena, so the new arena is built aside
600
            // and swapped in before the old one is dropped.
601
            PaddedPODArray<char, 32> bytes;
602
            size_t live_bytes = 0;
603
            for (size_t slot = 0; slot != size; ++slot) {
604
                const StringRef value = values[slot].value;
605
                Payload& payload = state.slots[slot].payload;
606
                payload.offset = bytes.size();
607
                payload.length = value.size;
608
                if (value.size != 0) {
609
                    bytes.insert(value.data, value.data + value.size);
610
                }
611
                live_bytes += value.size;
612
            }
613
            state.bytes.swap(bytes);
614
            state.live_payload_bytes = live_bytes;
615
            state.dead_payload_bytes = 0;
616
8
        } else {
617
19
            for (size_t slot = 0; slot != size; ++slot) {
618
11
                state.slots[slot].payload = values[slot].value;
619
11
            }
620
8
        }
621
8
        state.live = static_cast<uint32_t>(size);
622
8
        state.dead = 0;
623
8
        DorisVector<int32_t> stack;
624
8
        stack.reserve(size);
625
19
        for (size_t slot = 0; slot != size; ++slot) {
626
11
            state.slots[slot].priority = next_priority(state);
627
11
            int32_t last = State::NO_SLOT;
628
13
            while (!stack.empty() &&
629
13
                   state.slots[stack.back()].priority < state.slots[slot].priority) {
630
2
                last = stack.back();
631
2
                stack.pop_back();
632
2
            }
633
11
            state.slots[slot].left = last;
634
11
            if (!stack.empty()) {
635
3
                state.slots[stack.back()].right = static_cast<int32_t>(slot);
636
3
            }
637
11
            stack.push_back(static_cast<int32_t>(slot));
638
11
        }
639
8
        state.root = stack.empty() ? State::NO_SLOT : stack.front();
640
8
        refresh_worst(state);
641
8
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_27EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_43EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_42EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_36EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_37EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE13assign_sortedERNS_22AggregateTopKCountDataILS1_44EEESt6vectorINS4_5EntryENS_18CustomStdAllocatorIS7_NS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEE
642
643
    /// Reclaims the slots evicted since the last compaction. The O(k) rebuild is charged to the
644
    /// k/2 evictions that produced the dead slots, so it stays O(1) amortized per row.
645
75
    static void compact(State& state) {
646
75
        DorisVector<int32_t> slots;
647
75
        collect_in_order(state, slots);
648
75
        DorisVector<Entry> values;
649
75
        values.reserve(slots.size());
650
1.32k
        for (int32_t slot : slots) {
651
1.32k
            values.push_back(Entry {value_of(state, slot), state.slots[slot].count});
652
1.32k
        }
653
75
        assign_sorted(state, std::move(values));
654
75
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE7compactERNS_22AggregateTopKCountDataILS1_2EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE7compactERNS_22AggregateTopKCountDataILS1_3EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE7compactERNS_22AggregateTopKCountDataILS1_4EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE7compactERNS_22AggregateTopKCountDataILS1_5EEE
Line
Count
Source
645
42
    static void compact(State& state) {
646
42
        DorisVector<int32_t> slots;
647
42
        collect_in_order(state, slots);
648
42
        DorisVector<Entry> values;
649
42
        values.reserve(slots.size());
650
1.17k
        for (int32_t slot : slots) {
651
1.17k
            values.push_back(Entry {value_of(state, slot), state.slots[slot].count});
652
1.17k
        }
653
42
        assign_sorted(state, std::move(values));
654
42
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE7compactERNS_22AggregateTopKCountDataILS1_6EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE7compactERNS_22AggregateTopKCountDataILS1_7EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE7compactERNS_22AggregateTopKCountDataILS1_8EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE7compactERNS_22AggregateTopKCountDataILS1_9EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE7compactERNS_22AggregateTopKCountDataILS1_28EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE7compactERNS_22AggregateTopKCountDataILS1_29EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE7compactERNS_22AggregateTopKCountDataILS1_20EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE7compactERNS_22AggregateTopKCountDataILS1_30EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE7compactERNS_22AggregateTopKCountDataILS1_35EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE7compactERNS_22AggregateTopKCountDataILS1_10EEE
Line
Count
Source
645
3
    static void compact(State& state) {
646
3
        DorisVector<int32_t> slots;
647
3
        collect_in_order(state, slots);
648
3
        DorisVector<Entry> values;
649
3
        values.reserve(slots.size());
650
24
        for (int32_t slot : slots) {
651
24
            values.push_back(Entry {value_of(state, slot), state.slots[slot].count});
652
24
        }
653
3
        assign_sorted(state, std::move(values));
654
3
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE7compactERNS_22AggregateTopKCountDataILS1_11EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE7compactERNS_22AggregateTopKCountDataILS1_12EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE7compactERNS_22AggregateTopKCountDataILS1_25EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE7compactERNS_22AggregateTopKCountDataILS1_26EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE7compactERNS_22AggregateTopKCountDataILS1_27EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE7compactERNS_22AggregateTopKCountDataILS1_43EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE7compactERNS_22AggregateTopKCountDataILS1_42EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE7compactERNS_22AggregateTopKCountDataILS1_36EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE7compactERNS_22AggregateTopKCountDataILS1_37EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE7compactERNS_22AggregateTopKCountDataILS1_44EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE7compactERNS_22AggregateTopKCountDataILS1_2EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE7compactERNS_22AggregateTopKCountDataILS1_3EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE7compactERNS_22AggregateTopKCountDataILS1_4EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE7compactERNS_22AggregateTopKCountDataILS1_5EEE
Line
Count
Source
645
22
    static void compact(State& state) {
646
22
        DorisVector<int32_t> slots;
647
22
        collect_in_order(state, slots);
648
22
        DorisVector<Entry> values;
649
22
        values.reserve(slots.size());
650
111
        for (int32_t slot : slots) {
651
111
            values.push_back(Entry {value_of(state, slot), state.slots[slot].count});
652
111
        }
653
22
        assign_sorted(state, std::move(values));
654
22
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE7compactERNS_22AggregateTopKCountDataILS1_6EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE7compactERNS_22AggregateTopKCountDataILS1_7EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE7compactERNS_22AggregateTopKCountDataILS1_8EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE7compactERNS_22AggregateTopKCountDataILS1_9EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE7compactERNS_22AggregateTopKCountDataILS1_28EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE7compactERNS_22AggregateTopKCountDataILS1_29EEE
Line
Count
Source
645
3
    static void compact(State& state) {
646
3
        DorisVector<int32_t> slots;
647
3
        collect_in_order(state, slots);
648
3
        DorisVector<Entry> values;
649
3
        values.reserve(slots.size());
650
6
        for (int32_t slot : slots) {
651
6
            values.push_back(Entry {value_of(state, slot), state.slots[slot].count});
652
6
        }
653
3
        assign_sorted(state, std::move(values));
654
3
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE7compactERNS_22AggregateTopKCountDataILS1_20EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE7compactERNS_22AggregateTopKCountDataILS1_30EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE7compactERNS_22AggregateTopKCountDataILS1_35EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE7compactERNS_22AggregateTopKCountDataILS1_10EEE
Line
Count
Source
645
4
    static void compact(State& state) {
646
4
        DorisVector<int32_t> slots;
647
4
        collect_in_order(state, slots);
648
4
        DorisVector<Entry> values;
649
4
        values.reserve(slots.size());
650
8
        for (int32_t slot : slots) {
651
8
            values.push_back(Entry {value_of(state, slot), state.slots[slot].count});
652
8
        }
653
4
        assign_sorted(state, std::move(values));
654
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE7compactERNS_22AggregateTopKCountDataILS1_11EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE7compactERNS_22AggregateTopKCountDataILS1_12EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE7compactERNS_22AggregateTopKCountDataILS1_25EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE7compactERNS_22AggregateTopKCountDataILS1_26EEE
Line
Count
Source
645
1
    static void compact(State& state) {
646
1
        DorisVector<int32_t> slots;
647
1
        collect_in_order(state, slots);
648
1
        DorisVector<Entry> values;
649
1
        values.reserve(slots.size());
650
2
        for (int32_t slot : slots) {
651
2
            values.push_back(Entry {value_of(state, slot), state.slots[slot].count});
652
2
        }
653
1
        assign_sorted(state, std::move(values));
654
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE7compactERNS_22AggregateTopKCountDataILS1_27EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE7compactERNS_22AggregateTopKCountDataILS1_43EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE7compactERNS_22AggregateTopKCountDataILS1_42EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE7compactERNS_22AggregateTopKCountDataILS1_36EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE7compactERNS_22AggregateTopKCountDataILS1_37EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE7compactERNS_22AggregateTopKCountDataILS1_44EEE
655
656
    /// Reclaims the dead slots or the evicted payload once it outnumbers the live one. Checked
657
    /// right after an eviction as well, so the last eviction of a group does not keep a large
658
    /// discarded payload until the next row arrives.
659
22.6k
    static void maybe_compact(State& state) {
660
22.6k
        if (state.dead > state.live || evicted_payload_exceeds_live(state)) {
661
75
            compact(state);
662
75
        }
663
22.6k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_2EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_3EEE
Line
Count
Source
659
1
    static void maybe_compact(State& state) {
660
1
        if (state.dead > state.live || evicted_payload_exceeds_live(state)) {
661
0
            compact(state);
662
0
        }
663
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_4EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_5EEE
Line
Count
Source
659
12.0k
    static void maybe_compact(State& state) {
660
12.0k
        if (state.dead > state.live || evicted_payload_exceeds_live(state)) {
661
42
            compact(state);
662
42
        }
663
12.0k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_6EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_7EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_8EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_9EEE
Line
Count
Source
659
5
    static void maybe_compact(State& state) {
660
5
        if (state.dead > state.live || evicted_payload_exceeds_live(state)) {
661
0
            compact(state);
662
0
        }
663
5
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_28EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_29EEE
Line
Count
Source
659
42
    static void maybe_compact(State& state) {
660
42
        if (state.dead > state.live || evicted_payload_exceeds_live(state)) {
661
0
            compact(state);
662
0
        }
663
42
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_20EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_30EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_35EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_10EEE
Line
Count
Source
659
102
    static void maybe_compact(State& state) {
660
102
        if (state.dead > state.live || evicted_payload_exceeds_live(state)) {
661
3
            compact(state);
662
3
        }
663
102
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_11EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_12EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_25EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_26EEE
Line
Count
Source
659
15
    static void maybe_compact(State& state) {
660
15
        if (state.dead > state.live || evicted_payload_exceeds_live(state)) {
661
0
            compact(state);
662
0
        }
663
15
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_27EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_43EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_42EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_36EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_37EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE13maybe_compactERNS_22AggregateTopKCountDataILS1_44EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_2EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_3EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_4EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_5EEE
Line
Count
Source
659
10.2k
    static void maybe_compact(State& state) {
660
10.2k
        if (state.dead > state.live || evicted_payload_exceeds_live(state)) {
661
22
            compact(state);
662
22
        }
663
10.2k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_6EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_7EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_8EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_9EEE
Line
Count
Source
659
5
    static void maybe_compact(State& state) {
660
5
        if (state.dead > state.live || evicted_payload_exceeds_live(state)) {
661
0
            compact(state);
662
0
        }
663
5
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_28EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_29EEE
Line
Count
Source
659
52
    static void maybe_compact(State& state) {
660
52
        if (state.dead > state.live || evicted_payload_exceeds_live(state)) {
661
3
            compact(state);
662
3
        }
663
52
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_20EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_30EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_35EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_10EEE
Line
Count
Source
659
63
    static void maybe_compact(State& state) {
660
63
        if (state.dead > state.live || evicted_payload_exceeds_live(state)) {
661
4
            compact(state);
662
4
        }
663
63
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_11EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_12EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_25EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_26EEE
Line
Count
Source
659
20
    static void maybe_compact(State& state) {
660
20
        if (state.dead > state.live || evicted_payload_exceeds_live(state)) {
661
1
            compact(state);
662
1
        }
663
20
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_27EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_43EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_42EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_36EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_37EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE13maybe_compactERNS_22AggregateTopKCountDataILS1_44EEE
664
665
20.8k
    static void check_k(State& state, const IColumn& count_column, size_t row_num) {
666
20.8k
        const IColumn* nested = &count_column;
667
20.8k
        if (const auto* nullable = check_and_get_column<ColumnNullable>(&count_column)) {
668
5
            if (UNLIKELY(nullable->is_null_at(row_num))) {
669
3
                throw Exception(ErrorCode::INVALID_ARGUMENT,
670
3
                                "the count of min_topk and max_topk must be a non-null "
671
3
                                "constant");
672
3
            }
673
2
            nested = &nullable->get_nested_column();
674
2
        }
675
20.8k
        int64_t value =
676
20.8k
                assert_cast<const ColumnInt64&, TypeCheckOnRelease::DISABLE>(*nested).get_element(
677
20.8k
                        row_num);
678
20.8k
        if (state.k == State::NO_K) {
679
161
            if (UNLIKELY(value < 0)) {
680
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
681
0
                                "the count of min_topk and max_topk must be a non-negative "
682
0
                                "constant, but got {}",
683
0
                                value);
684
0
            }
685
161
            state.k = value;
686
20.7k
        } else {
687
            // k comes from the same constant expression on every row and every partial state.
688
20.7k
            DCHECK_EQ(state.k, value);
689
20.7k
        }
690
20.8k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_2EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_3EEERKNS_7IColumnEm
Line
Count
Source
665
1
    static void check_k(State& state, const IColumn& count_column, size_t row_num) {
666
1
        const IColumn* nested = &count_column;
667
1
        if (const auto* nullable = check_and_get_column<ColumnNullable>(&count_column)) {
668
0
            if (UNLIKELY(nullable->is_null_at(row_num))) {
669
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
670
0
                                "the count of min_topk and max_topk must be a non-null "
671
0
                                "constant");
672
0
            }
673
0
            nested = &nullable->get_nested_column();
674
0
        }
675
1
        int64_t value =
676
1
                assert_cast<const ColumnInt64&, TypeCheckOnRelease::DISABLE>(*nested).get_element(
677
1
                        row_num);
678
1
        if (state.k == State::NO_K) {
679
1
            if (UNLIKELY(value < 0)) {
680
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
681
0
                                "the count of min_topk and max_topk must be a non-negative "
682
0
                                "constant, but got {}",
683
0
                                value);
684
0
            }
685
1
            state.k = value;
686
1
        } else {
687
            // k comes from the same constant expression on every row and every partial state.
688
            DCHECK_EQ(state.k, value);
689
0
        }
690
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_4EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_5EEERKNS_7IColumnEm
Line
Count
Source
665
10.4k
    static void check_k(State& state, const IColumn& count_column, size_t row_num) {
666
10.4k
        const IColumn* nested = &count_column;
667
10.4k
        if (const auto* nullable = check_and_get_column<ColumnNullable>(&count_column)) {
668
4
            if (UNLIKELY(nullable->is_null_at(row_num))) {
669
2
                throw Exception(ErrorCode::INVALID_ARGUMENT,
670
2
                                "the count of min_topk and max_topk must be a non-null "
671
2
                                "constant");
672
2
            }
673
2
            nested = &nullable->get_nested_column();
674
2
        }
675
10.3k
        int64_t value =
676
10.3k
                assert_cast<const ColumnInt64&, TypeCheckOnRelease::DISABLE>(*nested).get_element(
677
10.3k
                        row_num);
678
10.3k
        if (state.k == State::NO_K) {
679
60
            if (UNLIKELY(value < 0)) {
680
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
681
0
                                "the count of min_topk and max_topk must be a non-negative "
682
0
                                "constant, but got {}",
683
0
                                value);
684
0
            }
685
60
            state.k = value;
686
10.3k
        } else {
687
            // k comes from the same constant expression on every row and every partial state.
688
            DCHECK_EQ(state.k, value);
689
10.3k
        }
690
10.3k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_6EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_7EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_8EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_9EEERKNS_7IColumnEm
Line
Count
Source
665
5
    static void check_k(State& state, const IColumn& count_column, size_t row_num) {
666
5
        const IColumn* nested = &count_column;
667
5
        if (const auto* nullable = check_and_get_column<ColumnNullable>(&count_column)) {
668
0
            if (UNLIKELY(nullable->is_null_at(row_num))) {
669
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
670
0
                                "the count of min_topk and max_topk must be a non-null "
671
0
                                "constant");
672
0
            }
673
0
            nested = &nullable->get_nested_column();
674
0
        }
675
5
        int64_t value =
676
5
                assert_cast<const ColumnInt64&, TypeCheckOnRelease::DISABLE>(*nested).get_element(
677
5
                        row_num);
678
5
        if (state.k == State::NO_K) {
679
1
            if (UNLIKELY(value < 0)) {
680
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
681
0
                                "the count of min_topk and max_topk must be a non-negative "
682
0
                                "constant, but got {}",
683
0
                                value);
684
0
            }
685
1
            state.k = value;
686
4
        } else {
687
            // k comes from the same constant expression on every row and every partial state.
688
            DCHECK_EQ(state.k, value);
689
4
        }
690
5
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_28EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_29EEERKNS_7IColumnEm
Line
Count
Source
665
44
    static void check_k(State& state, const IColumn& count_column, size_t row_num) {
666
44
        const IColumn* nested = &count_column;
667
44
        if (const auto* nullable = check_and_get_column<ColumnNullable>(&count_column)) {
668
0
            if (UNLIKELY(nullable->is_null_at(row_num))) {
669
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
670
0
                                "the count of min_topk and max_topk must be a non-null "
671
0
                                "constant");
672
0
            }
673
0
            nested = &nullable->get_nested_column();
674
0
        }
675
44
        int64_t value =
676
44
                assert_cast<const ColumnInt64&, TypeCheckOnRelease::DISABLE>(*nested).get_element(
677
44
                        row_num);
678
44
        if (state.k == State::NO_K) {
679
7
            if (UNLIKELY(value < 0)) {
680
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
681
0
                                "the count of min_topk and max_topk must be a non-negative "
682
0
                                "constant, but got {}",
683
0
                                value);
684
0
            }
685
7
            state.k = value;
686
37
        } else {
687
            // k comes from the same constant expression on every row and every partial state.
688
            DCHECK_EQ(state.k, value);
689
37
        }
690
44
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_20EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_30EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_35EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_10EEERKNS_7IColumnEm
Line
Count
Source
665
93
    static void check_k(State& state, const IColumn& count_column, size_t row_num) {
666
93
        const IColumn* nested = &count_column;
667
93
        if (const auto* nullable = check_and_get_column<ColumnNullable>(&count_column)) {
668
0
            if (UNLIKELY(nullable->is_null_at(row_num))) {
669
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
670
0
                                "the count of min_topk and max_topk must be a non-null "
671
0
                                "constant");
672
0
            }
673
0
            nested = &nullable->get_nested_column();
674
0
        }
675
93
        int64_t value =
676
93
                assert_cast<const ColumnInt64&, TypeCheckOnRelease::DISABLE>(*nested).get_element(
677
93
                        row_num);
678
93
        if (state.k == State::NO_K) {
679
24
            if (UNLIKELY(value < 0)) {
680
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
681
0
                                "the count of min_topk and max_topk must be a non-negative "
682
0
                                "constant, but got {}",
683
0
                                value);
684
0
            }
685
24
            state.k = value;
686
69
        } else {
687
            // k comes from the same constant expression on every row and every partial state.
688
            DCHECK_EQ(state.k, value);
689
69
        }
690
93
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_11EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_12EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_25EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_26EEERKNS_7IColumnEm
Line
Count
Source
665
22
    static void check_k(State& state, const IColumn& count_column, size_t row_num) {
666
22
        const IColumn* nested = &count_column;
667
22
        if (const auto* nullable = check_and_get_column<ColumnNullable>(&count_column)) {
668
0
            if (UNLIKELY(nullable->is_null_at(row_num))) {
669
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
670
0
                                "the count of min_topk and max_topk must be a non-null "
671
0
                                "constant");
672
0
            }
673
0
            nested = &nullable->get_nested_column();
674
0
        }
675
22
        int64_t value =
676
22
                assert_cast<const ColumnInt64&, TypeCheckOnRelease::DISABLE>(*nested).get_element(
677
22
                        row_num);
678
22
        if (state.k == State::NO_K) {
679
5
            if (UNLIKELY(value < 0)) {
680
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
681
0
                                "the count of min_topk and max_topk must be a non-negative "
682
0
                                "constant, but got {}",
683
0
                                value);
684
0
            }
685
5
            state.k = value;
686
17
        } else {
687
            // k comes from the same constant expression on every row and every partial state.
688
            DCHECK_EQ(state.k, value);
689
17
        }
690
22
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_27EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_43EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_42EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_36EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_37EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE7check_kERNS_22AggregateTopKCountDataILS1_44EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_2EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_3EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_4EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_5EEERKNS_7IColumnEm
Line
Count
Source
665
10.1k
    static void check_k(State& state, const IColumn& count_column, size_t row_num) {
666
10.1k
        const IColumn* nested = &count_column;
667
10.1k
        if (const auto* nullable = check_and_get_column<ColumnNullable>(&count_column)) {
668
1
            if (UNLIKELY(nullable->is_null_at(row_num))) {
669
1
                throw Exception(ErrorCode::INVALID_ARGUMENT,
670
1
                                "the count of min_topk and max_topk must be a non-null "
671
1
                                "constant");
672
1
            }
673
0
            nested = &nullable->get_nested_column();
674
0
        }
675
10.1k
        int64_t value =
676
10.1k
                assert_cast<const ColumnInt64&, TypeCheckOnRelease::DISABLE>(*nested).get_element(
677
10.1k
                        row_num);
678
10.1k
        if (state.k == State::NO_K) {
679
42
            if (UNLIKELY(value < 0)) {
680
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
681
0
                                "the count of min_topk and max_topk must be a non-negative "
682
0
                                "constant, but got {}",
683
0
                                value);
684
0
            }
685
42
            state.k = value;
686
10.1k
        } else {
687
            // k comes from the same constant expression on every row and every partial state.
688
            DCHECK_EQ(state.k, value);
689
10.1k
        }
690
10.1k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_6EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_7EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_8EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_9EEERKNS_7IColumnEm
Line
Count
Source
665
5
    static void check_k(State& state, const IColumn& count_column, size_t row_num) {
666
5
        const IColumn* nested = &count_column;
667
5
        if (const auto* nullable = check_and_get_column<ColumnNullable>(&count_column)) {
668
0
            if (UNLIKELY(nullable->is_null_at(row_num))) {
669
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
670
0
                                "the count of min_topk and max_topk must be a non-null "
671
0
                                "constant");
672
0
            }
673
0
            nested = &nullable->get_nested_column();
674
0
        }
675
5
        int64_t value =
676
5
                assert_cast<const ColumnInt64&, TypeCheckOnRelease::DISABLE>(*nested).get_element(
677
5
                        row_num);
678
5
        if (state.k == State::NO_K) {
679
1
            if (UNLIKELY(value < 0)) {
680
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
681
0
                                "the count of min_topk and max_topk must be a non-negative "
682
0
                                "constant, but got {}",
683
0
                                value);
684
0
            }
685
1
            state.k = value;
686
4
        } else {
687
            // k comes from the same constant expression on every row and every partial state.
688
            DCHECK_EQ(state.k, value);
689
4
        }
690
5
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_28EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_29EEERKNS_7IColumnEm
Line
Count
Source
665
44
    static void check_k(State& state, const IColumn& count_column, size_t row_num) {
666
44
        const IColumn* nested = &count_column;
667
44
        if (const auto* nullable = check_and_get_column<ColumnNullable>(&count_column)) {
668
0
            if (UNLIKELY(nullable->is_null_at(row_num))) {
669
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
670
0
                                "the count of min_topk and max_topk must be a non-null "
671
0
                                "constant");
672
0
            }
673
0
            nested = &nullable->get_nested_column();
674
0
        }
675
44
        int64_t value =
676
44
                assert_cast<const ColumnInt64&, TypeCheckOnRelease::DISABLE>(*nested).get_element(
677
44
                        row_num);
678
44
        if (state.k == State::NO_K) {
679
7
            if (UNLIKELY(value < 0)) {
680
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
681
0
                                "the count of min_topk and max_topk must be a non-negative "
682
0
                                "constant, but got {}",
683
0
                                value);
684
0
            }
685
7
            state.k = value;
686
37
        } else {
687
            // k comes from the same constant expression on every row and every partial state.
688
            DCHECK_EQ(state.k, value);
689
37
        }
690
44
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_20EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_30EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_35EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_10EEERKNS_7IColumnEm
Line
Count
Source
665
48
    static void check_k(State& state, const IColumn& count_column, size_t row_num) {
666
48
        const IColumn* nested = &count_column;
667
48
        if (const auto* nullable = check_and_get_column<ColumnNullable>(&count_column)) {
668
0
            if (UNLIKELY(nullable->is_null_at(row_num))) {
669
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
670
0
                                "the count of min_topk and max_topk must be a non-null "
671
0
                                "constant");
672
0
            }
673
0
            nested = &nullable->get_nested_column();
674
0
        }
675
48
        int64_t value =
676
48
                assert_cast<const ColumnInt64&, TypeCheckOnRelease::DISABLE>(*nested).get_element(
677
48
                        row_num);
678
48
        if (state.k == State::NO_K) {
679
8
            if (UNLIKELY(value < 0)) {
680
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
681
0
                                "the count of min_topk and max_topk must be a non-negative "
682
0
                                "constant, but got {}",
683
0
                                value);
684
0
            }
685
8
            state.k = value;
686
40
        } else {
687
            // k comes from the same constant expression on every row and every partial state.
688
            DCHECK_EQ(state.k, value);
689
40
        }
690
48
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_11EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_12EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_25EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_26EEERKNS_7IColumnEm
Line
Count
Source
665
22
    static void check_k(State& state, const IColumn& count_column, size_t row_num) {
666
22
        const IColumn* nested = &count_column;
667
22
        if (const auto* nullable = check_and_get_column<ColumnNullable>(&count_column)) {
668
0
            if (UNLIKELY(nullable->is_null_at(row_num))) {
669
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
670
0
                                "the count of min_topk and max_topk must be a non-null "
671
0
                                "constant");
672
0
            }
673
0
            nested = &nullable->get_nested_column();
674
0
        }
675
22
        int64_t value =
676
22
                assert_cast<const ColumnInt64&, TypeCheckOnRelease::DISABLE>(*nested).get_element(
677
22
                        row_num);
678
22
        if (state.k == State::NO_K) {
679
5
            if (UNLIKELY(value < 0)) {
680
0
                throw Exception(ErrorCode::INVALID_ARGUMENT,
681
0
                                "the count of min_topk and max_topk must be a non-negative "
682
0
                                "constant, but got {}",
683
0
                                value);
684
0
            }
685
5
            state.k = value;
686
17
        } else {
687
            // k comes from the same constant expression on every row and every partial state.
688
            DCHECK_EQ(state.k, value);
689
17
        }
690
22
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_27EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_43EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_42EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_36EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_37EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE7check_kERNS_22AggregateTopKCountDataILS1_44EEERKNS_7IColumnEm
691
692
141
    static int64_t checked_add(int64_t lhs, int64_t rhs) {
693
141
        int64_t result = 0;
694
141
        if (UNLIKELY(__builtin_add_overflow(lhs, rhs, &result))) {
695
1
            throw Exception(ErrorCode::INVALID_ARGUMENT, "min_topk/max_topk value count overflow");
696
1
        }
697
140
        return result;
698
141
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE11checked_addEll
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE11checked_addEll
Line
Count
Source
692
58
    static int64_t checked_add(int64_t lhs, int64_t rhs) {
693
58
        int64_t result = 0;
694
58
        if (UNLIKELY(__builtin_add_overflow(lhs, rhs, &result))) {
695
1
            throw Exception(ErrorCode::INVALID_ARGUMENT, "min_topk/max_topk value count overflow");
696
1
        }
697
57
        return result;
698
58
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE11checked_addEll
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE11checked_addEll
Line
Count
Source
692
2
    static int64_t checked_add(int64_t lhs, int64_t rhs) {
693
2
        int64_t result = 0;
694
2
        if (UNLIKELY(__builtin_add_overflow(lhs, rhs, &result))) {
695
0
            throw Exception(ErrorCode::INVALID_ARGUMENT, "min_topk/max_topk value count overflow");
696
0
        }
697
2
        return result;
698
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE11checked_addEll
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE11checked_addEll
Line
Count
Source
692
10
    static int64_t checked_add(int64_t lhs, int64_t rhs) {
693
10
        int64_t result = 0;
694
10
        if (UNLIKELY(__builtin_add_overflow(lhs, rhs, &result))) {
695
0
            throw Exception(ErrorCode::INVALID_ARGUMENT, "min_topk/max_topk value count overflow");
696
0
        }
697
10
        return result;
698
10
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE11checked_addEll
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE11checked_addEll
Line
Count
Source
692
10
    static int64_t checked_add(int64_t lhs, int64_t rhs) {
693
10
        int64_t result = 0;
694
10
        if (UNLIKELY(__builtin_add_overflow(lhs, rhs, &result))) {
695
0
            throw Exception(ErrorCode::INVALID_ARGUMENT, "min_topk/max_topk value count overflow");
696
0
        }
697
10
        return result;
698
10
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE11checked_addEll
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE11checked_addEll
Line
Count
Source
692
41
    static int64_t checked_add(int64_t lhs, int64_t rhs) {
693
41
        int64_t result = 0;
694
41
        if (UNLIKELY(__builtin_add_overflow(lhs, rhs, &result))) {
695
0
            throw Exception(ErrorCode::INVALID_ARGUMENT, "min_topk/max_topk value count overflow");
696
0
        }
697
41
        return result;
698
41
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE11checked_addEll
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE11checked_addEll
Line
Count
Source
692
2
    static int64_t checked_add(int64_t lhs, int64_t rhs) {
693
2
        int64_t result = 0;
694
2
        if (UNLIKELY(__builtin_add_overflow(lhs, rhs, &result))) {
695
0
            throw Exception(ErrorCode::INVALID_ARGUMENT, "min_topk/max_topk value count overflow");
696
0
        }
697
2
        return result;
698
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE11checked_addEll
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE11checked_addEll
Line
Count
Source
692
7
    static int64_t checked_add(int64_t lhs, int64_t rhs) {
693
7
        int64_t result = 0;
694
7
        if (UNLIKELY(__builtin_add_overflow(lhs, rhs, &result))) {
695
0
            throw Exception(ErrorCode::INVALID_ARGUMENT, "min_topk/max_topk value count overflow");
696
0
        }
697
7
        return result;
698
7
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE11checked_addEll
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE11checked_addEll
Line
Count
Source
692
10
    static int64_t checked_add(int64_t lhs, int64_t rhs) {
693
10
        int64_t result = 0;
694
10
        if (UNLIKELY(__builtin_add_overflow(lhs, rhs, &result))) {
695
0
            throw Exception(ErrorCode::INVALID_ARGUMENT, "min_topk/max_topk value count overflow");
696
0
        }
697
10
        return result;
698
10
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE11checked_addEll
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE11checked_addEll
Line
Count
Source
692
1
    static int64_t checked_add(int64_t lhs, int64_t rhs) {
693
1
        int64_t result = 0;
694
1
        if (UNLIKELY(__builtin_add_overflow(lhs, rhs, &result))) {
695
0
            throw Exception(ErrorCode::INVALID_ARGUMENT, "min_topk/max_topk value count overflow");
696
0
        }
697
1
        return result;
698
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE11checked_addEll
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE11checked_addEll
699
700
    /// k == 0 fast path: only the extreme value is tracked.
701
20.7k
    static void add_value(State& state, const IColumn& column, size_t row_num) {
702
20.7k
        if (state.k == 0) {
703
45
            if (state.live == 0) {
704
11
                state.root = append_slot(state, column, row_num, 1);
705
11
                state.worst = state.root;
706
11
                return;
707
11
            }
708
34
            int cmp = compare_values(value_at(column, row_num), value_of(state, 0));
709
34
            if (cmp == 0) {
710
11
                state.slots[0].count = checked_add(state.slots[0].count, 1);
711
23
            } else if (comes_before(cmp)) {
712
                // The new value is better: replace the tracked extreme. The slot and the
713
                // single-node tree stay in place, only the stored value changes.
714
8
                replace_value(state, 0, value_at(column, row_num));
715
8
                state.slots[0].count = 1;
716
8
            }
717
34
            return;
718
45
        }
719
720
        // Dead slots and evicted payload are reclaimed once they outnumber the live ones.
721
20.7k
        maybe_compact(state);
722
723
20.7k
        if (state.live >= state.k) {
724
            // A full list rejects or absorbs most rows: comparing with the eviction candidate
725
            // costs one comparison, while the tree descent would cost log2(k).
726
19.2k
            int cmp = compare_values(value_at(column, row_num), value_of(state, state.worst));
727
19.2k
            if (cmp == 0) {
728
23
                state.slots[state.worst].count = checked_add(state.slots[state.worst].count, 1);
729
23
                return;
730
23
            }
731
19.2k
            if (is_worse(cmp)) {
732
17.2k
                return;
733
17.2k
            }
734
19.2k
        }
735
736
3.41k
        int32_t inserted = State::NO_SLOT;
737
3.41k
        state.root = add_or_increment(state, state.root, value_at(column, row_num), 1, &inserted);
738
3.41k
        if (inserted == State::NO_SLOT) {
739
99
            return;
740
99
        }
741
3.32k
        if (state.live <= state.k) {
742
            // Not over capacity: the new entry competes with the cached worst for the eviction
743
            // candidate role.
744
1.36k
            if (state.worst == State::NO_SLOT ||
745
1.36k
                is_worse(compare_slots(state, inserted, state.worst))) {
746
772
                state.worst = inserted;
747
772
            }
748
1.36k
            return;
749
1.36k
        }
750
        // The list was full and the value is new. It beat the cached worst above, so it cannot be
751
        // the worst itself; the old worst is still the rightmost entry and leaves the list.
752
1.95k
        int32_t removed = State::NO_SLOT;
753
1.95k
        state.root = erase_worst(state, state.root, &removed);
754
1.95k
        DCHECK_EQ(removed, state.worst);
755
1.95k
        evict_value(state, removed);
756
1.95k
        state.slots[removed].count = State::DEAD_COUNT;
757
1.95k
        --state.live;
758
1.95k
        ++state.dead;
759
1.95k
        refresh_worst(state);
760
1.95k
        maybe_compact(state);
761
1.95k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_2EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_3EEERKNS_7IColumnEm
Line
Count
Source
701
1
    static void add_value(State& state, const IColumn& column, size_t row_num) {
702
1
        if (state.k == 0) {
703
0
            if (state.live == 0) {
704
0
                state.root = append_slot(state, column, row_num, 1);
705
0
                state.worst = state.root;
706
0
                return;
707
0
            }
708
0
            int cmp = compare_values(value_at(column, row_num), value_of(state, 0));
709
0
            if (cmp == 0) {
710
0
                state.slots[0].count = checked_add(state.slots[0].count, 1);
711
0
            } else if (comes_before(cmp)) {
712
                // The new value is better: replace the tracked extreme. The slot and the
713
                // single-node tree stay in place, only the stored value changes.
714
0
                replace_value(state, 0, value_at(column, row_num));
715
0
                state.slots[0].count = 1;
716
0
            }
717
0
            return;
718
0
        }
719
720
        // Dead slots and evicted payload are reclaimed once they outnumber the live ones.
721
1
        maybe_compact(state);
722
723
1
        if (state.live >= state.k) {
724
            // A full list rejects or absorbs most rows: comparing with the eviction candidate
725
            // costs one comparison, while the tree descent would cost log2(k).
726
0
            int cmp = compare_values(value_at(column, row_num), value_of(state, state.worst));
727
0
            if (cmp == 0) {
728
0
                state.slots[state.worst].count = checked_add(state.slots[state.worst].count, 1);
729
0
                return;
730
0
            }
731
0
            if (is_worse(cmp)) {
732
0
                return;
733
0
            }
734
0
        }
735
736
1
        int32_t inserted = State::NO_SLOT;
737
1
        state.root = add_or_increment(state, state.root, value_at(column, row_num), 1, &inserted);
738
1
        if (inserted == State::NO_SLOT) {
739
0
            return;
740
0
        }
741
1
        if (state.live <= state.k) {
742
            // Not over capacity: the new entry competes with the cached worst for the eviction
743
            // candidate role.
744
1
            if (state.worst == State::NO_SLOT ||
745
1
                is_worse(compare_slots(state, inserted, state.worst))) {
746
1
                state.worst = inserted;
747
1
            }
748
1
            return;
749
1
        }
750
        // The list was full and the value is new. It beat the cached worst above, so it cannot be
751
        // the worst itself; the old worst is still the rightmost entry and leaves the list.
752
0
        int32_t removed = State::NO_SLOT;
753
0
        state.root = erase_worst(state, state.root, &removed);
754
        DCHECK_EQ(removed, state.worst);
755
0
        evict_value(state, removed);
756
0
        state.slots[removed].count = State::DEAD_COUNT;
757
0
        --state.live;
758
0
        ++state.dead;
759
0
        refresh_worst(state);
760
0
        maybe_compact(state);
761
0
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_4EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_5EEERKNS_7IColumnEm
Line
Count
Source
701
10.3k
    static void add_value(State& state, const IColumn& column, size_t row_num) {
702
10.3k
        if (state.k == 0) {
703
23
            if (state.live == 0) {
704
6
                state.root = append_slot(state, column, row_num, 1);
705
6
                state.worst = state.root;
706
6
                return;
707
6
            }
708
17
            int cmp = compare_values(value_at(column, row_num), value_of(state, 0));
709
17
            if (cmp == 0) {
710
5
                state.slots[0].count = checked_add(state.slots[0].count, 1);
711
12
            } else if (comes_before(cmp)) {
712
                // The new value is better: replace the tracked extreme. The slot and the
713
                // single-node tree stay in place, only the stored value changes.
714
2
                replace_value(state, 0, value_at(column, row_num));
715
2
                state.slots[0].count = 1;
716
2
            }
717
17
            return;
718
23
        }
719
720
        // Dead slots and evicted payload are reclaimed once they outnumber the live ones.
721
10.3k
        maybe_compact(state);
722
723
10.3k
        if (state.live >= state.k) {
724
            // A full list rejects or absorbs most rows: comparing with the eviction candidate
725
            // costs one comparison, while the tree descent would cost log2(k).
726
9.64k
            int cmp = compare_values(value_at(column, row_num), value_of(state, state.worst));
727
9.64k
            if (cmp == 0) {
728
7
                state.slots[state.worst].count = checked_add(state.slots[state.worst].count, 1);
729
7
                return;
730
7
            }
731
9.63k
            if (is_worse(cmp)) {
732
7.88k
                return;
733
7.88k
            }
734
9.63k
        }
735
736
2.45k
        int32_t inserted = State::NO_SLOT;
737
2.45k
        state.root = add_or_increment(state, state.root, value_at(column, row_num), 1, &inserted);
738
2.45k
        if (inserted == State::NO_SLOT) {
739
42
            return;
740
42
        }
741
2.41k
        if (state.live <= state.k) {
742
            // Not over capacity: the new entry competes with the cached worst for the eviction
743
            // candidate role.
744
678
            if (state.worst == State::NO_SLOT ||
745
678
                is_worse(compare_slots(state, inserted, state.worst))) {
746
151
                state.worst = inserted;
747
151
            }
748
678
            return;
749
678
        }
750
        // The list was full and the value is new. It beat the cached worst above, so it cannot be
751
        // the worst itself; the old worst is still the rightmost entry and leaves the list.
752
1.73k
        int32_t removed = State::NO_SLOT;
753
1.73k
        state.root = erase_worst(state, state.root, &removed);
754
        DCHECK_EQ(removed, state.worst);
755
1.73k
        evict_value(state, removed);
756
1.73k
        state.slots[removed].count = State::DEAD_COUNT;
757
1.73k
        --state.live;
758
1.73k
        ++state.dead;
759
1.73k
        refresh_worst(state);
760
1.73k
        maybe_compact(state);
761
1.73k
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_6EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_7EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_8EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_9EEERKNS_7IColumnEm
Line
Count
Source
701
5
    static void add_value(State& state, const IColumn& column, size_t row_num) {
702
5
        if (state.k == 0) {
703
0
            if (state.live == 0) {
704
0
                state.root = append_slot(state, column, row_num, 1);
705
0
                state.worst = state.root;
706
0
                return;
707
0
            }
708
0
            int cmp = compare_values(value_at(column, row_num), value_of(state, 0));
709
0
            if (cmp == 0) {
710
0
                state.slots[0].count = checked_add(state.slots[0].count, 1);
711
0
            } else if (comes_before(cmp)) {
712
                // The new value is better: replace the tracked extreme. The slot and the
713
                // single-node tree stay in place, only the stored value changes.
714
0
                replace_value(state, 0, value_at(column, row_num));
715
0
                state.slots[0].count = 1;
716
0
            }
717
0
            return;
718
0
        }
719
720
        // Dead slots and evicted payload are reclaimed once they outnumber the live ones.
721
5
        maybe_compact(state);
722
723
5
        if (state.live >= state.k) {
724
            // A full list rejects or absorbs most rows: comparing with the eviction candidate
725
            // costs one comparison, while the tree descent would cost log2(k).
726
0
            int cmp = compare_values(value_at(column, row_num), value_of(state, state.worst));
727
0
            if (cmp == 0) {
728
0
                state.slots[state.worst].count = checked_add(state.slots[state.worst].count, 1);
729
0
                return;
730
0
            }
731
0
            if (is_worse(cmp)) {
732
0
                return;
733
0
            }
734
0
        }
735
736
5
        int32_t inserted = State::NO_SLOT;
737
5
        state.root = add_or_increment(state, state.root, value_at(column, row_num), 1, &inserted);
738
5
        if (inserted == State::NO_SLOT) {
739
2
            return;
740
2
        }
741
3
        if (state.live <= state.k) {
742
            // Not over capacity: the new entry competes with the cached worst for the eviction
743
            // candidate role.
744
3
            if (state.worst == State::NO_SLOT ||
745
3
                is_worse(compare_slots(state, inserted, state.worst))) {
746
3
                state.worst = inserted;
747
3
            }
748
3
            return;
749
3
        }
750
        // The list was full and the value is new. It beat the cached worst above, so it cannot be
751
        // the worst itself; the old worst is still the rightmost entry and leaves the list.
752
0
        int32_t removed = State::NO_SLOT;
753
0
        state.root = erase_worst(state, state.root, &removed);
754
        DCHECK_EQ(removed, state.worst);
755
0
        evict_value(state, removed);
756
0
        state.slots[removed].count = State::DEAD_COUNT;
757
0
        --state.live;
758
0
        ++state.dead;
759
0
        refresh_worst(state);
760
0
        maybe_compact(state);
761
0
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_28EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_29EEERKNS_7IColumnEm
Line
Count
Source
701
38
    static void add_value(State& state, const IColumn& column, size_t row_num) {
702
38
        if (state.k == 0) {
703
0
            if (state.live == 0) {
704
0
                state.root = append_slot(state, column, row_num, 1);
705
0
                state.worst = state.root;
706
0
                return;
707
0
            }
708
0
            int cmp = compare_values(value_at(column, row_num), value_of(state, 0));
709
0
            if (cmp == 0) {
710
0
                state.slots[0].count = checked_add(state.slots[0].count, 1);
711
0
            } else if (comes_before(cmp)) {
712
                // The new value is better: replace the tracked extreme. The slot and the
713
                // single-node tree stay in place, only the stored value changes.
714
0
                replace_value(state, 0, value_at(column, row_num));
715
0
                state.slots[0].count = 1;
716
0
            }
717
0
            return;
718
0
        }
719
720
        // Dead slots and evicted payload are reclaimed once they outnumber the live ones.
721
38
        maybe_compact(state);
722
723
38
        if (state.live >= state.k) {
724
            // A full list rejects or absorbs most rows: comparing with the eviction candidate
725
            // costs one comparison, while the tree descent would cost log2(k).
726
22
            int cmp = compare_values(value_at(column, row_num), value_of(state, state.worst));
727
22
            if (cmp == 0) {
728
0
                state.slots[state.worst].count = checked_add(state.slots[state.worst].count, 1);
729
0
                return;
730
0
            }
731
22
            if (is_worse(cmp)) {
732
15
                return;
733
15
            }
734
22
        }
735
736
23
        int32_t inserted = State::NO_SLOT;
737
23
        state.root = add_or_increment(state, state.root, value_at(column, row_num), 1, &inserted);
738
23
        if (inserted == State::NO_SLOT) {
739
9
            return;
740
9
        }
741
14
        if (state.live <= state.k) {
742
            // Not over capacity: the new entry competes with the cached worst for the eviction
743
            // candidate role.
744
10
            if (state.worst == State::NO_SLOT ||
745
10
                is_worse(compare_slots(state, inserted, state.worst))) {
746
10
                state.worst = inserted;
747
10
            }
748
10
            return;
749
10
        }
750
        // The list was full and the value is new. It beat the cached worst above, so it cannot be
751
        // the worst itself; the old worst is still the rightmost entry and leaves the list.
752
4
        int32_t removed = State::NO_SLOT;
753
4
        state.root = erase_worst(state, state.root, &removed);
754
        DCHECK_EQ(removed, state.worst);
755
4
        evict_value(state, removed);
756
4
        state.slots[removed].count = State::DEAD_COUNT;
757
4
        --state.live;
758
4
        ++state.dead;
759
4
        refresh_worst(state);
760
4
        maybe_compact(state);
761
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_20EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_30EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_35EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_10EEERKNS_7IColumnEm
Line
Count
Source
701
89
    static void add_value(State& state, const IColumn& column, size_t row_num) {
702
89
        if (state.k == 0) {
703
0
            if (state.live == 0) {
704
0
                state.root = append_slot(state, column, row_num, 1);
705
0
                state.worst = state.root;
706
0
                return;
707
0
            }
708
0
            int cmp = compare_values(value_at(column, row_num), value_of(state, 0));
709
0
            if (cmp == 0) {
710
0
                state.slots[0].count = checked_add(state.slots[0].count, 1);
711
0
            } else if (comes_before(cmp)) {
712
                // The new value is better: replace the tracked extreme. The slot and the
713
                // single-node tree stay in place, only the stored value changes.
714
0
                replace_value(state, 0, value_at(column, row_num));
715
0
                state.slots[0].count = 1;
716
0
            }
717
0
            return;
718
0
        }
719
720
        // Dead slots and evicted payload are reclaimed once they outnumber the live ones.
721
89
        maybe_compact(state);
722
723
89
        if (state.live >= state.k) {
724
            // A full list rejects or absorbs most rows: comparing with the eviction candidate
725
            // costs one comparison, while the tree descent would cost log2(k).
726
38
            int cmp = compare_values(value_at(column, row_num), value_of(state, state.worst));
727
38
            if (cmp == 0) {
728
1
                state.slots[state.worst].count = checked_add(state.slots[state.worst].count, 1);
729
1
                return;
730
1
            }
731
37
            if (is_worse(cmp)) {
732
24
                return;
733
24
            }
734
37
        }
735
736
64
        int32_t inserted = State::NO_SLOT;
737
64
        state.root = add_or_increment(state, state.root, value_at(column, row_num), 1, &inserted);
738
64
        if (inserted == State::NO_SLOT) {
739
6
            return;
740
6
        }
741
58
        if (state.live <= state.k) {
742
            // Not over capacity: the new entry competes with the cached worst for the eviction
743
            // candidate role.
744
46
            if (state.worst == State::NO_SLOT ||
745
46
                is_worse(compare_slots(state, inserted, state.worst))) {
746
43
                state.worst = inserted;
747
43
            }
748
46
            return;
749
46
        }
750
        // The list was full and the value is new. It beat the cached worst above, so it cannot be
751
        // the worst itself; the old worst is still the rightmost entry and leaves the list.
752
12
        int32_t removed = State::NO_SLOT;
753
12
        state.root = erase_worst(state, state.root, &removed);
754
        DCHECK_EQ(removed, state.worst);
755
12
        evict_value(state, removed);
756
12
        state.slots[removed].count = State::DEAD_COUNT;
757
12
        --state.live;
758
12
        ++state.dead;
759
12
        refresh_worst(state);
760
12
        maybe_compact(state);
761
12
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_11EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_12EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_25EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_26EEERKNS_7IColumnEm
Line
Count
Source
701
14
    static void add_value(State& state, const IColumn& column, size_t row_num) {
702
14
        if (state.k == 0) {
703
0
            if (state.live == 0) {
704
0
                state.root = append_slot(state, column, row_num, 1);
705
0
                state.worst = state.root;
706
0
                return;
707
0
            }
708
0
            int cmp = compare_values(value_at(column, row_num), value_of(state, 0));
709
0
            if (cmp == 0) {
710
0
                state.slots[0].count = checked_add(state.slots[0].count, 1);
711
0
            } else if (comes_before(cmp)) {
712
                // The new value is better: replace the tracked extreme. The slot and the
713
                // single-node tree stay in place, only the stored value changes.
714
0
                replace_value(state, 0, value_at(column, row_num));
715
0
                state.slots[0].count = 1;
716
0
            }
717
0
            return;
718
0
        }
719
720
        // Dead slots and evicted payload are reclaimed once they outnumber the live ones.
721
14
        maybe_compact(state);
722
723
14
        if (state.live >= state.k) {
724
            // A full list rejects or absorbs most rows: comparing with the eviction candidate
725
            // costs one comparison, while the tree descent would cost log2(k).
726
9
            int cmp = compare_values(value_at(column, row_num), value_of(state, state.worst));
727
9
            if (cmp == 0) {
728
0
                state.slots[state.worst].count = checked_add(state.slots[state.worst].count, 1);
729
0
                return;
730
0
            }
731
9
            if (is_worse(cmp)) {
732
8
                return;
733
8
            }
734
9
        }
735
736
6
        int32_t inserted = State::NO_SLOT;
737
6
        state.root = add_or_increment(state, state.root, value_at(column, row_num), 1, &inserted);
738
6
        if (inserted == State::NO_SLOT) {
739
0
            return;
740
0
        }
741
6
        if (state.live <= state.k) {
742
            // Not over capacity: the new entry competes with the cached worst for the eviction
743
            // candidate role.
744
5
            if (state.worst == State::NO_SLOT ||
745
5
                is_worse(compare_slots(state, inserted, state.worst))) {
746
4
                state.worst = inserted;
747
4
            }
748
5
            return;
749
5
        }
750
        // The list was full and the value is new. It beat the cached worst above, so it cannot be
751
        // the worst itself; the old worst is still the rightmost entry and leaves the list.
752
1
        int32_t removed = State::NO_SLOT;
753
1
        state.root = erase_worst(state, state.root, &removed);
754
        DCHECK_EQ(removed, state.worst);
755
1
        evict_value(state, removed);
756
1
        state.slots[removed].count = State::DEAD_COUNT;
757
1
        --state.live;
758
1
        ++state.dead;
759
1
        refresh_worst(state);
760
1
        maybe_compact(state);
761
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_27EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_43EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_42EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_36EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_37EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE9add_valueERNS_22AggregateTopKCountDataILS1_44EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_2EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_3EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_4EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_5EEERKNS_7IColumnEm
Line
Count
Source
701
10.1k
    static void add_value(State& state, const IColumn& column, size_t row_num) {
702
10.1k
        if (state.k == 0) {
703
22
            if (state.live == 0) {
704
5
                state.root = append_slot(state, column, row_num, 1);
705
5
                state.worst = state.root;
706
5
                return;
707
5
            }
708
17
            int cmp = compare_values(value_at(column, row_num), value_of(state, 0));
709
17
            if (cmp == 0) {
710
6
                state.slots[0].count = checked_add(state.slots[0].count, 1);
711
11
            } else if (comes_before(cmp)) {
712
                // The new value is better: replace the tracked extreme. The slot and the
713
                // single-node tree stay in place, only the stored value changes.
714
6
                replace_value(state, 0, value_at(column, row_num));
715
6
                state.slots[0].count = 1;
716
6
            }
717
17
            return;
718
22
        }
719
720
        // Dead slots and evicted payload are reclaimed once they outnumber the live ones.
721
10.1k
        maybe_compact(state);
722
723
10.1k
        if (state.live >= state.k) {
724
            // A full list rejects or absorbs most rows: comparing with the eviction candidate
725
            // costs one comparison, while the tree descent would cost log2(k).
726
9.52k
            int cmp = compare_values(value_at(column, row_num), value_of(state, state.worst));
727
9.52k
            if (cmp == 0) {
728
12
                state.slots[state.worst].count = checked_add(state.slots[state.worst].count, 1);
729
12
                return;
730
12
            }
731
9.51k
            if (is_worse(cmp)) {
732
9.34k
                return;
733
9.34k
            }
734
9.51k
        }
735
736
776
        int32_t inserted = State::NO_SLOT;
737
776
        state.root = add_or_increment(state, state.root, value_at(column, row_num), 1, &inserted);
738
776
        if (inserted == State::NO_SLOT) {
739
23
            return;
740
23
        }
741
753
        if (state.live <= state.k) {
742
            // Not over capacity: the new entry competes with the cached worst for the eviction
743
            // candidate role.
744
592
            if (state.worst == State::NO_SLOT ||
745
592
                is_worse(compare_slots(state, inserted, state.worst))) {
746
539
                state.worst = inserted;
747
539
            }
748
592
            return;
749
592
        }
750
        // The list was full and the value is new. It beat the cached worst above, so it cannot be
751
        // the worst itself; the old worst is still the rightmost entry and leaves the list.
752
161
        int32_t removed = State::NO_SLOT;
753
161
        state.root = erase_worst(state, state.root, &removed);
754
        DCHECK_EQ(removed, state.worst);
755
161
        evict_value(state, removed);
756
161
        state.slots[removed].count = State::DEAD_COUNT;
757
161
        --state.live;
758
161
        ++state.dead;
759
161
        refresh_worst(state);
760
161
        maybe_compact(state);
761
161
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_6EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_7EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_8EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_9EEERKNS_7IColumnEm
Line
Count
Source
701
5
    static void add_value(State& state, const IColumn& column, size_t row_num) {
702
5
        if (state.k == 0) {
703
0
            if (state.live == 0) {
704
0
                state.root = append_slot(state, column, row_num, 1);
705
0
                state.worst = state.root;
706
0
                return;
707
0
            }
708
0
            int cmp = compare_values(value_at(column, row_num), value_of(state, 0));
709
0
            if (cmp == 0) {
710
0
                state.slots[0].count = checked_add(state.slots[0].count, 1);
711
0
            } else if (comes_before(cmp)) {
712
                // The new value is better: replace the tracked extreme. The slot and the
713
                // single-node tree stay in place, only the stored value changes.
714
0
                replace_value(state, 0, value_at(column, row_num));
715
0
                state.slots[0].count = 1;
716
0
            }
717
0
            return;
718
0
        }
719
720
        // Dead slots and evicted payload are reclaimed once they outnumber the live ones.
721
5
        maybe_compact(state);
722
723
5
        if (state.live >= state.k) {
724
            // A full list rejects or absorbs most rows: comparing with the eviction candidate
725
            // costs one comparison, while the tree descent would cost log2(k).
726
0
            int cmp = compare_values(value_at(column, row_num), value_of(state, state.worst));
727
0
            if (cmp == 0) {
728
0
                state.slots[state.worst].count = checked_add(state.slots[state.worst].count, 1);
729
0
                return;
730
0
            }
731
0
            if (is_worse(cmp)) {
732
0
                return;
733
0
            }
734
0
        }
735
736
5
        int32_t inserted = State::NO_SLOT;
737
5
        state.root = add_or_increment(state, state.root, value_at(column, row_num), 1, &inserted);
738
5
        if (inserted == State::NO_SLOT) {
739
2
            return;
740
2
        }
741
3
        if (state.live <= state.k) {
742
            // Not over capacity: the new entry competes with the cached worst for the eviction
743
            // candidate role.
744
3
            if (state.worst == State::NO_SLOT ||
745
3
                is_worse(compare_slots(state, inserted, state.worst))) {
746
1
                state.worst = inserted;
747
1
            }
748
3
            return;
749
3
        }
750
        // The list was full and the value is new. It beat the cached worst above, so it cannot be
751
        // the worst itself; the old worst is still the rightmost entry and leaves the list.
752
0
        int32_t removed = State::NO_SLOT;
753
0
        state.root = erase_worst(state, state.root, &removed);
754
        DCHECK_EQ(removed, state.worst);
755
0
        evict_value(state, removed);
756
0
        state.slots[removed].count = State::DEAD_COUNT;
757
0
        --state.live;
758
0
        ++state.dead;
759
0
        refresh_worst(state);
760
0
        maybe_compact(state);
761
0
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_28EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_29EEERKNS_7IColumnEm
Line
Count
Source
701
38
    static void add_value(State& state, const IColumn& column, size_t row_num) {
702
38
        if (state.k == 0) {
703
0
            if (state.live == 0) {
704
0
                state.root = append_slot(state, column, row_num, 1);
705
0
                state.worst = state.root;
706
0
                return;
707
0
            }
708
0
            int cmp = compare_values(value_at(column, row_num), value_of(state, 0));
709
0
            if (cmp == 0) {
710
0
                state.slots[0].count = checked_add(state.slots[0].count, 1);
711
0
            } else if (comes_before(cmp)) {
712
                // The new value is better: replace the tracked extreme. The slot and the
713
                // single-node tree stay in place, only the stored value changes.
714
0
                replace_value(state, 0, value_at(column, row_num));
715
0
                state.slots[0].count = 1;
716
0
            }
717
0
            return;
718
0
        }
719
720
        // Dead slots and evicted payload are reclaimed once they outnumber the live ones.
721
38
        maybe_compact(state);
722
723
38
        if (state.live >= state.k) {
724
            // A full list rejects or absorbs most rows: comparing with the eviction candidate
725
            // costs one comparison, while the tree descent would cost log2(k).
726
22
            int cmp = compare_values(value_at(column, row_num), value_of(state, state.worst));
727
22
            if (cmp == 0) {
728
0
                state.slots[state.worst].count = checked_add(state.slots[state.worst].count, 1);
729
0
                return;
730
0
            }
731
22
            if (is_worse(cmp)) {
732
7
                return;
733
7
            }
734
22
        }
735
736
31
        int32_t inserted = State::NO_SLOT;
737
31
        state.root = add_or_increment(state, state.root, value_at(column, row_num), 1, &inserted);
738
31
        if (inserted == State::NO_SLOT) {
739
7
            return;
740
7
        }
741
24
        if (state.live <= state.k) {
742
            // Not over capacity: the new entry competes with the cached worst for the eviction
743
            // candidate role.
744
10
            if (state.worst == State::NO_SLOT ||
745
10
                is_worse(compare_slots(state, inserted, state.worst))) {
746
6
                state.worst = inserted;
747
6
            }
748
10
            return;
749
10
        }
750
        // The list was full and the value is new. It beat the cached worst above, so it cannot be
751
        // the worst itself; the old worst is still the rightmost entry and leaves the list.
752
14
        int32_t removed = State::NO_SLOT;
753
14
        state.root = erase_worst(state, state.root, &removed);
754
        DCHECK_EQ(removed, state.worst);
755
14
        evict_value(state, removed);
756
14
        state.slots[removed].count = State::DEAD_COUNT;
757
14
        --state.live;
758
14
        ++state.dead;
759
14
        refresh_worst(state);
760
14
        maybe_compact(state);
761
14
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_20EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_30EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_35EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_10EEERKNS_7IColumnEm
Line
Count
Source
701
44
    static void add_value(State& state, const IColumn& column, size_t row_num) {
702
44
        if (state.k == 0) {
703
0
            if (state.live == 0) {
704
0
                state.root = append_slot(state, column, row_num, 1);
705
0
                state.worst = state.root;
706
0
                return;
707
0
            }
708
0
            int cmp = compare_values(value_at(column, row_num), value_of(state, 0));
709
0
            if (cmp == 0) {
710
0
                state.slots[0].count = checked_add(state.slots[0].count, 1);
711
0
            } else if (comes_before(cmp)) {
712
                // The new value is better: replace the tracked extreme. The slot and the
713
                // single-node tree stay in place, only the stored value changes.
714
0
                replace_value(state, 0, value_at(column, row_num));
715
0
                state.slots[0].count = 1;
716
0
            }
717
0
            return;
718
0
        }
719
720
        // Dead slots and evicted payload are reclaimed once they outnumber the live ones.
721
44
        maybe_compact(state);
722
723
44
        if (state.live >= state.k) {
724
            // A full list rejects or absorbs most rows: comparing with the eviction candidate
725
            // costs one comparison, while the tree descent would cost log2(k).
726
27
            int cmp = compare_values(value_at(column, row_num), value_of(state, state.worst));
727
27
            if (cmp == 0) {
728
3
                state.slots[state.worst].count = checked_add(state.slots[state.worst].count, 1);
729
3
                return;
730
3
            }
731
24
            if (is_worse(cmp)) {
732
3
                return;
733
3
            }
734
24
        }
735
736
38
        int32_t inserted = State::NO_SLOT;
737
38
        state.root = add_or_increment(state, state.root, value_at(column, row_num), 1, &inserted);
738
38
        if (inserted == State::NO_SLOT) {
739
7
            return;
740
7
        }
741
31
        if (state.live <= state.k) {
742
            // Not over capacity: the new entry competes with the cached worst for the eviction
743
            // candidate role.
744
12
            if (state.worst == State::NO_SLOT ||
745
12
                is_worse(compare_slots(state, inserted, state.worst))) {
746
10
                state.worst = inserted;
747
10
            }
748
12
            return;
749
12
        }
750
        // The list was full and the value is new. It beat the cached worst above, so it cannot be
751
        // the worst itself; the old worst is still the rightmost entry and leaves the list.
752
19
        int32_t removed = State::NO_SLOT;
753
19
        state.root = erase_worst(state, state.root, &removed);
754
        DCHECK_EQ(removed, state.worst);
755
19
        evict_value(state, removed);
756
19
        state.slots[removed].count = State::DEAD_COUNT;
757
19
        --state.live;
758
19
        ++state.dead;
759
19
        refresh_worst(state);
760
19
        maybe_compact(state);
761
19
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_11EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_12EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_25EEERKNS_7IColumnEm
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_26EEERKNS_7IColumnEm
Line
Count
Source
701
14
    static void add_value(State& state, const IColumn& column, size_t row_num) {
702
14
        if (state.k == 0) {
703
0
            if (state.live == 0) {
704
0
                state.root = append_slot(state, column, row_num, 1);
705
0
                state.worst = state.root;
706
0
                return;
707
0
            }
708
0
            int cmp = compare_values(value_at(column, row_num), value_of(state, 0));
709
0
            if (cmp == 0) {
710
0
                state.slots[0].count = checked_add(state.slots[0].count, 1);
711
0
            } else if (comes_before(cmp)) {
712
                // The new value is better: replace the tracked extreme. The slot and the
713
                // single-node tree stay in place, only the stored value changes.
714
0
                replace_value(state, 0, value_at(column, row_num));
715
0
                state.slots[0].count = 1;
716
0
            }
717
0
            return;
718
0
        }
719
720
        // Dead slots and evicted payload are reclaimed once they outnumber the live ones.
721
14
        maybe_compact(state);
722
723
14
        if (state.live >= state.k) {
724
            // A full list rejects or absorbs most rows: comparing with the eviction candidate
725
            // costs one comparison, while the tree descent would cost log2(k).
726
9
            int cmp = compare_values(value_at(column, row_num), value_of(state, state.worst));
727
9
            if (cmp == 0) {
728
0
                state.slots[state.worst].count = checked_add(state.slots[state.worst].count, 1);
729
0
                return;
730
0
            }
731
9
            if (is_worse(cmp)) {
732
2
                return;
733
2
            }
734
9
        }
735
736
12
        int32_t inserted = State::NO_SLOT;
737
12
        state.root = add_or_increment(state, state.root, value_at(column, row_num), 1, &inserted);
738
12
        if (inserted == State::NO_SLOT) {
739
1
            return;
740
1
        }
741
11
        if (state.live <= state.k) {
742
            // Not over capacity: the new entry competes with the cached worst for the eviction
743
            // candidate role.
744
5
            if (state.worst == State::NO_SLOT ||
745
5
                is_worse(compare_slots(state, inserted, state.worst))) {
746
4
                state.worst = inserted;
747
4
            }
748
5
            return;
749
5
        }
750
        // The list was full and the value is new. It beat the cached worst above, so it cannot be
751
        // the worst itself; the old worst is still the rightmost entry and leaves the list.
752
6
        int32_t removed = State::NO_SLOT;
753
6
        state.root = erase_worst(state, state.root, &removed);
754
        DCHECK_EQ(removed, state.worst);
755
6
        evict_value(state, removed);
756
6
        state.slots[removed].count = State::DEAD_COUNT;
757
6
        --state.live;
758
6
        ++state.dead;
759
6
        refresh_worst(state);
760
6
        maybe_compact(state);
761
6
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_27EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_43EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_42EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_36EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_37EEERKNS_7IColumnEm
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE9add_valueERNS_22AggregateTopKCountDataILS1_44EEERKNS_7IColumnEm
762
763
    /// k == 0: the state holds at most the extreme value and its count.
764
10
    static void merge_extreme(State& state, const State& other) {
765
10
        if (other.live == 0) {
766
2
            return;
767
2
        }
768
8
        if (state.live == 0) {
769
8
            state.root = append_slot(state, value_of(other, 0), other.slots[0].count);
770
8
            state.worst = state.root;
771
8
            return;
772
8
        }
773
0
        int cmp = compare_values(value_of(state, 0), value_of(other, 0));
774
0
        if (cmp == 0) {
775
0
            state.slots[0].count = checked_add(state.slots[0].count, other.slots[0].count);
776
0
        } else if (is_worse(cmp)) {
777
0
            replace_value(state, 0, value_of(other, 0));
778
0
            state.slots[0].count = other.slots[0].count;
779
0
        }
780
0
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_2EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_3EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_4EEERKS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_5EEERKS4_
Line
Count
Source
764
5
    static void merge_extreme(State& state, const State& other) {
765
5
        if (other.live == 0) {
766
1
            return;
767
1
        }
768
4
        if (state.live == 0) {
769
4
            state.root = append_slot(state, value_of(other, 0), other.slots[0].count);
770
4
            state.worst = state.root;
771
4
            return;
772
4
        }
773
0
        int cmp = compare_values(value_of(state, 0), value_of(other, 0));
774
0
        if (cmp == 0) {
775
0
            state.slots[0].count = checked_add(state.slots[0].count, other.slots[0].count);
776
0
        } else if (is_worse(cmp)) {
777
0
            replace_value(state, 0, value_of(other, 0));
778
0
            state.slots[0].count = other.slots[0].count;
779
0
        }
780
0
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_6EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_7EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_8EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_9EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_28EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_29EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_20EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_30EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_35EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_10EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_11EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_12EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_25EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_26EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_27EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_43EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_42EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_36EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_37EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE13merge_extremeERNS_22AggregateTopKCountDataILS1_44EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_2EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_3EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_4EEERKS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_5EEERKS4_
Line
Count
Source
764
5
    static void merge_extreme(State& state, const State& other) {
765
5
        if (other.live == 0) {
766
1
            return;
767
1
        }
768
4
        if (state.live == 0) {
769
4
            state.root = append_slot(state, value_of(other, 0), other.slots[0].count);
770
4
            state.worst = state.root;
771
4
            return;
772
4
        }
773
0
        int cmp = compare_values(value_of(state, 0), value_of(other, 0));
774
0
        if (cmp == 0) {
775
0
            state.slots[0].count = checked_add(state.slots[0].count, other.slots[0].count);
776
0
        } else if (is_worse(cmp)) {
777
0
            replace_value(state, 0, value_of(other, 0));
778
0
            state.slots[0].count = other.slots[0].count;
779
0
        }
780
0
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_6EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_7EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_8EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_9EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_28EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_29EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_20EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_30EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_35EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_10EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_11EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_12EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_25EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_26EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_27EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_43EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_42EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_36EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_37EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE13merge_extremeERNS_22AggregateTopKCountDataILS1_44EEERKS4_
781
782
    /// Merges two ordered lists, summing the counts of equal values and keeping the k best.
783
    ///
784
    /// The merge stops as soon as k entries are produced. Both inputs are best-first and hold
785
    /// distinct values, and equal values have already been combined, so every remaining value is
786
    /// worse than all retained ones: it can neither enter the result nor overflow it. Stopping
787
    /// here also avoids materializing a tail that would be truncated away.
788
116
    static void merge_values(State& state, const State& other) {
789
116
        if (other.live == 0) {
790
            // The other partial state saw no non-NULL row.
791
19
            return;
792
19
        }
793
        // `_state`/`_merge`/`_union` merges one serialized singleton per row, so a single-entry
794
        // RHS is exactly one add, whether or not the list is full: a retained value (including an
795
        // interior one) only bumps its count, and a new one is inserted, evicting the worst only
796
        // when the list was already full. Neither copies the retained values nor rebuilds the
797
        // tree.
798
97
        if (other.live == 1) {
799
45
            const int32_t other_only = other.root;
800
45
            ValueRef value = value_of(other, other_only);
801
45
            if (state.live >= state.k &&
802
45
                is_worse(compare_values(value, value_of(state, state.worst)))) {
803
                // A full list rejects a worse value without touching the tree.
804
1
                return;
805
1
            }
806
44
            int32_t inserted = State::NO_SLOT;
807
44
            state.root = add_or_increment(state, state.root, value, other.slots[other_only].count,
808
44
                                          &inserted);
809
44
            if (inserted == State::NO_SLOT) {
810
2
                return;
811
2
            }
812
42
            if (state.live <= state.k) {
813
                // There was room: the new entry competes with the cached worst for the eviction
814
                // candidate role, exactly like the add path.
815
40
                if (state.worst == State::NO_SLOT ||
816
40
                    is_worse(compare_slots(state, inserted, state.worst))) {
817
40
                    state.worst = inserted;
818
40
                }
819
40
                return;
820
40
            }
821
            // The list was full, so the new entry is one over capacity. It beat the cached worst
822
            // above, so the old worst is still the last entry and leaves the list.
823
2
            int32_t removed = State::NO_SLOT;
824
2
            state.root = erase_worst(state, state.root, &removed);
825
2
            DCHECK_EQ(removed, state.worst);
826
2
            evict_value(state, removed);
827
2
            state.slots[removed].count = State::DEAD_COUNT;
828
2
            --state.live;
829
2
            ++state.dead;
830
2
            refresh_worst(state);
831
2
            maybe_compact(state);
832
2
            return;
833
42
        }
834
52
        if (state.live >= state.k) {
835
            // A full state already holds the k best values. If every value of the other state is
836
            // worse than the worst one retained here, the merge cannot change the result, so skip
837
            // the collect/rebuild.
838
14
            const int32_t other_best = best_slot(other);
839
14
            int cmp = compare_values(value_of(other, other_best), value_of(state, state.worst));
840
14
            if (is_worse(cmp)) {
841
1
                return;
842
1
            }
843
13
            if (cmp == 0) {
844
                // The other state's best value is the worst retained one. Its remaining values are
845
                // distinct and worse, so they cannot enter either: only that count changes, and
846
                // the tree stays as it is.
847
1
                state.slots[state.worst].count =
848
1
                        checked_add(state.slots[state.worst].count, other.slots[other_best].count);
849
1
                return;
850
1
            }
851
13
        }
852
50
        DorisVector<int32_t> lhs_slots;
853
50
        DorisVector<int32_t> rhs_slots;
854
50
        collect_in_order(state, lhs_slots);
855
50
        collect_in_order(other, rhs_slots);
856
50
        DorisVector<Entry> merged;
857
50
        merge_sorted_slots(state, lhs_slots, other, rhs_slots, static_cast<size_t>(state.k),
858
50
                           merged);
859
50
        check_slot_capacity(merged.size());
860
50
        assign_sorted(state, std::move(merged));
861
50
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_2EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_3EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_4EEERKS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_5EEERKS4_
Line
Count
Source
788
41
    static void merge_values(State& state, const State& other) {
789
41
        if (other.live == 0) {
790
            // The other partial state saw no non-NULL row.
791
7
            return;
792
7
        }
793
        // `_state`/`_merge`/`_union` merges one serialized singleton per row, so a single-entry
794
        // RHS is exactly one add, whether or not the list is full: a retained value (including an
795
        // interior one) only bumps its count, and a new one is inserted, evicting the worst only
796
        // when the list was already full. Neither copies the retained values nor rebuilds the
797
        // tree.
798
34
        if (other.live == 1) {
799
18
            const int32_t other_only = other.root;
800
18
            ValueRef value = value_of(other, other_only);
801
18
            if (state.live >= state.k &&
802
18
                is_worse(compare_values(value, value_of(state, state.worst)))) {
803
                // A full list rejects a worse value without touching the tree.
804
0
                return;
805
0
            }
806
18
            int32_t inserted = State::NO_SLOT;
807
18
            state.root = add_or_increment(state, state.root, value, other.slots[other_only].count,
808
18
                                          &inserted);
809
18
            if (inserted == State::NO_SLOT) {
810
0
                return;
811
0
            }
812
18
            if (state.live <= state.k) {
813
                // There was room: the new entry competes with the cached worst for the eviction
814
                // candidate role, exactly like the add path.
815
17
                if (state.worst == State::NO_SLOT ||
816
17
                    is_worse(compare_slots(state, inserted, state.worst))) {
817
17
                    state.worst = inserted;
818
17
                }
819
17
                return;
820
17
            }
821
            // The list was full, so the new entry is one over capacity. It beat the cached worst
822
            // above, so the old worst is still the last entry and leaves the list.
823
1
            int32_t removed = State::NO_SLOT;
824
1
            state.root = erase_worst(state, state.root, &removed);
825
1
            DCHECK_EQ(removed, state.worst);
826
1
            evict_value(state, removed);
827
1
            state.slots[removed].count = State::DEAD_COUNT;
828
1
            --state.live;
829
1
            ++state.dead;
830
1
            refresh_worst(state);
831
1
            maybe_compact(state);
832
1
            return;
833
18
        }
834
16
        if (state.live >= state.k) {
835
            // A full state already holds the k best values. If every value of the other state is
836
            // worse than the worst one retained here, the merge cannot change the result, so skip
837
            // the collect/rebuild.
838
4
            const int32_t other_best = best_slot(other);
839
4
            int cmp = compare_values(value_of(other, other_best), value_of(state, state.worst));
840
4
            if (is_worse(cmp)) {
841
0
                return;
842
0
            }
843
4
            if (cmp == 0) {
844
                // The other state's best value is the worst retained one. Its remaining values are
845
                // distinct and worse, so they cannot enter either: only that count changes, and
846
                // the tree stays as it is.
847
0
                state.slots[state.worst].count =
848
0
                        checked_add(state.slots[state.worst].count, other.slots[other_best].count);
849
0
                return;
850
0
            }
851
4
        }
852
16
        DorisVector<int32_t> lhs_slots;
853
16
        DorisVector<int32_t> rhs_slots;
854
16
        collect_in_order(state, lhs_slots);
855
16
        collect_in_order(other, rhs_slots);
856
16
        DorisVector<Entry> merged;
857
16
        merge_sorted_slots(state, lhs_slots, other, rhs_slots, static_cast<size_t>(state.k),
858
16
                           merged);
859
16
        check_slot_capacity(merged.size());
860
16
        assign_sorted(state, std::move(merged));
861
16
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_6EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_7EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_8EEERKS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_9EEERKS4_
Line
Count
Source
788
1
    static void merge_values(State& state, const State& other) {
789
1
        if (other.live == 0) {
790
            // The other partial state saw no non-NULL row.
791
0
            return;
792
0
        }
793
        // `_state`/`_merge`/`_union` merges one serialized singleton per row, so a single-entry
794
        // RHS is exactly one add, whether or not the list is full: a retained value (including an
795
        // interior one) only bumps its count, and a new one is inserted, evicting the worst only
796
        // when the list was already full. Neither copies the retained values nor rebuilds the
797
        // tree.
798
1
        if (other.live == 1) {
799
0
            const int32_t other_only = other.root;
800
0
            ValueRef value = value_of(other, other_only);
801
0
            if (state.live >= state.k &&
802
0
                is_worse(compare_values(value, value_of(state, state.worst)))) {
803
                // A full list rejects a worse value without touching the tree.
804
0
                return;
805
0
            }
806
0
            int32_t inserted = State::NO_SLOT;
807
0
            state.root = add_or_increment(state, state.root, value, other.slots[other_only].count,
808
0
                                          &inserted);
809
0
            if (inserted == State::NO_SLOT) {
810
0
                return;
811
0
            }
812
0
            if (state.live <= state.k) {
813
                // There was room: the new entry competes with the cached worst for the eviction
814
                // candidate role, exactly like the add path.
815
0
                if (state.worst == State::NO_SLOT ||
816
0
                    is_worse(compare_slots(state, inserted, state.worst))) {
817
0
                    state.worst = inserted;
818
0
                }
819
0
                return;
820
0
            }
821
            // The list was full, so the new entry is one over capacity. It beat the cached worst
822
            // above, so the old worst is still the last entry and leaves the list.
823
0
            int32_t removed = State::NO_SLOT;
824
0
            state.root = erase_worst(state, state.root, &removed);
825
0
            DCHECK_EQ(removed, state.worst);
826
0
            evict_value(state, removed);
827
0
            state.slots[removed].count = State::DEAD_COUNT;
828
0
            --state.live;
829
0
            ++state.dead;
830
0
            refresh_worst(state);
831
0
            maybe_compact(state);
832
0
            return;
833
0
        }
834
1
        if (state.live >= state.k) {
835
            // A full state already holds the k best values. If every value of the other state is
836
            // worse than the worst one retained here, the merge cannot change the result, so skip
837
            // the collect/rebuild.
838
0
            const int32_t other_best = best_slot(other);
839
0
            int cmp = compare_values(value_of(other, other_best), value_of(state, state.worst));
840
0
            if (is_worse(cmp)) {
841
0
                return;
842
0
            }
843
0
            if (cmp == 0) {
844
                // The other state's best value is the worst retained one. Its remaining values are
845
                // distinct and worse, so they cannot enter either: only that count changes, and
846
                // the tree stays as it is.
847
0
                state.slots[state.worst].count =
848
0
                        checked_add(state.slots[state.worst].count, other.slots[other_best].count);
849
0
                return;
850
0
            }
851
0
        }
852
1
        DorisVector<int32_t> lhs_slots;
853
1
        DorisVector<int32_t> rhs_slots;
854
1
        collect_in_order(state, lhs_slots);
855
1
        collect_in_order(other, rhs_slots);
856
1
        DorisVector<Entry> merged;
857
1
        merge_sorted_slots(state, lhs_slots, other, rhs_slots, static_cast<size_t>(state.k),
858
1
                           merged);
859
1
        check_slot_capacity(merged.size());
860
1
        assign_sorted(state, std::move(merged));
861
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_28EEERKS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_29EEERKS4_
Line
Count
Source
788
7
    static void merge_values(State& state, const State& other) {
789
7
        if (other.live == 0) {
790
            // The other partial state saw no non-NULL row.
791
1
            return;
792
1
        }
793
        // `_state`/`_merge`/`_union` merges one serialized singleton per row, so a single-entry
794
        // RHS is exactly one add, whether or not the list is full: a retained value (including an
795
        // interior one) only bumps its count, and a new one is inserted, evicting the worst only
796
        // when the list was already full. Neither copies the retained values nor rebuilds the
797
        // tree.
798
6
        if (other.live == 1) {
799
2
            const int32_t other_only = other.root;
800
2
            ValueRef value = value_of(other, other_only);
801
2
            if (state.live >= state.k &&
802
2
                is_worse(compare_values(value, value_of(state, state.worst)))) {
803
                // A full list rejects a worse value without touching the tree.
804
0
                return;
805
0
            }
806
2
            int32_t inserted = State::NO_SLOT;
807
2
            state.root = add_or_increment(state, state.root, value, other.slots[other_only].count,
808
2
                                          &inserted);
809
2
            if (inserted == State::NO_SLOT) {
810
0
                return;
811
0
            }
812
2
            if (state.live <= state.k) {
813
                // There was room: the new entry competes with the cached worst for the eviction
814
                // candidate role, exactly like the add path.
815
2
                if (state.worst == State::NO_SLOT ||
816
2
                    is_worse(compare_slots(state, inserted, state.worst))) {
817
2
                    state.worst = inserted;
818
2
                }
819
2
                return;
820
2
            }
821
            // The list was full, so the new entry is one over capacity. It beat the cached worst
822
            // above, so the old worst is still the last entry and leaves the list.
823
0
            int32_t removed = State::NO_SLOT;
824
0
            state.root = erase_worst(state, state.root, &removed);
825
0
            DCHECK_EQ(removed, state.worst);
826
0
            evict_value(state, removed);
827
0
            state.slots[removed].count = State::DEAD_COUNT;
828
0
            --state.live;
829
0
            ++state.dead;
830
0
            refresh_worst(state);
831
0
            maybe_compact(state);
832
0
            return;
833
2
        }
834
4
        if (state.live >= state.k) {
835
            // A full state already holds the k best values. If every value of the other state is
836
            // worse than the worst one retained here, the merge cannot change the result, so skip
837
            // the collect/rebuild.
838
1
            const int32_t other_best = best_slot(other);
839
1
            int cmp = compare_values(value_of(other, other_best), value_of(state, state.worst));
840
1
            if (is_worse(cmp)) {
841
0
                return;
842
0
            }
843
1
            if (cmp == 0) {
844
                // The other state's best value is the worst retained one. Its remaining values are
845
                // distinct and worse, so they cannot enter either: only that count changes, and
846
                // the tree stays as it is.
847
0
                state.slots[state.worst].count =
848
0
                        checked_add(state.slots[state.worst].count, other.slots[other_best].count);
849
0
                return;
850
0
            }
851
1
        }
852
4
        DorisVector<int32_t> lhs_slots;
853
4
        DorisVector<int32_t> rhs_slots;
854
4
        collect_in_order(state, lhs_slots);
855
4
        collect_in_order(other, rhs_slots);
856
4
        DorisVector<Entry> merged;
857
4
        merge_sorted_slots(state, lhs_slots, other, rhs_slots, static_cast<size_t>(state.k),
858
4
                           merged);
859
4
        check_slot_capacity(merged.size());
860
4
        assign_sorted(state, std::move(merged));
861
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_20EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_30EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_35EEERKS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_10EEERKS4_
Line
Count
Source
788
14
    static void merge_values(State& state, const State& other) {
789
14
        if (other.live == 0) {
790
            // The other partial state saw no non-NULL row.
791
1
            return;
792
1
        }
793
        // `_state`/`_merge`/`_union` merges one serialized singleton per row, so a single-entry
794
        // RHS is exactly one add, whether or not the list is full: a retained value (including an
795
        // interior one) only bumps its count, and a new one is inserted, evicting the worst only
796
        // when the list was already full. Neither copies the retained values nor rebuilds the
797
        // tree.
798
13
        if (other.live == 1) {
799
7
            const int32_t other_only = other.root;
800
7
            ValueRef value = value_of(other, other_only);
801
7
            if (state.live >= state.k &&
802
7
                is_worse(compare_values(value, value_of(state, state.worst)))) {
803
                // A full list rejects a worse value without touching the tree.
804
1
                return;
805
1
            }
806
6
            int32_t inserted = State::NO_SLOT;
807
6
            state.root = add_or_increment(state, state.root, value, other.slots[other_only].count,
808
6
                                          &inserted);
809
6
            if (inserted == State::NO_SLOT) {
810
2
                return;
811
2
            }
812
4
            if (state.live <= state.k) {
813
                // There was room: the new entry competes with the cached worst for the eviction
814
                // candidate role, exactly like the add path.
815
3
                if (state.worst == State::NO_SLOT ||
816
3
                    is_worse(compare_slots(state, inserted, state.worst))) {
817
3
                    state.worst = inserted;
818
3
                }
819
3
                return;
820
3
            }
821
            // The list was full, so the new entry is one over capacity. It beat the cached worst
822
            // above, so the old worst is still the last entry and leaves the list.
823
1
            int32_t removed = State::NO_SLOT;
824
1
            state.root = erase_worst(state, state.root, &removed);
825
1
            DCHECK_EQ(removed, state.worst);
826
1
            evict_value(state, removed);
827
1
            state.slots[removed].count = State::DEAD_COUNT;
828
1
            --state.live;
829
1
            ++state.dead;
830
1
            refresh_worst(state);
831
1
            maybe_compact(state);
832
1
            return;
833
4
        }
834
6
        if (state.live >= state.k) {
835
            // A full state already holds the k best values. If every value of the other state is
836
            // worse than the worst one retained here, the merge cannot change the result, so skip
837
            // the collect/rebuild.
838
3
            const int32_t other_best = best_slot(other);
839
3
            int cmp = compare_values(value_of(other, other_best), value_of(state, state.worst));
840
3
            if (is_worse(cmp)) {
841
1
                return;
842
1
            }
843
2
            if (cmp == 0) {
844
                // The other state's best value is the worst retained one. Its remaining values are
845
                // distinct and worse, so they cannot enter either: only that count changes, and
846
                // the tree stays as it is.
847
1
                state.slots[state.worst].count =
848
1
                        checked_add(state.slots[state.worst].count, other.slots[other_best].count);
849
1
                return;
850
1
            }
851
2
        }
852
4
        DorisVector<int32_t> lhs_slots;
853
4
        DorisVector<int32_t> rhs_slots;
854
4
        collect_in_order(state, lhs_slots);
855
4
        collect_in_order(other, rhs_slots);
856
4
        DorisVector<Entry> merged;
857
4
        merge_sorted_slots(state, lhs_slots, other, rhs_slots, static_cast<size_t>(state.k),
858
4
                           merged);
859
4
        check_slot_capacity(merged.size());
860
4
        assign_sorted(state, std::move(merged));
861
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_11EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_12EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_25EEERKS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_26EEERKS4_
Line
Count
Source
788
5
    static void merge_values(State& state, const State& other) {
789
5
        if (other.live == 0) {
790
            // The other partial state saw no non-NULL row.
791
2
            return;
792
2
        }
793
        // `_state`/`_merge`/`_union` merges one serialized singleton per row, so a single-entry
794
        // RHS is exactly one add, whether or not the list is full: a retained value (including an
795
        // interior one) only bumps its count, and a new one is inserted, evicting the worst only
796
        // when the list was already full. Neither copies the retained values nor rebuilds the
797
        // tree.
798
3
        if (other.live == 1) {
799
1
            const int32_t other_only = other.root;
800
1
            ValueRef value = value_of(other, other_only);
801
1
            if (state.live >= state.k &&
802
1
                is_worse(compare_values(value, value_of(state, state.worst)))) {
803
                // A full list rejects a worse value without touching the tree.
804
0
                return;
805
0
            }
806
1
            int32_t inserted = State::NO_SLOT;
807
1
            state.root = add_or_increment(state, state.root, value, other.slots[other_only].count,
808
1
                                          &inserted);
809
1
            if (inserted == State::NO_SLOT) {
810
0
                return;
811
0
            }
812
1
            if (state.live <= state.k) {
813
                // There was room: the new entry competes with the cached worst for the eviction
814
                // candidate role, exactly like the add path.
815
1
                if (state.worst == State::NO_SLOT ||
816
1
                    is_worse(compare_slots(state, inserted, state.worst))) {
817
1
                    state.worst = inserted;
818
1
                }
819
1
                return;
820
1
            }
821
            // The list was full, so the new entry is one over capacity. It beat the cached worst
822
            // above, so the old worst is still the last entry and leaves the list.
823
0
            int32_t removed = State::NO_SLOT;
824
0
            state.root = erase_worst(state, state.root, &removed);
825
0
            DCHECK_EQ(removed, state.worst);
826
0
            evict_value(state, removed);
827
0
            state.slots[removed].count = State::DEAD_COUNT;
828
0
            --state.live;
829
0
            ++state.dead;
830
0
            refresh_worst(state);
831
0
            maybe_compact(state);
832
0
            return;
833
1
        }
834
2
        if (state.live >= state.k) {
835
            // A full state already holds the k best values. If every value of the other state is
836
            // worse than the worst one retained here, the merge cannot change the result, so skip
837
            // the collect/rebuild.
838
0
            const int32_t other_best = best_slot(other);
839
0
            int cmp = compare_values(value_of(other, other_best), value_of(state, state.worst));
840
0
            if (is_worse(cmp)) {
841
0
                return;
842
0
            }
843
0
            if (cmp == 0) {
844
                // The other state's best value is the worst retained one. Its remaining values are
845
                // distinct and worse, so they cannot enter either: only that count changes, and
846
                // the tree stays as it is.
847
0
                state.slots[state.worst].count =
848
0
                        checked_add(state.slots[state.worst].count, other.slots[other_best].count);
849
0
                return;
850
0
            }
851
0
        }
852
2
        DorisVector<int32_t> lhs_slots;
853
2
        DorisVector<int32_t> rhs_slots;
854
2
        collect_in_order(state, lhs_slots);
855
2
        collect_in_order(other, rhs_slots);
856
2
        DorisVector<Entry> merged;
857
2
        merge_sorted_slots(state, lhs_slots, other, rhs_slots, static_cast<size_t>(state.k),
858
2
                           merged);
859
2
        check_slot_capacity(merged.size());
860
2
        assign_sorted(state, std::move(merged));
861
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_27EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_43EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_42EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_36EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_37EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE12merge_valuesERNS_22AggregateTopKCountDataILS1_44EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_2EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_3EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_4EEERKS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_5EEERKS4_
Line
Count
Source
788
28
    static void merge_values(State& state, const State& other) {
789
28
        if (other.live == 0) {
790
            // The other partial state saw no non-NULL row.
791
4
            return;
792
4
        }
793
        // `_state`/`_merge`/`_union` merges one serialized singleton per row, so a single-entry
794
        // RHS is exactly one add, whether or not the list is full: a retained value (including an
795
        // interior one) only bumps its count, and a new one is inserted, evicting the worst only
796
        // when the list was already full. Neither copies the retained values nor rebuilds the
797
        // tree.
798
24
        if (other.live == 1) {
799
12
            const int32_t other_only = other.root;
800
12
            ValueRef value = value_of(other, other_only);
801
12
            if (state.live >= state.k &&
802
12
                is_worse(compare_values(value, value_of(state, state.worst)))) {
803
                // A full list rejects a worse value without touching the tree.
804
0
                return;
805
0
            }
806
12
            int32_t inserted = State::NO_SLOT;
807
12
            state.root = add_or_increment(state, state.root, value, other.slots[other_only].count,
808
12
                                          &inserted);
809
12
            if (inserted == State::NO_SLOT) {
810
0
                return;
811
0
            }
812
12
            if (state.live <= state.k) {
813
                // There was room: the new entry competes with the cached worst for the eviction
814
                // candidate role, exactly like the add path.
815
12
                if (state.worst == State::NO_SLOT ||
816
12
                    is_worse(compare_slots(state, inserted, state.worst))) {
817
12
                    state.worst = inserted;
818
12
                }
819
12
                return;
820
12
            }
821
            // The list was full, so the new entry is one over capacity. It beat the cached worst
822
            // above, so the old worst is still the last entry and leaves the list.
823
0
            int32_t removed = State::NO_SLOT;
824
0
            state.root = erase_worst(state, state.root, &removed);
825
0
            DCHECK_EQ(removed, state.worst);
826
0
            evict_value(state, removed);
827
0
            state.slots[removed].count = State::DEAD_COUNT;
828
0
            --state.live;
829
0
            ++state.dead;
830
0
            refresh_worst(state);
831
0
            maybe_compact(state);
832
0
            return;
833
12
        }
834
12
        if (state.live >= state.k) {
835
            // A full state already holds the k best values. If every value of the other state is
836
            // worse than the worst one retained here, the merge cannot change the result, so skip
837
            // the collect/rebuild.
838
4
            const int32_t other_best = best_slot(other);
839
4
            int cmp = compare_values(value_of(other, other_best), value_of(state, state.worst));
840
4
            if (is_worse(cmp)) {
841
0
                return;
842
0
            }
843
4
            if (cmp == 0) {
844
                // The other state's best value is the worst retained one. Its remaining values are
845
                // distinct and worse, so they cannot enter either: only that count changes, and
846
                // the tree stays as it is.
847
0
                state.slots[state.worst].count =
848
0
                        checked_add(state.slots[state.worst].count, other.slots[other_best].count);
849
0
                return;
850
0
            }
851
4
        }
852
12
        DorisVector<int32_t> lhs_slots;
853
12
        DorisVector<int32_t> rhs_slots;
854
12
        collect_in_order(state, lhs_slots);
855
12
        collect_in_order(other, rhs_slots);
856
12
        DorisVector<Entry> merged;
857
12
        merge_sorted_slots(state, lhs_slots, other, rhs_slots, static_cast<size_t>(state.k),
858
12
                           merged);
859
12
        check_slot_capacity(merged.size());
860
12
        assign_sorted(state, std::move(merged));
861
12
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_6EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_7EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_8EEERKS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_9EEERKS4_
Line
Count
Source
788
1
    static void merge_values(State& state, const State& other) {
789
1
        if (other.live == 0) {
790
            // The other partial state saw no non-NULL row.
791
0
            return;
792
0
        }
793
        // `_state`/`_merge`/`_union` merges one serialized singleton per row, so a single-entry
794
        // RHS is exactly one add, whether or not the list is full: a retained value (including an
795
        // interior one) only bumps its count, and a new one is inserted, evicting the worst only
796
        // when the list was already full. Neither copies the retained values nor rebuilds the
797
        // tree.
798
1
        if (other.live == 1) {
799
0
            const int32_t other_only = other.root;
800
0
            ValueRef value = value_of(other, other_only);
801
0
            if (state.live >= state.k &&
802
0
                is_worse(compare_values(value, value_of(state, state.worst)))) {
803
                // A full list rejects a worse value without touching the tree.
804
0
                return;
805
0
            }
806
0
            int32_t inserted = State::NO_SLOT;
807
0
            state.root = add_or_increment(state, state.root, value, other.slots[other_only].count,
808
0
                                          &inserted);
809
0
            if (inserted == State::NO_SLOT) {
810
0
                return;
811
0
            }
812
0
            if (state.live <= state.k) {
813
                // There was room: the new entry competes with the cached worst for the eviction
814
                // candidate role, exactly like the add path.
815
0
                if (state.worst == State::NO_SLOT ||
816
0
                    is_worse(compare_slots(state, inserted, state.worst))) {
817
0
                    state.worst = inserted;
818
0
                }
819
0
                return;
820
0
            }
821
            // The list was full, so the new entry is one over capacity. It beat the cached worst
822
            // above, so the old worst is still the last entry and leaves the list.
823
0
            int32_t removed = State::NO_SLOT;
824
0
            state.root = erase_worst(state, state.root, &removed);
825
0
            DCHECK_EQ(removed, state.worst);
826
0
            evict_value(state, removed);
827
0
            state.slots[removed].count = State::DEAD_COUNT;
828
0
            --state.live;
829
0
            ++state.dead;
830
0
            refresh_worst(state);
831
0
            maybe_compact(state);
832
0
            return;
833
0
        }
834
1
        if (state.live >= state.k) {
835
            // A full state already holds the k best values. If every value of the other state is
836
            // worse than the worst one retained here, the merge cannot change the result, so skip
837
            // the collect/rebuild.
838
0
            const int32_t other_best = best_slot(other);
839
0
            int cmp = compare_values(value_of(other, other_best), value_of(state, state.worst));
840
0
            if (is_worse(cmp)) {
841
0
                return;
842
0
            }
843
0
            if (cmp == 0) {
844
                // The other state's best value is the worst retained one. Its remaining values are
845
                // distinct and worse, so they cannot enter either: only that count changes, and
846
                // the tree stays as it is.
847
0
                state.slots[state.worst].count =
848
0
                        checked_add(state.slots[state.worst].count, other.slots[other_best].count);
849
0
                return;
850
0
            }
851
0
        }
852
1
        DorisVector<int32_t> lhs_slots;
853
1
        DorisVector<int32_t> rhs_slots;
854
1
        collect_in_order(state, lhs_slots);
855
1
        collect_in_order(other, rhs_slots);
856
1
        DorisVector<Entry> merged;
857
1
        merge_sorted_slots(state, lhs_slots, other, rhs_slots, static_cast<size_t>(state.k),
858
1
                           merged);
859
1
        check_slot_capacity(merged.size());
860
1
        assign_sorted(state, std::move(merged));
861
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_28EEERKS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_29EEERKS4_
Line
Count
Source
788
7
    static void merge_values(State& state, const State& other) {
789
7
        if (other.live == 0) {
790
            // The other partial state saw no non-NULL row.
791
1
            return;
792
1
        }
793
        // `_state`/`_merge`/`_union` merges one serialized singleton per row, so a single-entry
794
        // RHS is exactly one add, whether or not the list is full: a retained value (including an
795
        // interior one) only bumps its count, and a new one is inserted, evicting the worst only
796
        // when the list was already full. Neither copies the retained values nor rebuilds the
797
        // tree.
798
6
        if (other.live == 1) {
799
2
            const int32_t other_only = other.root;
800
2
            ValueRef value = value_of(other, other_only);
801
2
            if (state.live >= state.k &&
802
2
                is_worse(compare_values(value, value_of(state, state.worst)))) {
803
                // A full list rejects a worse value without touching the tree.
804
0
                return;
805
0
            }
806
2
            int32_t inserted = State::NO_SLOT;
807
2
            state.root = add_or_increment(state, state.root, value, other.slots[other_only].count,
808
2
                                          &inserted);
809
2
            if (inserted == State::NO_SLOT) {
810
0
                return;
811
0
            }
812
2
            if (state.live <= state.k) {
813
                // There was room: the new entry competes with the cached worst for the eviction
814
                // candidate role, exactly like the add path.
815
2
                if (state.worst == State::NO_SLOT ||
816
2
                    is_worse(compare_slots(state, inserted, state.worst))) {
817
2
                    state.worst = inserted;
818
2
                }
819
2
                return;
820
2
            }
821
            // The list was full, so the new entry is one over capacity. It beat the cached worst
822
            // above, so the old worst is still the last entry and leaves the list.
823
0
            int32_t removed = State::NO_SLOT;
824
0
            state.root = erase_worst(state, state.root, &removed);
825
0
            DCHECK_EQ(removed, state.worst);
826
0
            evict_value(state, removed);
827
0
            state.slots[removed].count = State::DEAD_COUNT;
828
0
            --state.live;
829
0
            ++state.dead;
830
0
            refresh_worst(state);
831
0
            maybe_compact(state);
832
0
            return;
833
2
        }
834
4
        if (state.live >= state.k) {
835
            // A full state already holds the k best values. If every value of the other state is
836
            // worse than the worst one retained here, the merge cannot change the result, so skip
837
            // the collect/rebuild.
838
1
            const int32_t other_best = best_slot(other);
839
1
            int cmp = compare_values(value_of(other, other_best), value_of(state, state.worst));
840
1
            if (is_worse(cmp)) {
841
0
                return;
842
0
            }
843
1
            if (cmp == 0) {
844
                // The other state's best value is the worst retained one. Its remaining values are
845
                // distinct and worse, so they cannot enter either: only that count changes, and
846
                // the tree stays as it is.
847
0
                state.slots[state.worst].count =
848
0
                        checked_add(state.slots[state.worst].count, other.slots[other_best].count);
849
0
                return;
850
0
            }
851
1
        }
852
4
        DorisVector<int32_t> lhs_slots;
853
4
        DorisVector<int32_t> rhs_slots;
854
4
        collect_in_order(state, lhs_slots);
855
4
        collect_in_order(other, rhs_slots);
856
4
        DorisVector<Entry> merged;
857
4
        merge_sorted_slots(state, lhs_slots, other, rhs_slots, static_cast<size_t>(state.k),
858
4
                           merged);
859
4
        check_slot_capacity(merged.size());
860
4
        assign_sorted(state, std::move(merged));
861
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_20EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_30EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_35EEERKS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_10EEERKS4_
Line
Count
Source
788
7
    static void merge_values(State& state, const State& other) {
789
7
        if (other.live == 0) {
790
            // The other partial state saw no non-NULL row.
791
1
            return;
792
1
        }
793
        // `_state`/`_merge`/`_union` merges one serialized singleton per row, so a single-entry
794
        // RHS is exactly one add, whether or not the list is full: a retained value (including an
795
        // interior one) only bumps its count, and a new one is inserted, evicting the worst only
796
        // when the list was already full. Neither copies the retained values nor rebuilds the
797
        // tree.
798
6
        if (other.live == 1) {
799
2
            const int32_t other_only = other.root;
800
2
            ValueRef value = value_of(other, other_only);
801
2
            if (state.live >= state.k &&
802
2
                is_worse(compare_values(value, value_of(state, state.worst)))) {
803
                // A full list rejects a worse value without touching the tree.
804
0
                return;
805
0
            }
806
2
            int32_t inserted = State::NO_SLOT;
807
2
            state.root = add_or_increment(state, state.root, value, other.slots[other_only].count,
808
2
                                          &inserted);
809
2
            if (inserted == State::NO_SLOT) {
810
0
                return;
811
0
            }
812
2
            if (state.live <= state.k) {
813
                // There was room: the new entry competes with the cached worst for the eviction
814
                // candidate role, exactly like the add path.
815
2
                if (state.worst == State::NO_SLOT ||
816
2
                    is_worse(compare_slots(state, inserted, state.worst))) {
817
2
                    state.worst = inserted;
818
2
                }
819
2
                return;
820
2
            }
821
            // The list was full, so the new entry is one over capacity. It beat the cached worst
822
            // above, so the old worst is still the last entry and leaves the list.
823
0
            int32_t removed = State::NO_SLOT;
824
0
            state.root = erase_worst(state, state.root, &removed);
825
0
            DCHECK_EQ(removed, state.worst);
826
0
            evict_value(state, removed);
827
0
            state.slots[removed].count = State::DEAD_COUNT;
828
0
            --state.live;
829
0
            ++state.dead;
830
0
            refresh_worst(state);
831
0
            maybe_compact(state);
832
0
            return;
833
2
        }
834
4
        if (state.live >= state.k) {
835
            // A full state already holds the k best values. If every value of the other state is
836
            // worse than the worst one retained here, the merge cannot change the result, so skip
837
            // the collect/rebuild.
838
1
            const int32_t other_best = best_slot(other);
839
1
            int cmp = compare_values(value_of(other, other_best), value_of(state, state.worst));
840
1
            if (is_worse(cmp)) {
841
0
                return;
842
0
            }
843
1
            if (cmp == 0) {
844
                // The other state's best value is the worst retained one. Its remaining values are
845
                // distinct and worse, so they cannot enter either: only that count changes, and
846
                // the tree stays as it is.
847
0
                state.slots[state.worst].count =
848
0
                        checked_add(state.slots[state.worst].count, other.slots[other_best].count);
849
0
                return;
850
0
            }
851
1
        }
852
4
        DorisVector<int32_t> lhs_slots;
853
4
        DorisVector<int32_t> rhs_slots;
854
4
        collect_in_order(state, lhs_slots);
855
4
        collect_in_order(other, rhs_slots);
856
4
        DorisVector<Entry> merged;
857
4
        merge_sorted_slots(state, lhs_slots, other, rhs_slots, static_cast<size_t>(state.k),
858
4
                           merged);
859
4
        check_slot_capacity(merged.size());
860
4
        assign_sorted(state, std::move(merged));
861
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_11EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_12EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_25EEERKS4_
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_26EEERKS4_
Line
Count
Source
788
5
    static void merge_values(State& state, const State& other) {
789
5
        if (other.live == 0) {
790
            // The other partial state saw no non-NULL row.
791
2
            return;
792
2
        }
793
        // `_state`/`_merge`/`_union` merges one serialized singleton per row, so a single-entry
794
        // RHS is exactly one add, whether or not the list is full: a retained value (including an
795
        // interior one) only bumps its count, and a new one is inserted, evicting the worst only
796
        // when the list was already full. Neither copies the retained values nor rebuilds the
797
        // tree.
798
3
        if (other.live == 1) {
799
1
            const int32_t other_only = other.root;
800
1
            ValueRef value = value_of(other, other_only);
801
1
            if (state.live >= state.k &&
802
1
                is_worse(compare_values(value, value_of(state, state.worst)))) {
803
                // A full list rejects a worse value without touching the tree.
804
0
                return;
805
0
            }
806
1
            int32_t inserted = State::NO_SLOT;
807
1
            state.root = add_or_increment(state, state.root, value, other.slots[other_only].count,
808
1
                                          &inserted);
809
1
            if (inserted == State::NO_SLOT) {
810
0
                return;
811
0
            }
812
1
            if (state.live <= state.k) {
813
                // There was room: the new entry competes with the cached worst for the eviction
814
                // candidate role, exactly like the add path.
815
1
                if (state.worst == State::NO_SLOT ||
816
1
                    is_worse(compare_slots(state, inserted, state.worst))) {
817
1
                    state.worst = inserted;
818
1
                }
819
1
                return;
820
1
            }
821
            // The list was full, so the new entry is one over capacity. It beat the cached worst
822
            // above, so the old worst is still the last entry and leaves the list.
823
0
            int32_t removed = State::NO_SLOT;
824
0
            state.root = erase_worst(state, state.root, &removed);
825
0
            DCHECK_EQ(removed, state.worst);
826
0
            evict_value(state, removed);
827
0
            state.slots[removed].count = State::DEAD_COUNT;
828
0
            --state.live;
829
0
            ++state.dead;
830
0
            refresh_worst(state);
831
0
            maybe_compact(state);
832
0
            return;
833
1
        }
834
2
        if (state.live >= state.k) {
835
            // A full state already holds the k best values. If every value of the other state is
836
            // worse than the worst one retained here, the merge cannot change the result, so skip
837
            // the collect/rebuild.
838
0
            const int32_t other_best = best_slot(other);
839
0
            int cmp = compare_values(value_of(other, other_best), value_of(state, state.worst));
840
0
            if (is_worse(cmp)) {
841
0
                return;
842
0
            }
843
0
            if (cmp == 0) {
844
                // The other state's best value is the worst retained one. Its remaining values are
845
                // distinct and worse, so they cannot enter either: only that count changes, and
846
                // the tree stays as it is.
847
0
                state.slots[state.worst].count =
848
0
                        checked_add(state.slots[state.worst].count, other.slots[other_best].count);
849
0
                return;
850
0
            }
851
0
        }
852
2
        DorisVector<int32_t> lhs_slots;
853
2
        DorisVector<int32_t> rhs_slots;
854
2
        collect_in_order(state, lhs_slots);
855
2
        collect_in_order(other, rhs_slots);
856
2
        DorisVector<Entry> merged;
857
2
        merge_sorted_slots(state, lhs_slots, other, rhs_slots, static_cast<size_t>(state.k),
858
2
                           merged);
859
2
        check_slot_capacity(merged.size());
860
2
        assign_sorted(state, std::move(merged));
861
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_27EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_43EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_42EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_36EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_37EEERKS4_
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE12merge_valuesERNS_22AggregateTopKCountDataILS1_44EEERKS4_
862
863
    /// Merges two best-first slot lists into at most `limit` entries in the aggregate's order,
864
    /// summing the counts of equal values. Both inputs hold distinct values, so a value appears at
865
    /// most twice.
866
    static void merge_sorted_slots(const State& state, const DorisVector<int32_t>& lhs_slots,
867
                                   const State& other, const DorisVector<int32_t>& rhs_slots,
868
50
                                   size_t limit, DorisVector<Entry>& merged) {
869
50
        merged.reserve(std::min(limit, lhs_slots.size() + rhs_slots.size()));
870
50
        size_t lhs_index = 0;
871
50
        size_t rhs_index = 0;
872
204
        while (merged.size() < limit &&
873
204
               (lhs_index < lhs_slots.size() || rhs_index < rhs_slots.size())) {
874
154
            if (rhs_index == rhs_slots.size()) {
875
0
                merged.push_back(Entry {value_of(state, lhs_slots[lhs_index]),
876
0
                                        state.slots[lhs_slots[lhs_index]].count});
877
0
                ++lhs_index;
878
154
            } else if (lhs_index == lhs_slots.size()) {
879
118
                merged.push_back(Entry {value_of(other, rhs_slots[rhs_index]),
880
118
                                        other.slots[rhs_slots[rhs_index]].count});
881
118
                ++rhs_index;
882
118
            } else {
883
36
                ValueRef lhs_value = value_of(state, lhs_slots[lhs_index]);
884
36
                ValueRef rhs_value = value_of(other, rhs_slots[rhs_index]);
885
36
                int cmp = compare_values(lhs_value, rhs_value);
886
                // Both lists are ordered best-first (ascending for MIN, descending for MAX).
887
36
                const bool lhs_is_better = comes_before(cmp);
888
36
                if (lhs_is_better) {
889
17
                    merged.push_back(Entry {lhs_value, state.slots[lhs_slots[lhs_index]].count});
890
17
                    ++lhs_index;
891
19
                } else if (cmp != 0) {
892
                    // Not better and not equal: the right-hand value is better.
893
15
                    merged.push_back(Entry {rhs_value, other.slots[rhs_slots[rhs_index]].count});
894
15
                    ++rhs_index;
895
15
                } else {
896
4
                    merged.push_back(Entry {lhs_value,
897
4
                                            checked_add(state.slots[lhs_slots[lhs_index]].count,
898
4
                                                        other.slots[rhs_slots[rhs_index]].count)});
899
4
                    ++lhs_index;
900
4
                    ++rhs_index;
901
4
                }
902
36
            }
903
154
        }
904
50
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_2EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_3EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_4EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_5EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Line
Count
Source
868
16
                                   size_t limit, DorisVector<Entry>& merged) {
869
16
        merged.reserve(std::min(limit, lhs_slots.size() + rhs_slots.size()));
870
16
        size_t lhs_index = 0;
871
16
        size_t rhs_index = 0;
872
74
        while (merged.size() < limit &&
873
74
               (lhs_index < lhs_slots.size() || rhs_index < rhs_slots.size())) {
874
58
            if (rhs_index == rhs_slots.size()) {
875
0
                merged.push_back(Entry {value_of(state, lhs_slots[lhs_index]),
876
0
                                        state.slots[lhs_slots[lhs_index]].count});
877
0
                ++lhs_index;
878
58
            } else if (lhs_index == lhs_slots.size()) {
879
44
                merged.push_back(Entry {value_of(other, rhs_slots[rhs_index]),
880
44
                                        other.slots[rhs_slots[rhs_index]].count});
881
44
                ++rhs_index;
882
44
            } else {
883
14
                ValueRef lhs_value = value_of(state, lhs_slots[lhs_index]);
884
14
                ValueRef rhs_value = value_of(other, rhs_slots[rhs_index]);
885
14
                int cmp = compare_values(lhs_value, rhs_value);
886
                // Both lists are ordered best-first (ascending for MIN, descending for MAX).
887
14
                const bool lhs_is_better = comes_before(cmp);
888
14
                if (lhs_is_better) {
889
6
                    merged.push_back(Entry {lhs_value, state.slots[lhs_slots[lhs_index]].count});
890
6
                    ++lhs_index;
891
8
                } else if (cmp != 0) {
892
                    // Not better and not equal: the right-hand value is better.
893
5
                    merged.push_back(Entry {rhs_value, other.slots[rhs_slots[rhs_index]].count});
894
5
                    ++rhs_index;
895
5
                } else {
896
3
                    merged.push_back(Entry {lhs_value,
897
3
                                            checked_add(state.slots[lhs_slots[lhs_index]].count,
898
3
                                                        other.slots[rhs_slots[rhs_index]].count)});
899
3
                    ++lhs_index;
900
3
                    ++rhs_index;
901
3
                }
902
14
            }
903
58
        }
904
16
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_6EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_7EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_8EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_9EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Line
Count
Source
868
1
                                   size_t limit, DorisVector<Entry>& merged) {
869
1
        merged.reserve(std::min(limit, lhs_slots.size() + rhs_slots.size()));
870
1
        size_t lhs_index = 0;
871
1
        size_t rhs_index = 0;
872
4
        while (merged.size() < limit &&
873
4
               (lhs_index < lhs_slots.size() || rhs_index < rhs_slots.size())) {
874
3
            if (rhs_index == rhs_slots.size()) {
875
0
                merged.push_back(Entry {value_of(state, lhs_slots[lhs_index]),
876
0
                                        state.slots[lhs_slots[lhs_index]].count});
877
0
                ++lhs_index;
878
3
            } else if (lhs_index == lhs_slots.size()) {
879
3
                merged.push_back(Entry {value_of(other, rhs_slots[rhs_index]),
880
3
                                        other.slots[rhs_slots[rhs_index]].count});
881
3
                ++rhs_index;
882
3
            } else {
883
0
                ValueRef lhs_value = value_of(state, lhs_slots[lhs_index]);
884
0
                ValueRef rhs_value = value_of(other, rhs_slots[rhs_index]);
885
0
                int cmp = compare_values(lhs_value, rhs_value);
886
                // Both lists are ordered best-first (ascending for MIN, descending for MAX).
887
0
                const bool lhs_is_better = comes_before(cmp);
888
0
                if (lhs_is_better) {
889
0
                    merged.push_back(Entry {lhs_value, state.slots[lhs_slots[lhs_index]].count});
890
0
                    ++lhs_index;
891
0
                } else if (cmp != 0) {
892
                    // Not better and not equal: the right-hand value is better.
893
0
                    merged.push_back(Entry {rhs_value, other.slots[rhs_slots[rhs_index]].count});
894
0
                    ++rhs_index;
895
0
                } else {
896
0
                    merged.push_back(Entry {lhs_value,
897
0
                                            checked_add(state.slots[lhs_slots[lhs_index]].count,
898
0
                                                        other.slots[rhs_slots[rhs_index]].count)});
899
0
                    ++lhs_index;
900
0
                    ++rhs_index;
901
0
                }
902
0
            }
903
3
        }
904
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_28EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_29EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Line
Count
Source
868
4
                                   size_t limit, DorisVector<Entry>& merged) {
869
4
        merged.reserve(std::min(limit, lhs_slots.size() + rhs_slots.size()));
870
4
        size_t lhs_index = 0;
871
4
        size_t rhs_index = 0;
872
12
        while (merged.size() < limit &&
873
12
               (lhs_index < lhs_slots.size() || rhs_index < rhs_slots.size())) {
874
8
            if (rhs_index == rhs_slots.size()) {
875
0
                merged.push_back(Entry {value_of(state, lhs_slots[lhs_index]),
876
0
                                        state.slots[lhs_slots[lhs_index]].count});
877
0
                ++lhs_index;
878
8
            } else if (lhs_index == lhs_slots.size()) {
879
6
                merged.push_back(Entry {value_of(other, rhs_slots[rhs_index]),
880
6
                                        other.slots[rhs_slots[rhs_index]].count});
881
6
                ++rhs_index;
882
6
            } else {
883
2
                ValueRef lhs_value = value_of(state, lhs_slots[lhs_index]);
884
2
                ValueRef rhs_value = value_of(other, rhs_slots[rhs_index]);
885
2
                int cmp = compare_values(lhs_value, rhs_value);
886
                // Both lists are ordered best-first (ascending for MIN, descending for MAX).
887
2
                const bool lhs_is_better = comes_before(cmp);
888
2
                if (lhs_is_better) {
889
1
                    merged.push_back(Entry {lhs_value, state.slots[lhs_slots[lhs_index]].count});
890
1
                    ++lhs_index;
891
1
                } else if (cmp != 0) {
892
                    // Not better and not equal: the right-hand value is better.
893
0
                    merged.push_back(Entry {rhs_value, other.slots[rhs_slots[rhs_index]].count});
894
0
                    ++rhs_index;
895
1
                } else {
896
1
                    merged.push_back(Entry {lhs_value,
897
1
                                            checked_add(state.slots[lhs_slots[lhs_index]].count,
898
1
                                                        other.slots[rhs_slots[rhs_index]].count)});
899
1
                    ++lhs_index;
900
1
                    ++rhs_index;
901
1
                }
902
2
            }
903
8
        }
904
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_20EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_30EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_35EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_10EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Line
Count
Source
868
4
                                   size_t limit, DorisVector<Entry>& merged) {
869
4
        merged.reserve(std::min(limit, lhs_slots.size() + rhs_slots.size()));
870
4
        size_t lhs_index = 0;
871
4
        size_t rhs_index = 0;
872
12
        while (merged.size() < limit &&
873
12
               (lhs_index < lhs_slots.size() || rhs_index < rhs_slots.size())) {
874
8
            if (rhs_index == rhs_slots.size()) {
875
0
                merged.push_back(Entry {value_of(state, lhs_slots[lhs_index]),
876
0
                                        state.slots[lhs_slots[lhs_index]].count});
877
0
                ++lhs_index;
878
8
            } else if (lhs_index == lhs_slots.size()) {
879
6
                merged.push_back(Entry {value_of(other, rhs_slots[rhs_index]),
880
6
                                        other.slots[rhs_slots[rhs_index]].count});
881
6
                ++rhs_index;
882
6
            } else {
883
2
                ValueRef lhs_value = value_of(state, lhs_slots[lhs_index]);
884
2
                ValueRef rhs_value = value_of(other, rhs_slots[rhs_index]);
885
2
                int cmp = compare_values(lhs_value, rhs_value);
886
                // Both lists are ordered best-first (ascending for MIN, descending for MAX).
887
2
                const bool lhs_is_better = comes_before(cmp);
888
2
                if (lhs_is_better) {
889
1
                    merged.push_back(Entry {lhs_value, state.slots[lhs_slots[lhs_index]].count});
890
1
                    ++lhs_index;
891
1
                } else if (cmp != 0) {
892
                    // Not better and not equal: the right-hand value is better.
893
1
                    merged.push_back(Entry {rhs_value, other.slots[rhs_slots[rhs_index]].count});
894
1
                    ++rhs_index;
895
1
                } else {
896
0
                    merged.push_back(Entry {lhs_value,
897
0
                                            checked_add(state.slots[lhs_slots[lhs_index]].count,
898
0
                                                        other.slots[rhs_slots[rhs_index]].count)});
899
0
                    ++lhs_index;
900
0
                    ++rhs_index;
901
0
                }
902
2
            }
903
8
        }
904
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_11EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_12EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_25EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_26EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Line
Count
Source
868
2
                                   size_t limit, DorisVector<Entry>& merged) {
869
2
        merged.reserve(std::min(limit, lhs_slots.size() + rhs_slots.size()));
870
2
        size_t lhs_index = 0;
871
2
        size_t rhs_index = 0;
872
6
        while (merged.size() < limit &&
873
6
               (lhs_index < lhs_slots.size() || rhs_index < rhs_slots.size())) {
874
4
            if (rhs_index == rhs_slots.size()) {
875
0
                merged.push_back(Entry {value_of(state, lhs_slots[lhs_index]),
876
0
                                        state.slots[lhs_slots[lhs_index]].count});
877
0
                ++lhs_index;
878
4
            } else if (lhs_index == lhs_slots.size()) {
879
4
                merged.push_back(Entry {value_of(other, rhs_slots[rhs_index]),
880
4
                                        other.slots[rhs_slots[rhs_index]].count});
881
4
                ++rhs_index;
882
4
            } else {
883
0
                ValueRef lhs_value = value_of(state, lhs_slots[lhs_index]);
884
0
                ValueRef rhs_value = value_of(other, rhs_slots[rhs_index]);
885
0
                int cmp = compare_values(lhs_value, rhs_value);
886
                // Both lists are ordered best-first (ascending for MIN, descending for MAX).
887
0
                const bool lhs_is_better = comes_before(cmp);
888
0
                if (lhs_is_better) {
889
0
                    merged.push_back(Entry {lhs_value, state.slots[lhs_slots[lhs_index]].count});
890
0
                    ++lhs_index;
891
0
                } else if (cmp != 0) {
892
                    // Not better and not equal: the right-hand value is better.
893
0
                    merged.push_back(Entry {rhs_value, other.slots[rhs_slots[rhs_index]].count});
894
0
                    ++rhs_index;
895
0
                } else {
896
0
                    merged.push_back(Entry {lhs_value,
897
0
                                            checked_add(state.slots[lhs_slots[lhs_index]].count,
898
0
                                                        other.slots[rhs_slots[rhs_index]].count)});
899
0
                    ++lhs_index;
900
0
                    ++rhs_index;
901
0
                }
902
0
            }
903
4
        }
904
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_27EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_43EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_42EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_36EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_37EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_44EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_2EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_3EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_4EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_5EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Line
Count
Source
868
12
                                   size_t limit, DorisVector<Entry>& merged) {
869
12
        merged.reserve(std::min(limit, lhs_slots.size() + rhs_slots.size()));
870
12
        size_t lhs_index = 0;
871
12
        size_t rhs_index = 0;
872
62
        while (merged.size() < limit &&
873
62
               (lhs_index < lhs_slots.size() || rhs_index < rhs_slots.size())) {
874
50
            if (rhs_index == rhs_slots.size()) {
875
0
                merged.push_back(Entry {value_of(state, lhs_slots[lhs_index]),
876
0
                                        state.slots[lhs_slots[lhs_index]].count});
877
0
                ++lhs_index;
878
50
            } else if (lhs_index == lhs_slots.size()) {
879
36
                merged.push_back(Entry {value_of(other, rhs_slots[rhs_index]),
880
36
                                        other.slots[rhs_slots[rhs_index]].count});
881
36
                ++rhs_index;
882
36
            } else {
883
14
                ValueRef lhs_value = value_of(state, lhs_slots[lhs_index]);
884
14
                ValueRef rhs_value = value_of(other, rhs_slots[rhs_index]);
885
14
                int cmp = compare_values(lhs_value, rhs_value);
886
                // Both lists are ordered best-first (ascending for MIN, descending for MAX).
887
14
                const bool lhs_is_better = comes_before(cmp);
888
14
                if (lhs_is_better) {
889
7
                    merged.push_back(Entry {lhs_value, state.slots[lhs_slots[lhs_index]].count});
890
7
                    ++lhs_index;
891
7
                } else if (cmp != 0) {
892
                    // Not better and not equal: the right-hand value is better.
893
7
                    merged.push_back(Entry {rhs_value, other.slots[rhs_slots[rhs_index]].count});
894
7
                    ++rhs_index;
895
7
                } else {
896
0
                    merged.push_back(Entry {lhs_value,
897
0
                                            checked_add(state.slots[lhs_slots[lhs_index]].count,
898
0
                                                        other.slots[rhs_slots[rhs_index]].count)});
899
0
                    ++lhs_index;
900
0
                    ++rhs_index;
901
0
                }
902
14
            }
903
50
        }
904
12
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_6EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_7EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_8EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_9EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Line
Count
Source
868
1
                                   size_t limit, DorisVector<Entry>& merged) {
869
1
        merged.reserve(std::min(limit, lhs_slots.size() + rhs_slots.size()));
870
1
        size_t lhs_index = 0;
871
1
        size_t rhs_index = 0;
872
4
        while (merged.size() < limit &&
873
4
               (lhs_index < lhs_slots.size() || rhs_index < rhs_slots.size())) {
874
3
            if (rhs_index == rhs_slots.size()) {
875
0
                merged.push_back(Entry {value_of(state, lhs_slots[lhs_index]),
876
0
                                        state.slots[lhs_slots[lhs_index]].count});
877
0
                ++lhs_index;
878
3
            } else if (lhs_index == lhs_slots.size()) {
879
3
                merged.push_back(Entry {value_of(other, rhs_slots[rhs_index]),
880
3
                                        other.slots[rhs_slots[rhs_index]].count});
881
3
                ++rhs_index;
882
3
            } else {
883
0
                ValueRef lhs_value = value_of(state, lhs_slots[lhs_index]);
884
0
                ValueRef rhs_value = value_of(other, rhs_slots[rhs_index]);
885
0
                int cmp = compare_values(lhs_value, rhs_value);
886
                // Both lists are ordered best-first (ascending for MIN, descending for MAX).
887
0
                const bool lhs_is_better = comes_before(cmp);
888
0
                if (lhs_is_better) {
889
0
                    merged.push_back(Entry {lhs_value, state.slots[lhs_slots[lhs_index]].count});
890
0
                    ++lhs_index;
891
0
                } else if (cmp != 0) {
892
                    // Not better and not equal: the right-hand value is better.
893
0
                    merged.push_back(Entry {rhs_value, other.slots[rhs_slots[rhs_index]].count});
894
0
                    ++rhs_index;
895
0
                } else {
896
0
                    merged.push_back(Entry {lhs_value,
897
0
                                            checked_add(state.slots[lhs_slots[lhs_index]].count,
898
0
                                                        other.slots[rhs_slots[rhs_index]].count)});
899
0
                    ++lhs_index;
900
0
                    ++rhs_index;
901
0
                }
902
0
            }
903
3
        }
904
1
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_28EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_29EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Line
Count
Source
868
4
                                   size_t limit, DorisVector<Entry>& merged) {
869
4
        merged.reserve(std::min(limit, lhs_slots.size() + rhs_slots.size()));
870
4
        size_t lhs_index = 0;
871
4
        size_t rhs_index = 0;
872
12
        while (merged.size() < limit &&
873
12
               (lhs_index < lhs_slots.size() || rhs_index < rhs_slots.size())) {
874
8
            if (rhs_index == rhs_slots.size()) {
875
0
                merged.push_back(Entry {value_of(state, lhs_slots[lhs_index]),
876
0
                                        state.slots[lhs_slots[lhs_index]].count});
877
0
                ++lhs_index;
878
8
            } else if (lhs_index == lhs_slots.size()) {
879
6
                merged.push_back(Entry {value_of(other, rhs_slots[rhs_index]),
880
6
                                        other.slots[rhs_slots[rhs_index]].count});
881
6
                ++rhs_index;
882
6
            } else {
883
2
                ValueRef lhs_value = value_of(state, lhs_slots[lhs_index]);
884
2
                ValueRef rhs_value = value_of(other, rhs_slots[rhs_index]);
885
2
                int cmp = compare_values(lhs_value, rhs_value);
886
                // Both lists are ordered best-first (ascending for MIN, descending for MAX).
887
2
                const bool lhs_is_better = comes_before(cmp);
888
2
                if (lhs_is_better) {
889
1
                    merged.push_back(Entry {lhs_value, state.slots[lhs_slots[lhs_index]].count});
890
1
                    ++lhs_index;
891
1
                } else if (cmp != 0) {
892
                    // Not better and not equal: the right-hand value is better.
893
1
                    merged.push_back(Entry {rhs_value, other.slots[rhs_slots[rhs_index]].count});
894
1
                    ++rhs_index;
895
1
                } else {
896
0
                    merged.push_back(Entry {lhs_value,
897
0
                                            checked_add(state.slots[lhs_slots[lhs_index]].count,
898
0
                                                        other.slots[rhs_slots[rhs_index]].count)});
899
0
                    ++lhs_index;
900
0
                    ++rhs_index;
901
0
                }
902
2
            }
903
8
        }
904
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_20EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_30EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_35EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_10EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Line
Count
Source
868
4
                                   size_t limit, DorisVector<Entry>& merged) {
869
4
        merged.reserve(std::min(limit, lhs_slots.size() + rhs_slots.size()));
870
4
        size_t lhs_index = 0;
871
4
        size_t rhs_index = 0;
872
12
        while (merged.size() < limit &&
873
12
               (lhs_index < lhs_slots.size() || rhs_index < rhs_slots.size())) {
874
8
            if (rhs_index == rhs_slots.size()) {
875
0
                merged.push_back(Entry {value_of(state, lhs_slots[lhs_index]),
876
0
                                        state.slots[lhs_slots[lhs_index]].count});
877
0
                ++lhs_index;
878
8
            } else if (lhs_index == lhs_slots.size()) {
879
6
                merged.push_back(Entry {value_of(other, rhs_slots[rhs_index]),
880
6
                                        other.slots[rhs_slots[rhs_index]].count});
881
6
                ++rhs_index;
882
6
            } else {
883
2
                ValueRef lhs_value = value_of(state, lhs_slots[lhs_index]);
884
2
                ValueRef rhs_value = value_of(other, rhs_slots[rhs_index]);
885
2
                int cmp = compare_values(lhs_value, rhs_value);
886
                // Both lists are ordered best-first (ascending for MIN, descending for MAX).
887
2
                const bool lhs_is_better = comes_before(cmp);
888
2
                if (lhs_is_better) {
889
1
                    merged.push_back(Entry {lhs_value, state.slots[lhs_slots[lhs_index]].count});
890
1
                    ++lhs_index;
891
1
                } else if (cmp != 0) {
892
                    // Not better and not equal: the right-hand value is better.
893
1
                    merged.push_back(Entry {rhs_value, other.slots[rhs_slots[rhs_index]].count});
894
1
                    ++rhs_index;
895
1
                } else {
896
0
                    merged.push_back(Entry {lhs_value,
897
0
                                            checked_add(state.slots[lhs_slots[lhs_index]].count,
898
0
                                                        other.slots[rhs_slots[rhs_index]].count)});
899
0
                    ++lhs_index;
900
0
                    ++rhs_index;
901
0
                }
902
2
            }
903
8
        }
904
4
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_11EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_12EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_25EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
_ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_26EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Line
Count
Source
868
2
                                   size_t limit, DorisVector<Entry>& merged) {
869
2
        merged.reserve(std::min(limit, lhs_slots.size() + rhs_slots.size()));
870
2
        size_t lhs_index = 0;
871
2
        size_t rhs_index = 0;
872
6
        while (merged.size() < limit &&
873
6
               (lhs_index < lhs_slots.size() || rhs_index < rhs_slots.size())) {
874
4
            if (rhs_index == rhs_slots.size()) {
875
0
                merged.push_back(Entry {value_of(state, lhs_slots[lhs_index]),
876
0
                                        state.slots[lhs_slots[lhs_index]].count});
877
0
                ++lhs_index;
878
4
            } else if (lhs_index == lhs_slots.size()) {
879
4
                merged.push_back(Entry {value_of(other, rhs_slots[rhs_index]),
880
4
                                        other.slots[rhs_slots[rhs_index]].count});
881
4
                ++rhs_index;
882
4
            } else {
883
0
                ValueRef lhs_value = value_of(state, lhs_slots[lhs_index]);
884
0
                ValueRef rhs_value = value_of(other, rhs_slots[rhs_index]);
885
0
                int cmp = compare_values(lhs_value, rhs_value);
886
                // Both lists are ordered best-first (ascending for MIN, descending for MAX).
887
0
                const bool lhs_is_better = comes_before(cmp);
888
0
                if (lhs_is_better) {
889
0
                    merged.push_back(Entry {lhs_value, state.slots[lhs_slots[lhs_index]].count});
890
0
                    ++lhs_index;
891
0
                } else if (cmp != 0) {
892
                    // Not better and not equal: the right-hand value is better.
893
0
                    merged.push_back(Entry {rhs_value, other.slots[rhs_slots[rhs_index]].count});
894
0
                    ++rhs_index;
895
0
                } else {
896
0
                    merged.push_back(Entry {lhs_value,
897
0
                                            checked_add(state.slots[lhs_slots[lhs_index]].count,
898
0
                                                        other.slots[rhs_slots[rhs_index]].count)});
899
0
                    ++lhs_index;
900
0
                    ++rhs_index;
901
0
                }
902
0
            }
903
4
        }
904
2
    }
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_27EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_43EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_42EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_36EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_37EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
Unexecuted instantiation: _ZN5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE18merge_sorted_slotsERKNS_22AggregateTopKCountDataILS1_44EEERKSt6vectorIiNS_18CustomStdAllocatorIiNS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEEEEES6_SF_mRS7_INS4_5EntryENS8_ISG_SB_EEE
905
906
    /// Writes a length-prefixed column blob. The declared length is
907
    /// get_uncompressed_serialized_bytes(), which is an upper bound: above
908
    /// SERIALIZED_MEM_SIZE_LIMIT the serde may compress the payload and return an earlier end
909
    /// pointer, so the reader skips the same declared length and the unused tail is padding.
910
119
    void write_column(BufferWritable& buf, const IColumn& column) const {
911
119
        const auto value_type = remove_nullable(this->argument_types[0]);
912
119
        int64_t capacity =
913
119
                value_type->get_uncompressed_serialized_bytes(column, IAggregateFunction::version);
914
119
        buf.write_binary(capacity);
915
119
        buf.resize(capacity);
916
119
        auto* pos = value_type->serialize(column, buf.data(), IAggregateFunction::version);
917
119
        DCHECK_LE(pos, buf.data() + capacity);
918
119
        buf.add_offset(capacity);
919
119
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Line
Count
Source
910
47
    void write_column(BufferWritable& buf, const IColumn& column) const {
911
47
        const auto value_type = remove_nullable(this->argument_types[0]);
912
47
        int64_t capacity =
913
47
                value_type->get_uncompressed_serialized_bytes(column, IAggregateFunction::version);
914
47
        buf.write_binary(capacity);
915
47
        buf.resize(capacity);
916
47
        auto* pos = value_type->serialize(column, buf.data(), IAggregateFunction::version);
917
        DCHECK_LE(pos, buf.data() + capacity);
918
47
        buf.add_offset(capacity);
919
47
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Line
Count
Source
910
1
    void write_column(BufferWritable& buf, const IColumn& column) const {
911
1
        const auto value_type = remove_nullable(this->argument_types[0]);
912
1
        int64_t capacity =
913
1
                value_type->get_uncompressed_serialized_bytes(column, IAggregateFunction::version);
914
1
        buf.write_binary(capacity);
915
1
        buf.resize(capacity);
916
1
        auto* pos = value_type->serialize(column, buf.data(), IAggregateFunction::version);
917
        DCHECK_LE(pos, buf.data() + capacity);
918
1
        buf.add_offset(capacity);
919
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Line
Count
Source
910
7
    void write_column(BufferWritable& buf, const IColumn& column) const {
911
7
        const auto value_type = remove_nullable(this->argument_types[0]);
912
7
        int64_t capacity =
913
7
                value_type->get_uncompressed_serialized_bytes(column, IAggregateFunction::version);
914
7
        buf.write_binary(capacity);
915
7
        buf.resize(capacity);
916
7
        auto* pos = value_type->serialize(column, buf.data(), IAggregateFunction::version);
917
        DCHECK_LE(pos, buf.data() + capacity);
918
7
        buf.add_offset(capacity);
919
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Line
Count
Source
910
8
    void write_column(BufferWritable& buf, const IColumn& column) const {
911
8
        const auto value_type = remove_nullable(this->argument_types[0]);
912
8
        int64_t capacity =
913
8
                value_type->get_uncompressed_serialized_bytes(column, IAggregateFunction::version);
914
8
        buf.write_binary(capacity);
915
8
        buf.resize(capacity);
916
8
        auto* pos = value_type->serialize(column, buf.data(), IAggregateFunction::version);
917
        DCHECK_LE(pos, buf.data() + capacity);
918
8
        buf.add_offset(capacity);
919
8
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Line
Count
Source
910
5
    void write_column(BufferWritable& buf, const IColumn& column) const {
911
5
        const auto value_type = remove_nullable(this->argument_types[0]);
912
5
        int64_t capacity =
913
5
                value_type->get_uncompressed_serialized_bytes(column, IAggregateFunction::version);
914
5
        buf.write_binary(capacity);
915
5
        buf.resize(capacity);
916
5
        auto* pos = value_type->serialize(column, buf.data(), IAggregateFunction::version);
917
        DCHECK_LE(pos, buf.data() + capacity);
918
5
        buf.add_offset(capacity);
919
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Line
Count
Source
910
31
    void write_column(BufferWritable& buf, const IColumn& column) const {
911
31
        const auto value_type = remove_nullable(this->argument_types[0]);
912
31
        int64_t capacity =
913
31
                value_type->get_uncompressed_serialized_bytes(column, IAggregateFunction::version);
914
31
        buf.write_binary(capacity);
915
31
        buf.resize(capacity);
916
31
        auto* pos = value_type->serialize(column, buf.data(), IAggregateFunction::version);
917
        DCHECK_LE(pos, buf.data() + capacity);
918
31
        buf.add_offset(capacity);
919
31
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Line
Count
Source
910
1
    void write_column(BufferWritable& buf, const IColumn& column) const {
911
1
        const auto value_type = remove_nullable(this->argument_types[0]);
912
1
        int64_t capacity =
913
1
                value_type->get_uncompressed_serialized_bytes(column, IAggregateFunction::version);
914
1
        buf.write_binary(capacity);
915
1
        buf.resize(capacity);
916
1
        auto* pos = value_type->serialize(column, buf.data(), IAggregateFunction::version);
917
        DCHECK_LE(pos, buf.data() + capacity);
918
1
        buf.add_offset(capacity);
919
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Line
Count
Source
910
7
    void write_column(BufferWritable& buf, const IColumn& column) const {
911
7
        const auto value_type = remove_nullable(this->argument_types[0]);
912
7
        int64_t capacity =
913
7
                value_type->get_uncompressed_serialized_bytes(column, IAggregateFunction::version);
914
7
        buf.write_binary(capacity);
915
7
        buf.resize(capacity);
916
7
        auto* pos = value_type->serialize(column, buf.data(), IAggregateFunction::version);
917
        DCHECK_LE(pos, buf.data() + capacity);
918
7
        buf.add_offset(capacity);
919
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Line
Count
Source
910
7
    void write_column(BufferWritable& buf, const IColumn& column) const {
911
7
        const auto value_type = remove_nullable(this->argument_types[0]);
912
7
        int64_t capacity =
913
7
                value_type->get_uncompressed_serialized_bytes(column, IAggregateFunction::version);
914
7
        buf.write_binary(capacity);
915
7
        buf.resize(capacity);
916
7
        auto* pos = value_type->serialize(column, buf.data(), IAggregateFunction::version);
917
        DCHECK_LE(pos, buf.data() + capacity);
918
7
        buf.add_offset(capacity);
919
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Line
Count
Source
910
5
    void write_column(BufferWritable& buf, const IColumn& column) const {
911
5
        const auto value_type = remove_nullable(this->argument_types[0]);
912
5
        int64_t capacity =
913
5
                value_type->get_uncompressed_serialized_bytes(column, IAggregateFunction::version);
914
5
        buf.write_binary(capacity);
915
5
        buf.resize(capacity);
916
5
        auto* pos = value_type->serialize(column, buf.data(), IAggregateFunction::version);
917
        DCHECK_LE(pos, buf.data() + capacity);
918
5
        buf.add_offset(capacity);
919
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE12write_columnERNS_14BufferWritableERKNS_7IColumnE
920
921
122
    MutableColumnPtr read_column(BufferReadable& buf) const {
922
122
        const auto value_type = remove_nullable(this->argument_types[0]);
923
122
        int64_t capacity = 0;
924
122
        buf.read_binary(capacity);
925
122
        MutableColumnPtr column = value_type->create_column();
926
122
        const auto* pos = value_type->deserialize(buf.data(), &column, IAggregateFunction::version);
927
        DCHECK_LE(pos, buf.data() + capacity);
928
122
        buf.add_offset(capacity);
929
122
        return column;
930
122
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb1EE11read_columnERNS_14BufferReadableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb1EE11read_columnERNS_14BufferReadableE
Line
Count
Source
921
49
    MutableColumnPtr read_column(BufferReadable& buf) const {
922
49
        const auto value_type = remove_nullable(this->argument_types[0]);
923
49
        int64_t capacity = 0;
924
49
        buf.read_binary(capacity);
925
49
        MutableColumnPtr column = value_type->create_column();
926
49
        const auto* pos = value_type->deserialize(buf.data(), &column, IAggregateFunction::version);
927
        DCHECK_LE(pos, buf.data() + capacity);
928
49
        buf.add_offset(capacity);
929
49
        return column;
930
49
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb1EE11read_columnERNS_14BufferReadableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb1EE11read_columnERNS_14BufferReadableE
Line
Count
Source
921
1
    MutableColumnPtr read_column(BufferReadable& buf) const {
922
1
        const auto value_type = remove_nullable(this->argument_types[0]);
923
1
        int64_t capacity = 0;
924
1
        buf.read_binary(capacity);
925
1
        MutableColumnPtr column = value_type->create_column();
926
1
        const auto* pos = value_type->deserialize(buf.data(), &column, IAggregateFunction::version);
927
        DCHECK_LE(pos, buf.data() + capacity);
928
1
        buf.add_offset(capacity);
929
1
        return column;
930
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb1EE11read_columnERNS_14BufferReadableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb1EE11read_columnERNS_14BufferReadableE
Line
Count
Source
921
7
    MutableColumnPtr read_column(BufferReadable& buf) const {
922
7
        const auto value_type = remove_nullable(this->argument_types[0]);
923
7
        int64_t capacity = 0;
924
7
        buf.read_binary(capacity);
925
7
        MutableColumnPtr column = value_type->create_column();
926
7
        const auto* pos = value_type->deserialize(buf.data(), &column, IAggregateFunction::version);
927
        DCHECK_LE(pos, buf.data() + capacity);
928
7
        buf.add_offset(capacity);
929
7
        return column;
930
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb1EE11read_columnERNS_14BufferReadableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb1EE11read_columnERNS_14BufferReadableE
Line
Count
Source
921
8
    MutableColumnPtr read_column(BufferReadable& buf) const {
922
8
        const auto value_type = remove_nullable(this->argument_types[0]);
923
8
        int64_t capacity = 0;
924
8
        buf.read_binary(capacity);
925
8
        MutableColumnPtr column = value_type->create_column();
926
8
        const auto* pos = value_type->deserialize(buf.data(), &column, IAggregateFunction::version);
927
        DCHECK_LE(pos, buf.data() + capacity);
928
8
        buf.add_offset(capacity);
929
8
        return column;
930
8
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb1EE11read_columnERNS_14BufferReadableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb1EE11read_columnERNS_14BufferReadableE
Line
Count
Source
921
5
    MutableColumnPtr read_column(BufferReadable& buf) const {
922
5
        const auto value_type = remove_nullable(this->argument_types[0]);
923
5
        int64_t capacity = 0;
924
5
        buf.read_binary(capacity);
925
5
        MutableColumnPtr column = value_type->create_column();
926
5
        const auto* pos = value_type->deserialize(buf.data(), &column, IAggregateFunction::version);
927
        DCHECK_LE(pos, buf.data() + capacity);
928
5
        buf.add_offset(capacity);
929
5
        return column;
930
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb1EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE2ELb0EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE3ELb0EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE4ELb0EE11read_columnERNS_14BufferReadableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE5ELb0EE11read_columnERNS_14BufferReadableE
Line
Count
Source
921
32
    MutableColumnPtr read_column(BufferReadable& buf) const {
922
32
        const auto value_type = remove_nullable(this->argument_types[0]);
923
32
        int64_t capacity = 0;
924
32
        buf.read_binary(capacity);
925
32
        MutableColumnPtr column = value_type->create_column();
926
32
        const auto* pos = value_type->deserialize(buf.data(), &column, IAggregateFunction::version);
927
        DCHECK_LE(pos, buf.data() + capacity);
928
32
        buf.add_offset(capacity);
929
32
        return column;
930
32
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE6ELb0EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE7ELb0EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE8ELb0EE11read_columnERNS_14BufferReadableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE9ELb0EE11read_columnERNS_14BufferReadableE
Line
Count
Source
921
1
    MutableColumnPtr read_column(BufferReadable& buf) const {
922
1
        const auto value_type = remove_nullable(this->argument_types[0]);
923
1
        int64_t capacity = 0;
924
1
        buf.read_binary(capacity);
925
1
        MutableColumnPtr column = value_type->create_column();
926
1
        const auto* pos = value_type->deserialize(buf.data(), &column, IAggregateFunction::version);
927
        DCHECK_LE(pos, buf.data() + capacity);
928
1
        buf.add_offset(capacity);
929
1
        return column;
930
1
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE28ELb0EE11read_columnERNS_14BufferReadableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE29ELb0EE11read_columnERNS_14BufferReadableE
Line
Count
Source
921
7
    MutableColumnPtr read_column(BufferReadable& buf) const {
922
7
        const auto value_type = remove_nullable(this->argument_types[0]);
923
7
        int64_t capacity = 0;
924
7
        buf.read_binary(capacity);
925
7
        MutableColumnPtr column = value_type->create_column();
926
7
        const auto* pos = value_type->deserialize(buf.data(), &column, IAggregateFunction::version);
927
        DCHECK_LE(pos, buf.data() + capacity);
928
7
        buf.add_offset(capacity);
929
7
        return column;
930
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE20ELb0EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE30ELb0EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE35ELb0EE11read_columnERNS_14BufferReadableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE10ELb0EE11read_columnERNS_14BufferReadableE
Line
Count
Source
921
7
    MutableColumnPtr read_column(BufferReadable& buf) const {
922
7
        const auto value_type = remove_nullable(this->argument_types[0]);
923
7
        int64_t capacity = 0;
924
7
        buf.read_binary(capacity);
925
7
        MutableColumnPtr column = value_type->create_column();
926
7
        const auto* pos = value_type->deserialize(buf.data(), &column, IAggregateFunction::version);
927
        DCHECK_LE(pos, buf.data() + capacity);
928
7
        buf.add_offset(capacity);
929
7
        return column;
930
7
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE11ELb0EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE12ELb0EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE25ELb0EE11read_columnERNS_14BufferReadableE
_ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE26ELb0EE11read_columnERNS_14BufferReadableE
Line
Count
Source
921
5
    MutableColumnPtr read_column(BufferReadable& buf) const {
922
5
        const auto value_type = remove_nullable(this->argument_types[0]);
923
5
        int64_t capacity = 0;
924
5
        buf.read_binary(capacity);
925
5
        MutableColumnPtr column = value_type->create_column();
926
5
        const auto* pos = value_type->deserialize(buf.data(), &column, IAggregateFunction::version);
927
        DCHECK_LE(pos, buf.data() + capacity);
928
5
        buf.add_offset(capacity);
929
5
        return column;
930
5
    }
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE27ELb0EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE43ELb0EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE42ELb0EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE36ELb0EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE37ELb0EE11read_columnERNS_14BufferReadableE
Unexecuted instantiation: _ZNK5doris21AggregateFunctionTopKILNS_13PrimitiveTypeE44ELb0EE11read_columnERNS_14BufferReadableE
931
};
932
933
} // namespace doris