forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIArraySource.h
41 lines (30 loc) · 889 Bytes
/
IArraySource.h
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
#pragma once
#include <Columns/ColumnArray.h>
#include "ArraySourceVisitor.h"
namespace DB
{
namespace ErrorCodes
{
extern const int NOT_IMPLEMENTED;
}
namespace GatherUtils
{
struct IArraySource
{
virtual ~IArraySource() = default;
virtual size_t getSizeForReserve() const = 0;
virtual const typename ColumnArray::Offsets & getOffsets() const = 0;
virtual size_t getColumnSize() const = 0;
virtual bool isConst() const { return false; }
virtual bool isNullable() const { return false; }
virtual void accept(ArraySourceVisitor &)
{
throw Exception("Accept not implemented for " + demangle(typeid(*this).name()), ErrorCodes::NOT_IMPLEMENTED);
}
};
#pragma GCC visibility push(hidden)
template <typename Derived>
class ArraySourceImpl : public Visitable<Derived, IArraySource, ArraySourceVisitor> {};
#pragma GCC visibility pop
}
}