aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Functions/GatherUtils/Slices.h
blob: 186692ebcb22ff95bf49db3206c92ef8c351e63a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once

#include <Columns/IColumn.h>

namespace DB::GatherUtils
{

template <typename T>
struct NumericArraySlice
{
    const T * data;
    size_t size;
};

struct GenericArraySlice
{
    const IColumn * elements;
    size_t begin;
    size_t size;
};

template <typename Slice>
struct NullableSlice : public Slice
{
    const UInt8 * null_map = nullptr;

    NullableSlice() = default;
    NullableSlice(const Slice & base) : Slice(base) {} /// NOLINT
};

template <typename T>
struct NumericValueSlice
{
    T value;
    static constexpr size_t size = 1;
};

struct GenericValueSlice
{
    const IColumn * elements;
    size_t position;
    static constexpr size_t size = 1;
};

}