1 | #pragma once |
---|---|
2 | |
3 | #include <Columns/ColumnArray.h> |
4 | #include "ArraySourceVisitor.h" |
5 | |
6 | namespace DB |
7 | { |
8 | |
9 | namespace ErrorCodes |
10 | { |
11 | extern const int NOT_IMPLEMENTED; |
12 | } |
13 | |
14 | namespace GatherUtils |
15 | { |
16 | |
17 | struct IArraySource |
18 | { |
19 | virtual ~IArraySource() = default; |
20 | |
21 | virtual size_t getSizeForReserve() const = 0; |
22 | virtual const typename ColumnArray::Offsets & getOffsets() const = 0; |
23 | virtual size_t getColumnSize() const = 0; |
24 | virtual bool isConst() const { return false; } |
25 | virtual bool isNullable() const { return false; } |
26 | |
27 | virtual void accept(ArraySourceVisitor &) |
28 | { |
29 | throw Exception("Accept not implemented for "+ demangle(typeid(*this).name()), ErrorCodes::NOT_IMPLEMENTED); |
30 | } |
31 | }; |
32 | |
33 | template <typename Derived> |
34 | class ArraySourceImpl : public Visitable<Derived, IArraySource, ArraySourceVisitor> {}; |
35 | |
36 | } |
37 | |
38 | } |
39 |