Coverage Report

Created: 2024-11-20 12:56

/root/doris/be/src/vec/columns/column.h
Line
Count
Source (jump to first uncovered line)
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
// This file is copied from
18
// https://github.com/ClickHouse/ClickHouse/blob/master/src/Columns/IColumn.h
19
// and modified by Doris
20
21
#pragma once
22
23
#include <fmt/format.h>
24
#include <glog/logging.h>
25
#include <stdint.h>
26
#include <sys/types.h>
27
28
#include <algorithm>
29
#include <functional>
30
#include <ostream>
31
#include <string>
32
#include <type_traits>
33
#include <utility>
34
#include <vector>
35
36
#include "common/status.h"
37
#include "gutil/integral_types.h"
38
#include "olap/olap_common.h"
39
#include "runtime/define_primitive_type.h"
40
#include "vec/common/cow.h"
41
#include "vec/common/pod_array_fwd.h"
42
#include "vec/common/string_ref.h"
43
#include "vec/common/typeid_cast.h"
44
#include "vec/core/field.h"
45
#include "vec/core/types.h"
46
47
class SipHash;
48
49
#define SIP_HASHES_FUNCTION_COLUMN_IMPL()                                \
50
9
    auto s = hashes.size();                                              \
51
9
    DCHECK(s == size());                                                 \
52
9
    if (null_data == nullptr) {                                          \
53
22
        for (size_t i = 0; i < s; i++) {                                 \
54
13
            update_hash_with_value(i, hashes[i]);                        \
55
13
        }                                                                \
56
9
    } else {                                                             \
57
0
        for (size_t i = 0; i < s; i++) {                                 \
58
0
            if (null_data[i] == 0) update_hash_with_value(i, hashes[i]); \
59
0
        }                                                                \
60
0
    }
61
62
#define DO_CRC_HASHES_FUNCTION_COLUMN_IMPL()                                         \
63
5
    if (null_data == nullptr) {                                                      \
64
0
        for (size_t i = 0; i < s; i++) {                                             \
65
0
            hashes[i] = HashUtil::zlib_crc_hash(&data[i], sizeof(T), hashes[i]);     \
66
0
        }                                                                            \
67
5
    } else {                                                                         \
68
10
        for (size_t i = 0; i < s; i++) {                                             \
69
5
            if (null_data[i] == 0)                                                   \
70
5
                hashes[i] = HashUtil::zlib_crc_hash(&data[i], sizeof(T), hashes[i]); \
71
5
        }                                                                            \
72
5
    }
