blob: 1a5e7f429a560c7f82bd77ebbc872db54b4e928d (
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
47
48
49
50
51
52
53
54
55
|
#pragma once
#include "numeric.h"
namespace NClickHouse {
/**
* Represents column of Array(T).
*/
class TColumnArray: public TColumn {
public:
static TIntrusivePtr<TColumnArray> Create(TColumnRef data);
static TIntrusivePtr<TColumnArray> Create(TColumnRef data, TVector<ui64>&& offsets);
/// Converts input column to array and appends
/// as one row to the current column.
void AppendAsColumn(TColumnRef array);
/// Convets array at pos n to column.
/// Type of element of result column same as type of array element.
TColumnRef GetAsColumn(size_t n) const;
public:
/// Appends content of given column to the end of current one.
void Append(TColumnRef) override;
/// Loads column data from input stream.
bool Load(TCodedInputStream* input, size_t rows) override;
/// Saves column data to output stream.
void Save(TCodedOutputStream* output) override;
/// Returns count of rows in the column.
size_t Size() const override;
/// Makes slice of the current column.
TColumnRef Slice(size_t, size_t) override {
return TColumnRef();
}
private:
TColumnArray(TColumnRef data);
TColumnArray(TColumnRef data, TVector<ui64>&& offsets);
size_t GetOffset(size_t n) const;
size_t GetSize(size_t n) const;
private:
TColumnRef Data_;
TIntrusivePtr<TColumnUInt64> Offsets_;
};
}
|