73
74
namespace doris::vectorized {
75
76
class Arena;
77
class ColumnSorter;
78
79
using EqualFlags = std::vector<uint8_t>;
80
using EqualRange = std::pair<int, int>;
81
82
/// Declares interface to store columns in memory.
83
class IColumn : public COW<IColumn> {
84
private:
85
    friend class COW<IColumn>;
86
87
    /// Creates the same column with the same data.
88
    /// This is internal method to use from COW.
89
    /// It performs shallow copy with copy-ctor and not useful from outside.
90
    /// If you want to copy column for modification, look at 'mutate' method.
91
    virtual MutablePtr clone() const = 0;
92
93
protected:
94
    // 64bit offsets now only Array type used, so we make it protected
95
    // to avoid use IColumn::Offset64 directly.
96
    // please use ColumnArray::Offset64 instead if we need.
97
    using Offset64 = UInt64;
98
    using Offsets64 = PaddedPODArray<Offset64>;
99
100
public:
101
    static constexpr int PREFETCH_STEP = 64;
102
    // 32bit offsets for string
103
    using Offset = UInt32;
104
    using Offsets = PaddedPODArray<Offset>;
105
106
    /// Name of a Column. It is used in info messages.
107
110
    virtual std::string get_name() const { return get_family_name(); }
108
109
    /// Name of a Column kind, without parameters (example: FixedString, Array).
110
    virtual const char* get_family_name() const = 0;
111
112
    /** If column isn't constant, returns nullptr (or itself).
113
      * If column is constant, transforms constant to full column (if column type allows such transform) and return it.
114
      */
115
10.2k
    virtual Ptr convert_to_full_column_if_const() const { return get_ptr(); }
116
117
    /// If column isn't ColumnLowCardinality, return itself.
118
    /// If column is ColumnLowCardinality, transforms is to full column.
119
93
    virtual Ptr convert_to_full_column_if_low_cardinality() const { return get_ptr(); }
120
121
    /// If column isn't ColumnDictionary, return itself.
122
    /// If column is ColumnDictionary, transforms is to predicate column.
123
0
    virtual MutablePtr convert_to_predicate_column_if_dictionary() { return get_ptr(); }
124
125
    /// If column is ColumnDictionary, and is a range comparison predicate, convert dict encoding
126
1.55k
    virtual void convert_dict_codes_if_necessary() {}
127
128
    /// If column is ColumnDictionary, and is a bloom filter predicate, generate_hash_values
129
0
    virtual void initialize_hash_values_for_runtime_filter() {}
130
131
    /// Creates empty column with the same type.
132
100
    virtual MutablePtr clone_empty() const { return clone_resized(0); }
133
134
    /// Creates column with the same type and specified size.
135
    /// If size is less current size, then data is cut.
136
    /// If size is greater, than default values are appended.
137
0
    virtual MutablePtr clone_resized(size_t s) const {
138
0
        LOG(FATAL) << "Cannot clone_resized() column " << get_name();
139
0
        return nullptr;
140
0
    }
141
142
    // shrink the end zeros for CHAR type or ARRAY<CHAR> type
143
0
    virtual MutablePtr get_shrinked_column() {
144
0
        LOG(FATAL) << "Cannot get_shrinked_column() column " << get_name();
145
0
        return nullptr;
146
0
    }
147
148
    // check the column whether could shrinked
149
    // now support only in char type, or the nested type in complex type: array{char}, struct{char}, map{char}
150
0
    virtual bool could_shrinked_column() { return false; }
151
152
    // Only used on ColumnDictionary
153
347
    virtual void set_rowset_segment_id(std::pair<RowsetId, uint32_t> rowset_segment_id) {}
154
155
0
    virtual std::pair<RowsetId, uint32_t> get_rowset_segment_id() const { return {}; }
156
157
    /// Returns number of values in column.
158
    virtual size_t size() const = 0;
159
160
    /// There are no values in columns.
161
6.26k
    bool empty() const { return size() == 0; }
162
163
    /// Returns value of n-th element in universal Field representation.
164
    /// Is used in rare cases, since creation of Field instance is expensive usually.
165
    virtual Field operator[](size_t n) const = 0;
166
167
    /// Like the previous one, but avoids extra copying if Field is in a container, for example.
168
    virtual void get(size_t n, Field& res) const = 0;
169
170
    /// If possible, returns pointer to memory chunk which contains n-th element (if it isn't possible, throws an exception)
171
    /// Is used to optimize some computations (in aggregation, for example).
172
    virtual StringRef get_data_at(size_t n) const = 0;
173
174
    /// If column stores integers, it returns n-th element transformed to UInt64 using static_cast.
175
    /// If column stores floating point numbers, bits of n-th elements are copied to lower bits of UInt64, the remaining bits are zeros.
176
    /// Is used to optimize some computations (in aggregation, for example).
177
0
    virtual UInt64 get64(size_t /*n*/) const {
178
0
        LOG(FATAL) << "Method get64 is not supported for ";
179
0
        return 0;
180
0
    }
181
182
    /// If column stores native numeric type, it returns n-th element casted to Float64
183
    /// Is used in regression methods to cast each features into uniform type
184
0
    virtual Float64 get_float64(size_t /*n*/) const {
185
0
        LOG(FATAL) << "Method get_float64 is not supported for " << get_name();
186
0
        return 0;
187
0
    }
188
189
    /** If column is numeric, return value of n-th element, casted to UInt64.
190
      * For NULL values of Nullable column it is allowed to return arbitrary value.
191
      * Otherwise throw an exception.
192
      */
193
0
    virtual UInt64 get_uint(size_t /*n*/) const {
194
0
        LOG(FATAL) << "Method get_uint is not supported for " << get_name();
195
0
        return 0;
196
0
    }
197
198
0
    virtual Int64 get_int(size_t /*n*/) const {
199
0
        LOG(FATAL) << "Method get_int is not supported for " << get_name();
200
0
        return 0;
201
0
    }
202
203
0
    virtual bool is_default_at(size_t n) const { return get64(n) == 0; }
204
6.05k
    virtual bool is_null_at(size_t /*n*/) const { return false; }
205
206
    /** If column is numeric, return value of n-th element, casted to bool.
207
      * For NULL values of Nullable column returns false.
208
      * Otherwise throw an exception.
209
      */
210
0
    virtual bool get_bool(size_t /*n*/) const {
211
0
        LOG(FATAL) << "Method get_bool is not supported for " << get_name();
212
0
        return false;
213
0
    }
214
215
    /// Removes all elements outside of specified range.
216
    /// Is used in LIMIT operation, for example.
217
0
    virtual Ptr cut(size_t start, size_t length) const {
218
0
        MutablePtr res = clone_empty();
219
0
        res->insert_range_from(*this, start, length);
220
0
        return res;
221
0
    }
222
223
    /// Appends new value at the end of column (column's size is increased by 1).
224
    /// Is used to transform raw strings to Blocks (for example, inside input format parsers)
225
    virtual void insert(const Field& x) = 0;
226
227
    /// Appends n-th element from other column with the same type.
228
    /// Is used in merge-sort and merges. It could be implemented in inherited classes more optimally than default implementation.
229
    virtual void insert_from(const IColumn& src, size_t n);
230
231
    /// Appends range of elements from other column with the same type.
232
    /// Could be used to concatenate columns.
233
    /// TODO: we need `insert_range_from_const` for every column type.
234
    virtual void insert_range_from(const IColumn& src, size_t start, size_t length) = 0;
235
236
    /// Appends one element from other column with the same type multiple times.
237
0
    virtual void insert_many_from(const IColumn& src, size_t position, size_t length) {
238
0
        for (size_t i = 0; i < length; ++i) {
239
0
            insert_from(src, position);
240
0
        }
241
0
    }
242
243
    /// Appends a batch elements from other column with the same type
244
    /// indices_begin + indices_end represent the row indices of column src
245
    /// Warning:
246
    ///       if *indices == -1 means the row is null, only use in outer join, do not use in any other place
247
    virtual void insert_indices_from(const IColumn& src, const int* indices_begin,
248
                                     const int* indices_end) = 0;
249
250
    /// Appends data located in specified memory chunk if it is possible (throws an exception if it cannot be implemented).
251
    /// Is used to optimize some computations (in aggregation, for example).
252
    /// Parameter length could be ignored if column values have fixed size.
253
    /// All data will be inserted as single element
254
    virtual void insert_data(const char* pos, size_t length) = 0;
255
256
0
    virtual void insert_many_fix_len_data(const char* pos, size_t num) {
257
0
        LOG(FATAL) << "Method insert_many_fix_len_data is not supported for " << get_name();
258
0
    }
259
260
    // todo(zeno) Use dict_args temp object to cover all arguments
261
    virtual void insert_many_dict_data(const int32_t* data_array, size_t start_index,
262
                                       const StringRef* dict, size_t data_num,
263
0
                                       uint32_t dict_num = 0) {
264
0
        LOG(FATAL) << "Method insert_many_dict_data is not supported for " << get_name();
265
0
    }
266
267
    virtual void insert_many_binary_data(char* data_array, uint32_t* len_array,
268
0
                                         uint32_t* start_offset_array, size_t num) {
269
0
        LOG(FATAL) << "Method insert_many_binary_data is not supported for " << get_name();
270
0
    }
271
272
    /// Insert binary data into column from a continuous buffer, the implementation maybe copy all binary data
273
    /// in one single time.
274
    virtual void insert_many_continuous_binary_data(const char* data, const uint32_t* offsets,
275
0
                                                    const size_t num) {
276
0
        LOG(FATAL) << "Method insert_many_continuous_binary_data is not supported for "
277
0
                   << get_name();
278
0
    }
279
280
0
    virtual void insert_many_strings(const StringRef* strings, size_t num) {
281
0
        LOG(FATAL) << "Method insert_many_binary_data is not supported for " << get_name();
282
0
    }
283
284
    virtual void insert_many_strings_overflow(const StringRef* strings, size_t num,
285
0
                                              size_t max_length) {
286
0
        LOG(FATAL) << "Method insert_many_strings_overflow is not supported for " << get_name();
287
0
    }
288
289
    // Here `pos` points to the memory data type is the same as the data type of the column.
290
    // This function is used by `insert_keys_into_columns` in AggregationNode.
291
0
    virtual void insert_many_raw_data(const char* pos, size_t num) {
292
0
        LOG(FATAL) << "Method insert_many_raw_data is not supported for " << get_name();
293
0
    }
294
295
0
    void insert_many_data(const char* pos, size_t length, size_t data_num) {
296
0
        for (size_t i = 0; i < data_num; ++i) {
297
0
            insert_data(pos, length);
298
0
        }
299
0
    }
300
301
    /// Appends "default value".
302
    /// Is used when there are need to increase column size, but inserting value doesn't make sense.
303
    /// For example, ColumnNullable(Nested) absolutely ignores values of nested column if it is marked as NULL.
304
    virtual void insert_default() = 0;
305
306
    /// Appends "default value" multiple times.
307
0
    virtual void insert_many_defaults(size_t length) {
308
0
        for (size_t i = 0; i < length; ++i) {
309
0
            insert_default();
310
0
        }
311
0
    }
312
313
    /** Removes last n elements.
314
      * Is used to support exception-safety of several operations.
315
      *  For example, sometimes insertion should be reverted if we catch an exception during operation processing.
316
      * If column has less than n elements or n == 0 - undefined behavior.
317
      */
318
    virtual void pop_back(size_t n) = 0;
319
320
    /** Serializes n-th element. Serialized element should be placed continuously inside Arena's memory.
321
      * Serialized value can be deserialized to reconstruct original object. Is used in aggregation.
322
      * The method is similar to get_data_at(), but can work when element's value cannot be mapped to existing continuous memory chunk,
323
      *  For example, to obtain unambiguous representation of Array of strings, strings data should be interleaved with their sizes.
324
      * Parameter begin should be used with Arena::alloc_continue.
325
      */
326
    virtual StringRef serialize_value_into_arena(size_t n, Arena& arena,
327
                                                 char const*& begin) const = 0;
328
329
    /// Deserializes a value that was serialized using IColumn::serialize_value_into_arena method.
330
    /// Returns pointer to the position after the read data.
331
    virtual const char* deserialize_and_insert_from_arena(const char* pos) = 0;
332
333
    /// Return the size of largest row.
334
    /// This is for calculating the memory size for vectorized serialization of aggregation keys.
335
0
    virtual size_t get_max_row_byte_size() const {
336
0
        LOG(FATAL) << "get_max_row_byte_size not supported";
337
0
        return 0;
338
0
    }
339
340
    virtual void serialize_vec(std::vector<StringRef>& keys, size_t num_rows,
341
0
                               size_t max_row_byte_size) const {
342
0
        LOG(FATAL) << "serialize_vec not supported";
343
0
    }
344
345
    virtual void serialize_vec_with_null_map(std::vector<StringRef>& keys, size_t num_rows,
346
                                             const uint8_t* null_map,
347
0
                                             size_t max_row_byte_size) const {
348
0
        LOG(FATAL) << "serialize_vec_with_null_map not supported";
349
0
    }
350
351
    // This function deserializes group-by keys into column in the vectorized way.
352
0
    virtual void deserialize_vec(std::vector<StringRef>& keys, const size_t num_rows) {
353
0
        LOG(FATAL) << "deserialize_vec not supported";
354
0
    }
355
356
    // Used in ColumnNullable::deserialize_vec
357
    virtual void deserialize_vec_with_null_map(std::vector<StringRef>& keys, const size_t num_rows,
358
0
                                               const uint8_t* null_map) {
359
0
        LOG(FATAL) << "deserialize_vec_with_null_map not supported";
360
0
    }
361
362
    /// TODO: SipHash is slower than city or xx hash, rethink we should have a new interface
363
    /// Update state of hash function with value of n-th element.
364
    /// On subsequent calls of this method for sequence of column values of arbitrary types,
365
    ///  passed bytes to hash must identify sequence of values unambiguously.
366
0
    virtual void update_hash_with_value(size_t n, SipHash& hash) const {
367
0
        LOG(FATAL) << get_name() << " update_hash_with_value siphash not supported";
368
0
    }
369
370
    /// Update state of hash function with value of n elements to avoid the virtual function call
371
    /// null_data to mark whether need to do hash compute, null_data == nullptr
372
    /// means all element need to do hash function, else only *null_data != 0 need to do hash func
373
    /// do xxHash here, faster than other hash method
374
    virtual void update_hashes_with_value(std::vector<SipHash>& hashes,
375
0
                                          const uint8_t* __restrict null_data = nullptr) const {
376
0
        LOG(FATAL) << get_name() << " update_hashes_with_value siphash not supported";
377
0
    }
378
379
    /// Update state of hash function with value of n elements to avoid the virtual function call
380
    /// null_data to mark whether need to do hash compute, null_data == nullptr
381
    /// means all element need to do hash function, else only *null_data != 0 need to do hash func
382
    /// do xxHash here, faster than other sip hash
383
    virtual void update_hashes_with_value(uint64_t* __restrict hashes,
384
0
                                          const uint8_t* __restrict null_data = nullptr) const {
385
0
        LOG(FATAL) << get_name() << " update_hashes_with_value xxhash not supported";
386
0
    }
387
388
    // use range for one hash value to avoid virtual function call in loop
389
    virtual void update_xxHash_with_value(size_t start, size_t end, uint64_t& hash,
390
0
                                          const uint8_t* __restrict null_data) const {
391
0
        LOG(FATAL) << get_name() << " update_hash_with_value xxhash not supported";
392
0
    }
393
394
    /// Update state of crc32 hash function with value of n elements to avoid the virtual function call
395
    /// null_data to mark whether need to do hash compute, null_data == nullptr
396
    /// means all element need to do hash function, else only *null_data != 0 need to do hash func
397
    virtual void update_crcs_with_value(std::vector<uint64_t>& hash, PrimitiveType type,
398
0
                                        const uint8_t* __restrict null_data = nullptr) const {
399
0
        LOG(FATAL) << get_name() << "update_crcs_with_value not supported";
400
0
    }
401
402
    // use range for one hash value to avoid virtual function call in loop
403
    virtual void update_crc_with_value(size_t start, size_t end, uint64_t& hash,
404
0
                                       const uint8_t* __restrict null_data) const {
405
0
        LOG(FATAL) << get_name() << " update_crc_with_value not supported";
406
0
    }
407
408
    /** Removes elements that don't match the filter.
409
      * Is used in WHERE and HAVING operations.
410
      * If result_size_hint > 0, then makes advance reserve(result_size_hint) for the result column;
411
      *  if 0, then don't makes reserve(),
412
      *  otherwise (i.e. < 0), makes reserve() using size of source column.
413
      */
414
    using Filter = PaddedPODArray<UInt8>;
415
    virtual Ptr filter(const Filter& filt, ssize_t result_size_hint) const = 0;
416
417
    /// This function will modify the original table.
418
    /// Return rows number after filtered.
419
    virtual size_t filter(const Filter& filter) = 0;
420
421
    /**
422
     *  used by lazy materialization to filter column by selected rowids
423
     *  Q: Why use IColumn* as args type instead of MutablePtr or ImmutablePtr ?
424
     *  A: If use MutablePtr/ImmutablePtr as col_ptr's type, which means there could be many 
425
     *  convert(convert MutablePtr to ImmutablePtr or convert ImmutablePtr to MutablePtr)
426
     *  happends in filter_by_selector because of mem-reuse logic or ColumnNullable, I think this is meaningless;
427
     *  So using raw ptr directly here.
428
     *  NOTICE: only column_nullable and predict_column, column_dictionary now support filter_by_selector
429
     */
430
0
    virtual Status filter_by_selector(const uint16_t* sel, size_t sel_size, IColumn* col_ptr) {
431
0
        LOG(FATAL) << get_name()
432
0
                   << " do not support filter_by_selector, only column_nullable, column_dictionary "
433
0
                      "and predict_column "
434
0
                      "support";
435
0
        __builtin_unreachable();
436
0
    }
437
438
    /// Permutes elements using specified permutation. Is used in sortings.
439
    /// limit - if it isn't 0, puts only first limit elements in the result.
440
    using Permutation = PaddedPODArray<size_t>;
441
    virtual Ptr permute(const Permutation& perm, size_t limit) const = 0;
442
443
    /// Creates new column with values column[indexes[:limit]]. If limit is 0, all indexes are used.
444
    /// Indexes must be one of the ColumnUInt. For default implementation, see select_index_impl from ColumnsCommon.h
445
0
    virtual Ptr index(const IColumn& indexes, size_t limit) const {
446
0
        LOG(FATAL) << "column not support index";
447
0
        __builtin_unreachable();
448
0
    }
449
450
    /** Compares (*this)[n] and rhs[m]. Column rhs should have the same type.
451
      * Returns negative number, 0, or positive number (*this)[n] is less, equal, greater than rhs[m] respectively.
452
      * Is used in sortings.
453
      *
454
      * If one of element's value is NaN or NULLs, then:
455
      * - if nan_direction_hint == -1, NaN and NULLs are considered as least than everything other;
456
      * - if nan_direction_hint ==  1, NaN and NULLs are considered as greatest than everything other.
457
      * For example, if nan_direction_hint == -1 is used by descending sorting, NaNs will be at the end.
458
      *
459
      * For non Nullable and non floating point types, nan_direction_hint is ignored.
460
      * For array/map/struct types, we compare with nested column element and offsets size
461
      */
462
    virtual int compare_at(size_t n, size_t m, const IColumn& rhs,
463
                           int nan_direction_hint) const = 0;
464
465
    /**
466
     * To compare all rows in this column with another row (with row_id = rhs_row_id in column rhs)
467
     * @param nan_direction_hint and direction indicates the ordering.
468
     * @param cmp_res if we already has a comparison result for row i, e.g. cmp_res[i] = 1, we can skip row i
469
     * @param filter this stores comparison results for all rows. filter[i] = 1 means row i is less than row rhs_row_id in rhs
470
     */
471
    virtual void compare_internal(size_t rhs_row_id, const IColumn& rhs, int nan_direction_hint,
472
                                  int direction, std::vector<uint8>& cmp_res,
473
                                  uint8* __restrict filter) const;
474
475
    /** Returns a permutation that sorts elements of this column,
476
      *  i.e. perm[i]-th element of source column should be i-th element of sorted column.
477
      * reverse - reverse ordering (ascending).
478
      * limit - if isn't 0, then only first limit elements of the result column could be sorted.
479
      * nan_direction_hint - see above.
480
      */
481
    virtual void get_permutation(bool reverse, size_t limit, int nan_direction_hint,
482
                                 Permutation& res) const = 0;
483
484
    /** Copies each element according offsets parameter.
485
      * (i-th element should be copied offsets[i] - offsets[i - 1] times.)
486
      * It is necessary in ARRAY JOIN operation.
487
      */
488
    virtual Ptr replicate(const Offsets& offsets) const = 0;
489
490
    /** Copies each element according offsets parameter.
491
      * (i-th element should be copied counts[i] times.)
492
      * If `begin` and `count_sz` specified, it means elements in range [`begin`, `begin` + `count_sz`) will be replicated.
493
      * If `count_sz` is -1, `begin` must be 0.
494
      */
495
    virtual void replicate(const uint32_t* indexs, size_t target_size, IColumn& column) const = 0;
496
497
    /// Appends one field multiple times. Can be optimized in inherited classes.
498
0
    virtual void insert_many(const Field& field, size_t length) {
499
0
        for (size_t i = 0; i < length; ++i) {
500
0
            insert(field);
501
0
        }
502
0
    }
503
    /// Returns indices of values in column, that not equal to default value of column.
504
    virtual void get_indices_of_non_default_rows(Offsets64& indices, size_t from,
505
0
                                                 size_t limit) const {
506
0
        LOG(FATAL) << "column not support get_indices_of_non_default_rows";
507
0
        __builtin_unreachable();
508
0
    }
509
510
    template <typename Derived>
511
    void get_indices_of_non_default_rows_impl(IColumn::Offsets64& indices, size_t from,
512
                                              size_t limit) const;
513
514
    /// Returns column with @total_size elements.
515
    /// In result column values from current column are at positions from @offsets.
516
    /// Other values are filled by @default_value.
517
    /// @shift means how much rows to skip from the beginning of current column.
518
    /// Used to create full column from sparse.
519
    virtual Ptr create_with_offsets(const Offsets64& offsets, const Field& default_field,
520
                                    size_t total_rows, size_t shift) const;
521
522
    /** Split column to smaller columns. Each value goes to column index, selected by corresponding element of 'selector'.
523
      * Selector must contain values from 0 to num_columns - 1.
524
      * For default implementation, see scatter_impl.
525
      */
526
    using ColumnIndex = UInt64;
527
    using Selector = PaddedPODArray<ColumnIndex>;
528
    virtual std::vector<MutablePtr> scatter(ColumnIndex num_columns,
529
                                            const Selector& selector) const = 0;
530
531
    virtual void append_data_by_selector(MutablePtr& res, const Selector& selector) const = 0;
532
533
    /// Insert data from several other columns according to source mask (used in vertical merge).
534
    /// For now it is a helper to de-virtualize calls to insert*() functions inside gather loop
535
    /// (descendants should call gatherer_stream.gather(*this) to implement this function.)
536
    /// TODO: interface decoupled from ColumnGathererStream that allows non-generic specializations.
537
    //    virtual void gather(ColumnGathererStream & gatherer_stream) = 0;
538
539
    /** Computes minimum and maximum element of the column.
540
      * In addition to numeric types, the function is completely implemented for Date and DateTime.
541
      * For strings and arrays function should return default value.
542
      *  (except for constant columns; they should return value of the constant).
543
      * If column is empty function should return default value.
544
      */
545
    virtual void get_extremes(Field& min, Field& max) const = 0;
546
547
    /// Reserves memory for specified amount of elements. If reservation isn't possible, does nothing.
548
    /// It affects performance only (not correctness).
549
0
    virtual void reserve(size_t /*n*/) {}
550
551
    /// Resize memory for specified amount of elements. If reservation isn't possible, does nothing.
552
    /// It affects performance only (not correctness).
553
0
    virtual void resize(size_t /*n*/) {}
554
555
    /// Size of column data in memory (may be approximate) - for profiling. Zero, if could not be determined.
556
    virtual size_t byte_size() const = 0;
557
558
    /// Size of memory, allocated for column.
559
    /// This is greater or equals to byte_size due to memory reservation in containers.
560
    /// Zero, if could not be determined.
561
    virtual size_t allocated_bytes() const = 0;
562
563
    /// Make memory region readonly with mprotect if it is large enough.
564
    /// The operation is slow and performed only for debug builds.
565
0
    virtual void protect() {}
566
567
    /// If the column contains subcolumns (such as Array, Nullable, etc), do callback on them.
568
    /// Shallow: doesn't do recursive calls; don't do call for itself.
569
    using ColumnCallback = std::function<void(WrappedPtr&)>;
570
24.8k
    virtual void for_each_subcolumn(ColumnCallback) {}
571
572
    /// Columns have equal structure.
573
    /// If true - you can use "compare_at", "insert_from", etc. methods.
574
0
    virtual bool structure_equals(const IColumn&) const {
575
0
        LOG(FATAL) << "Method structure_equals is not supported for " << get_name();
576
0
        return false;
577
0
    }
578
579
26.2k
    MutablePtr mutate() const&& {
580
26.2k
        MutablePtr res = shallow_mutate();
581
26.2k
        res->for_each_subcolumn(
582
26.2k
                [](WrappedPtr& subcolumn) { subcolumn = std::move(*subcolumn).mutate(); });
583
26.2k
        return res;
584
26.2k
    }
585
586
0
    static MutablePtr mutate(Ptr ptr) {
587
0
        MutablePtr res = ptr->shallow_mutate(); /// Now use_count is 2.
588
0
        ptr.reset();                            /// Reset use_count to 1.
589
0
        res->for_each_subcolumn(
590
0
                [](WrappedPtr& subcolumn) { subcolumn = std::move(*subcolumn).mutate(); });
591
0
        return res;
592
0
    }
593
594
    /** Some columns can contain another columns inside.
595
      * So, we have a tree of columns. But not all combinations are possible.
596
      * There are the following rules:
597
      *
598
      * ColumnConst may be only at top. It cannot be inside any column.
599
      * ColumnNullable can contain only simple columns.
600
      */
601
602
    /// Various properties on behaviour of column type.
603
604
    /// True if column contains something nullable inside. It's true for ColumnNullable, can be true or false for ColumnConst, etc.
605
17.1k
    virtual bool is_nullable() const { return false; }
606
607
0
    virtual bool is_bitmap() const { return false; }
608
609
0
    virtual bool is_hll() const { return false; }
610
611
0
    virtual bool is_quantile_state() const { return false; }
612
613
    // true if column has null element
614
0
    virtual bool has_null() const { return false; }
615
616
    // true if column has null element [0,size)
617
411
    virtual bool has_null(size_t size) const { return false; }
618
619
    /// It's a special kind of column, that contain single value, but is not a ColumnConst.
620
41
    virtual bool is_dummy() const { return false; }
621
622
21
    virtual bool is_exclusive() const { return use_count() == 1; }
623
624
    /// Clear data of column, just like vector clear
625
0
    virtual void clear() {}
626
627
    /** Memory layout properties.
628
      *
629
      * Each value of a column can be placed in memory contiguously or not.
630
      *
631
      * Example: simple columns like UInt64 or FixedString store their values contiguously in single memory buffer.
632
      *
633
      * Example: Tuple store values of each component in separate subcolumn, so the values of Tuples with at least two components are not contiguous.
634
      * Another example is Nullable. Each value have null flag, that is stored separately, so the value is not contiguous in memory.
635
      *
636
      * There are some important cases, when values are not stored contiguously, but for each value, you can get contiguous memory segment,
637
      *  that will unambiguously identify the value. In this case, methods get_data_at and insert_data are implemented.
638
      * Example: String column: bytes of strings are stored concatenated in one memory buffer
639
      *  and offsets to that buffer are stored in another buffer. The same is for Array of fixed-size contiguous elements.
640
      *
641
      * To avoid confusion between these cases, we don't have isContiguous method.
642
      */
643
644
    /// Values in column have fixed size (including the case when values span many memory segments).
645
0
    virtual bool values_have_fixed_size() const { return is_fixed_and_contiguous(); }
646
647
    /// Values in column are represented as continuous memory segment of fixed size. Implies values_have_fixed_size.
648
0
    virtual bool is_fixed_and_contiguous() const { return false; }
649
650
    /// If is_fixed_and_contiguous, returns the underlying data array, otherwise throws an exception.
651
0
    virtual StringRef get_raw_data() const {
652
0
        LOG(FATAL) << fmt::format("Column {} is not a contiguous block of memory", get_name());
653
0
        return StringRef {};
654
0
    }
655
656
    /// If values_have_fixed_size, returns size of value, otherwise throw an exception.
657
0
    virtual size_t size_of_value_if_fixed() const {
658
0
        LOG(FATAL) << fmt::format("Values of column {} are not fixed size.", get_name());
659
0
        return 0;
660
0
    }
661
662
    /// Column is ColumnVector of numbers or ColumnConst of it. Note that Nullable columns are not numeric.
663
    /// Implies is_fixed_and_contiguous.
664
0
    virtual bool is_numeric() const { return false; }
665
666
    // Column is ColumnString/ColumnArray/ColumnMap or other variable length column at every row
667
3
    virtual bool is_variable_length() const { return false; }
668
669
3
    virtual bool is_column_string() const { return false; }
670
671
0
    virtual bool is_column_decimal() const { return false; }
672
673
0
    virtual bool is_predicate_column() const { return false; }
674
675
1.68k
    virtual bool is_column_dictionary() const { return false; }
676
677
0
    virtual bool is_column_array() const { return false; }
678
679
8
    virtual bool is_column_map() const { return false; }
680
681
0
    virtual bool is_column_struct() const { return false; }
682
683
    /// If the only value column can contain is NULL.
684
42
    virtual bool only_null() const { return false; }
685
686
    /// Can be inside ColumnNullable.
687
0
    virtual bool can_be_inside_nullable() const { return false; }
688
689
0
    virtual bool low_cardinality() const { return false; }
690
691
    virtual void sort_column(const ColumnSorter* sorter, EqualFlags& flags,
692
                             IColumn::Permutation& perms, EqualRange& range,
693
                             bool last_column) const;
694
695
36.6k
    virtual ~IColumn() = default;
696
36.6k
    IColumn() = default;
697
4
    IColumn(const IColumn&) = default;
698
699
    /** Print column name, size, and recursively print all subcolumns.
700
      */
701
    String dump_structure() const;
702
703
    // only used in agg value replace for column which is not variable length
704
0
    virtual void replace_column_data(const IColumn&, size_t row, size_t self_row = 0) {
705
0
        throw doris::Exception(ErrorCode::NOT_IMPLEMENTED_ERROR,
706
0
                               "Method replace_column_data is not supported for " + get_name());
707
0
    }
708
709
    // only used in ColumnNullable replace_column_data
710
0
    virtual void replace_column_data_default(size_t self_row = 0) {
711
0
        throw doris::Exception(
712
0
                ErrorCode::NOT_IMPLEMENTED_ERROR,
713
0
                "Method replace_column_data_default is not supported for " + get_name());
714
0
    }
715
716
0
    virtual void replace_column_null_data(const uint8_t* __restrict null_map) {}
717
718
500k
    virtual bool is_date_type() const { return is_date; }
719
500k
    virtual bool is_datetime_type() const { return is_date_time; }
720
28
    virtual bool is_decimalv2_type() const { return is_decimalv2; }
721
722
144
    virtual void set_date_type() { is_date = true; }
723
269
    virtual void set_datetime_type() { is_date_time = true; }
724
198
    virtual void set_decimalv2_type() { is_decimalv2 = true; }
725
726
15
    void copy_date_types(const IColumn& col) {
727
15
        if (col.is_date_type()) {
728
1
            set_date_type();
729
1
        }
730
15
        if (col.is_datetime_type()) {
731
2
            set_datetime_type();
732
2
        }
733
15
    }
734
735
    // todo(wb): a temporary implemention, need re-abstract here
736
    bool is_date = false;
737
    bool is_date_time = false;
738
    bool is_decimalv2 = false;
739
740
protected:
741
    /// Template is to devirtualize calls to insert_from method.
742
    /// In derived classes (that use final keyword), implement scatter method as call to scatter_impl.
743
    template <typename Derived>
744
    std::vector<MutablePtr> scatter_impl(ColumnIndex num_columns, const Selector& selector) const;
745
746
    template <typename Derived>
747
    void append_data_by_selector_impl(MutablePtr& res, const Selector& selector) const;
748
};
749
750
using ColumnPtr = IColumn::Ptr;
751
using MutableColumnPtr = IColumn::MutablePtr;
752
using Columns = std::vector<ColumnPtr>;
753
using MutableColumns = std::vector<MutableColumnPtr>;
754
755
using ColumnRawPtrs = std::vector<const IColumn*>;
756
757
template <typename... Args>
758
struct IsMutableColumns;
759
760
template <typename Arg, typename... Args>
761
struct IsMutableColumns<Arg, Args...> {
762
    static const bool value =
763
            std::is_assignable<MutableColumnPtr&&, Arg>::value && IsMutableColumns<Args...>::value;
764
};
765
766
template <>
767
struct IsMutableColumns<> {
768
    static const bool value = true;
769
};
770
771
template <typename Type>
772
3.77k
const Type* check_and_get_column(const IColumn& column) {
773
3.77k
    return typeid_cast<const Type*>(&column);
774
3.77k
}
_ZN5doris10vectorized20check_and_get_columnINS0_11ColumnArrayEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
22
const Type* check_and_get_column(const IColumn& column) {
773
22
    return typeid_cast<const Type*>(&column);
774
22
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIhEEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
43
const Type* check_and_get_column(const IColumn& column) {
773
43
    return typeid_cast<const Type*>(&column);
774
43
}
_ZN5doris10vectorized20check_and_get_columnINS0_14ColumnNullableEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
2.52k
const Type* check_and_get_column(const IColumn& column) {
773
2.52k
    return typeid_cast<const Type*>(&column);
774
2.52k
}
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE5EEEEEPKT_RKNS0_7IColumnE
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIaEEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
35
const Type* check_and_get_column(const IColumn& column) {
773
35
    return typeid_cast<const Type*>(&column);
774
35
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIsEEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
30
const Type* check_and_get_column(const IColumn& column) {
773
30
    return typeid_cast<const Type*>(&column);
774
30
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIiEEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
77
const Type* check_and_get_column(const IColumn& column) {
773
77
    return typeid_cast<const Type*>(&column);
774
77
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIlEEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
38
const Type* check_and_get_column(const IColumn& column) {
773
38
    return typeid_cast<const Type*>(&column);
774
38
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorInEEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
15
const Type* check_and_get_column(const IColumn& column) {
773
15
    return typeid_cast<const Type*>(&column);
774
15
}
_ZN5doris10vectorized20check_and_get_columnINS0_13ColumnDecimalINS0_7DecimalInEEEEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
10
const Type* check_and_get_column(const IColumn& column) {
773
10
    return typeid_cast<const Type*>(&column);
774
10
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIfEEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
10
const Type* check_and_get_column(const IColumn& column) {
773
10
    return typeid_cast<const Type*>(&column);
774
10
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIdEEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
5
const Type* check_and_get_column(const IColumn& column) {
773
5
    return typeid_cast<const Type*>(&column);
774
5
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIjEEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
17
const Type* check_and_get_column(const IColumn& column) {
773
17
    return typeid_cast<const Type*>(&column);
774
17
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorImEEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
15
const Type* check_and_get_column(const IColumn& column) {
773
15
    return typeid_cast<const Type*>(&column);
774
15
}
_ZN5doris10vectorized20check_and_get_columnIKNS0_14ColumnNullableEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
30
const Type* check_and_get_column(const IColumn& column) {
773
30
    return typeid_cast<const Type*>(&column);
774
30
}
_ZN5doris10vectorized20check_and_get_columnINS0_11ColumnConstEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
849
const Type* check_and_get_column(const IColumn& column) {
773
849
    return typeid_cast<const Type*>(&column);
774
849
}
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_13ColumnDecimalINS0_7DecimalIiEEEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_13ColumnDecimalINS0_7DecimalIlEEEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_13ColumnDecimalINS0_7DecimalINS0_7Int128IEEEEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnIKNS0_11ColumnConstEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE3EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE4EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE6EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE7EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE8EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE9EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE20EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE28EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE29EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE30EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_16ColumnDictionaryIiEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE15EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE23EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE11EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE25EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE12EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE26EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE2EEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_9ColumnMapEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_12ColumnStructEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_12ColumnObjectEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorItEEEEPKT_RKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorINS0_7UInt128EEEEEPKT_RKNS0_7IColumnE
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnStringEEEPKT_RKNS0_7IColumnE
Line
Count
Source
772
60
const Type* check_and_get_column(const IColumn& column) {
773
60
    return typeid_cast<const Type*>(&column);
774
60
}
775
776
template <typename Type>
777
20.2k
const Type* check_and_get_column(const IColumn* column) {
778
20.2k
    return typeid_cast<const Type*>(column);
779
20.2k
}
_ZN5doris10vectorized20check_and_get_columnINS0_14ColumnNullableEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
502
const Type* check_and_get_column(const IColumn* column) {
778
502
    return typeid_cast<const Type*>(column);
779
502
}
_ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE5EEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
1.57k
const Type* check_and_get_column(const IColumn* column) {
778
1.57k
    return typeid_cast<const Type*>(column);
779
1.57k
}
_ZN5doris10vectorized20check_and_get_columnINS0_11ColumnArrayEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
35
const Type* check_and_get_column(const IColumn* column) {
778
35
    return typeid_cast<const Type*>(column);
779
35
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnStringEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
264
const Type* check_and_get_column(const IColumn* column) {
778
264
    return typeid_cast<const Type*>(column);
779
264
}
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE3EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE4EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE6EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE7EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE8EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE9EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE20EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE28EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE29EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE30EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_16ColumnDictionaryIiEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE15EEEEEPKT_PKNS0_7IColumnE
_ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE23EEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
20
const Type* check_and_get_column(const IColumn* column) {
778
20
    return typeid_cast<const Type*>(column);
779
20
}
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE11EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE25EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE12EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE26EEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_19PredicateColumnTypeILNS_13PrimitiveTypeE2EEEEEPKT_PKNS0_7IColumnE
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIlEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
95
const Type* check_and_get_column(const IColumn* column) {
778
95
    return typeid_cast<const Type*>(column);
779
95
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorImEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
81
const Type* check_and_get_column(const IColumn* column) {
778
81
    return typeid_cast<const Type*>(column);
779
81
}
_ZN5doris10vectorized20check_and_get_columnINS0_11ColumnConstEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
17.0k
const Type* check_and_get_column(const IColumn* column) {
778
17.0k
    return typeid_cast<const Type*>(column);
779
17.0k
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIhEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
89
const Type* check_and_get_column(const IColumn* column) {
778
89
    return typeid_cast<const Type*>(column);
779
89
}
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_9ColumnMapEEEPKT_PKNS0_7IColumnE
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIaEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
89
const Type* check_and_get_column(const IColumn* column) {
778
89
    return typeid_cast<const Type*>(column);
779
89
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIsEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
82
const Type* check_and_get_column(const IColumn* column) {
778
82
    return typeid_cast<const Type*>(column);
779
82
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIiEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
98
const Type* check_and_get_column(const IColumn* column) {
778
98
    return typeid_cast<const Type*>(column);
779
98
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorInEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
22
const Type* check_and_get_column(const IColumn* column) {
778
22
    return typeid_cast<const Type*>(column);
779
22
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIfEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
16
const Type* check_and_get_column(const IColumn* column) {
778
16
    return typeid_cast<const Type*>(column);
779
16
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIdEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
42
const Type* check_and_get_column(const IColumn* column) {
778
42
    return typeid_cast<const Type*>(column);
779
42
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorIjEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
80
const Type* check_and_get_column(const IColumn* column) {
778
80
    return typeid_cast<const Type*>(column);
779
80
}
_ZN5doris10vectorized20check_and_get_columnINS0_13ColumnDecimalINS0_7DecimalIiEEEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
2
const Type* check_and_get_column(const IColumn* column) {
778
2
    return typeid_cast<const Type*>(column);
779
2
}
_ZN5doris10vectorized20check_and_get_columnINS0_13ColumnDecimalINS0_7DecimalIlEEEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
2
const Type* check_and_get_column(const IColumn* column) {
778
2
    return typeid_cast<const Type*>(column);
779
2
}
_ZN5doris10vectorized20check_and_get_columnINS0_13ColumnDecimalINS0_7DecimalINS0_7Int128IEEEEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
2
const Type* check_and_get_column(const IColumn* column) {
778
2
    return typeid_cast<const Type*>(column);
779
2
}
_ZN5doris10vectorized20check_and_get_columnINS0_13ColumnDecimalINS0_7DecimalInEEEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
2
const Type* check_and_get_column(const IColumn* column) {
778
2
    return typeid_cast<const Type*>(column);
779
2
}
_ZN5doris10vectorized20check_and_get_columnIKNS0_11ColumnArrayEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
70
const Type* check_and_get_column(const IColumn* column) {
778
70
    return typeid_cast<const Type*>(column);
779
70
}
_ZN5doris10vectorized20check_and_get_columnIKNS0_14ColumnNullableEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
28
const Type* check_and_get_column(const IColumn* column) {
778
28
    return typeid_cast<const Type*>(column);
779
28
}
_ZN5doris10vectorized20check_and_get_columnINS0_12ColumnVectorItEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
39
const Type* check_and_get_column(const IColumn* column) {
778
39
    return typeid_cast<const Type*>(column);
779
39
}
_ZN5doris10vectorized20check_and_get_columnINS0_17ColumnComplexTypeINS_11BitmapValueEEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
8
const Type* check_and_get_column(const IColumn* column) {
778
8
    return typeid_cast<const Type*>(column);
779
8
}
_ZN5doris10vectorized20check_and_get_columnIKNS0_12ColumnVectorIhEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
4
const Type* check_and_get_column(const IColumn* column) {
778
4
    return typeid_cast<const Type*>(column);
779
4
}
_ZN5doris10vectorized20check_and_get_columnIKNS0_12ColumnVectorIaEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
2
const Type* check_and_get_column(const IColumn* column) {
778
2
    return typeid_cast<const Type*>(column);
779
2
}
_ZN5doris10vectorized20check_and_get_columnIKNS0_12ColumnVectorIsEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
2
const Type* check_and_get_column(const IColumn* column) {
778
2
    return typeid_cast<const Type*>(column);
779
2
}
_ZN5doris10vectorized20check_and_get_columnIKNS0_12ColumnVectorIiEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
2
const Type* check_and_get_column(const IColumn* column) {
778
2
    return typeid_cast<const Type*>(column);
779
2
}
_ZN5doris10vectorized20check_and_get_columnIKNS0_12ColumnVectorIlEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
2
const Type* check_and_get_column(const IColumn* column) {
778
2
    return typeid_cast<const Type*>(column);
779
2
}
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnIKNS0_12ColumnVectorInEEEEPKT_PKNS0_7IColumnE
_ZN5doris10vectorized20check_and_get_columnIKNS0_12ColumnVectorIdEEEEPKT_PKNS0_7IColumnE
Line
Count
Source
777
2
const Type* check_and_get_column(const IColumn* column) {
778
2
    return typeid_cast<const Type*>(column);
779
2
}
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_12ColumnStructEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnINS0_17ColumnComplexTypeINS_11HyperLogLogEEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnIKNS0_12ColumnVectorIfEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnIKNS0_12ColumnVectorIjEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnIKNS0_12ColumnVectorImEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnIKNS0_17ColumnComplexTypeINS_11BitmapValueEEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnIKNS0_17ColumnComplexTypeINS_11HyperLogLogEEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnIKNS0_12ColumnStringEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnIKNS0_13ColumnDecimalINS0_7DecimalInEEEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnIKNS0_13ColumnDecimalINS0_7DecimalIiEEEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnIKNS0_13ColumnDecimalINS0_7DecimalIlEEEEEEPKT_PKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized20check_and_get_columnIKNS0_13ColumnDecimalINS0_7DecimalINS0_7Int128IEEEEEEEPKT_PKNS0_7IColumnE
780
781
template <typename Type>
782
17.4k
bool check_column(const IColumn& column) {
783
17.4k
    return check_and_get_column<Type>(&column);
784
17.4k
}
_ZN5doris10vectorized12check_columnINS0_14ColumnNullableEEEbRKNS0_7IColumnE
Line
Count
Source
782
326
bool check_column(const IColumn& column) {
783
326
    return check_and_get_column<Type>(&column);
784
326
}
_ZN5doris10vectorized12check_columnINS0_11ColumnConstEEEbRKNS0_7IColumnE
Line
Count
Source
782
17.0k
bool check_column(const IColumn& column) {
783
17.0k
    return check_and_get_column<Type>(&column);
784
17.0k
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorIhEEEEbRKNS0_7IColumnE
Line
Count
Source
782
15
bool check_column(const IColumn& column) {
783
15
    return check_and_get_column<Type>(&column);
784
15
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorIaEEEEbRKNS0_7IColumnE
Line
Count
Source
782
15
bool check_column(const IColumn& column) {
783
15
    return check_and_get_column<Type>(&column);
784
15
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorIsEEEEbRKNS0_7IColumnE
Line
Count
Source
782
13
bool check_column(const IColumn& column) {
783
13
    return check_and_get_column<Type>(&column);
784
13
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorIiEEEEbRKNS0_7IColumnE
Line
Count
Source
782
13
bool check_column(const IColumn& column) {
783
13
    return check_and_get_column<Type>(&column);
784
13
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorIlEEEEbRKNS0_7IColumnE
Line
Count
Source
782
11
bool check_column(const IColumn& column) {
783
11
    return check_and_get_column<Type>(&column);
784
11
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorInEEEEbRKNS0_7IColumnE
Line
Count
Source
782
5
bool check_column(const IColumn& column) {
783
5
    return check_and_get_column<Type>(&column);
784
5
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorIfEEEEbRKNS0_7IColumnE
Line
Count
Source
782
4
bool check_column(const IColumn& column) {
783
4
    return check_and_get_column<Type>(&column);
784
4
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorIdEEEEbRKNS0_7IColumnE
Line
Count
Source
782
3
bool check_column(const IColumn& column) {
783
3
    return check_and_get_column<Type>(&column);
784
3
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorIjEEEEbRKNS0_7IColumnE
Line
Count
Source
782
2
bool check_column(const IColumn& column) {
783
2
    return check_and_get_column<Type>(&column);
784
2
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorImEEEEbRKNS0_7IColumnE
Line
Count
Source
782
2
bool check_column(const IColumn& column) {
783
2
    return check_and_get_column<Type>(&column);
784
2
}
_ZN5doris10vectorized12check_columnINS0_13ColumnDecimalINS0_7DecimalIiEEEEEEbRKNS0_7IColumnE
Line
Count
Source
782
2
bool check_column(const IColumn& column) {
783
2
    return check_and_get_column<Type>(&column);
784
2
}
_ZN5doris10vectorized12check_columnINS0_13ColumnDecimalINS0_7DecimalIlEEEEEEbRKNS0_7IColumnE
Line
Count
Source
782
2
bool check_column(const IColumn& column) {
783
2
    return check_and_get_column<Type>(&column);
784
2
}
_ZN5doris10vectorized12check_columnINS0_13ColumnDecimalINS0_7DecimalINS0_7Int128IEEEEEEEbRKNS0_7IColumnE
Line
Count
Source
782
2
bool check_column(const IColumn& column) {
783
2
    return check_and_get_column<Type>(&column);
784
2
}
_ZN5doris10vectorized12check_columnINS0_13ColumnDecimalINS0_7DecimalInEEEEEEbRKNS0_7IColumnE
Line
Count
Source
782
2
bool check_column(const IColumn& column) {
783
2
    return check_and_get_column<Type>(&column);
784
2
}
Unexecuted instantiation: _ZN5doris10vectorized12check_columnINS0_12ColumnStringEEEbRKNS0_7IColumnE
785
786
template <typename Type>
787
50
bool check_column(const IColumn* column) {
788
50
    return check_and_get_column<Type>(column);
789
50
}
_ZN5doris10vectorized12check_columnINS0_11ColumnArrayEEEbPKNS0_7IColumnE
Line
Count
Source
787
15
bool check_column(const IColumn* column) {
788
15
    return check_and_get_column<Type>(column);
789
15
}
Unexecuted instantiation: _ZN5doris10vectorized12check_columnINS0_9ColumnMapEEEbPKNS0_7IColumnE
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorItEEEEbPKNS0_7IColumnE
Line
Count
Source
787
5
bool check_column(const IColumn* column) {
788
5
    return check_and_get_column<Type>(column);
789
5
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorIjEEEEbPKNS0_7IColumnE
Line
Count
Source
787
5
bool check_column(const IColumn* column) {
788
5
    return check_and_get_column<Type>(column);
789
5
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorImEEEEbPKNS0_7IColumnE
Line
Count
Source
787
5
bool check_column(const IColumn* column) {
788
5
    return check_and_get_column<Type>(column);
789
5
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorIaEEEEbPKNS0_7IColumnE
Line
Count
Source
787
5
bool check_column(const IColumn* column) {
788
5
    return check_and_get_column<Type>(column);
789
5
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorIsEEEEbPKNS0_7IColumnE
Line
Count
Source
787
5
bool check_column(const IColumn* column) {
788
5
    return check_and_get_column<Type>(column);
789
5
}
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorIiEEEEbPKNS0_7IColumnE
Line
Count
Source
787
5
bool check_column(const IColumn* column) {
788
5
    return check_and_get_column<Type>(column);
789
5
}
Unexecuted instantiation: _ZN5doris10vectorized12check_columnINS0_12ColumnVectorIlEEEEbPKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized12check_columnINS0_12ColumnVectorInEEEEbPKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized12check_columnINS0_12ColumnVectorIfEEEEbPKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized12check_columnINS0_12ColumnVectorIdEEEEbPKNS0_7IColumnE
_ZN5doris10vectorized12check_columnINS0_12ColumnVectorIhEEEEbPKNS0_7IColumnE
Line
Count
Source
787
5
bool check_column(const IColumn* column) {
788
5
    return check_and_get_column<Type>(column);
789
5
}
Unexecuted instantiation: _ZN5doris10vectorized12check_columnINS0_13ColumnDecimalINS0_7DecimalIiEEEEEEbPKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized12check_columnINS0_13ColumnDecimalINS0_7DecimalIlEEEEEEbPKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized12check_columnINS0_13ColumnDecimalINS0_7DecimalInEEEEEEbPKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized12check_columnINS0_13ColumnDecimalINS0_7DecimalINS0_7Int128IEEEEEEEbPKNS0_7IColumnE
Unexecuted instantiation: _ZN5doris10vectorized12check_columnINS0_12ColumnStringEEEbPKNS0_7IColumnE
790
791
/// True if column's an ColumnConst instance. It's just a syntax sugar for type check.
792
bool is_column_const(const IColumn& column);
793
794
/// True if column's an ColumnNullable instance. It's just a syntax sugar for type check.
795
bool is_column_nullable(const IColumn& column);
796
} // namespace doris::vectorized
797
798
// Wrap `ColumnPtr` because `ColumnPtr` can't be used in forward declaration.
799
namespace doris {
800
struct ColumnPtrWrapper {
801
    vectorized::ColumnPtr column_ptr;
802
803
208
    ColumnPtrWrapper(vectorized::ColumnPtr col) : column_ptr(col) {}
804
};
805
} // namespace doris