2018-01-10 15:45:05 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Columns/ColumnArray.h>
|
2019-06-21 15:31:37 +00:00
|
|
|
#include "ArraySourceVisitor.h"
|
2018-01-10 15:45:05 +00:00
|
|
|
|
2018-11-22 21:19:58 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
namespace ErrorCodes
|
|
|
|
{
|
|
|
|
extern const int NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace GatherUtils
|
2018-01-10 15:45:05 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
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; }
|
2018-01-17 19:22:09 +00:00
|
|
|
|
|
|
|
virtual void accept(ArraySourceVisitor &)
|
|
|
|
{
|
2018-11-22 21:19:58 +00:00
|
|
|
throw Exception("Accept not implemented for " + demangle(typeid(*this).name()), ErrorCodes::NOT_IMPLEMENTED);
|
2018-01-17 19:22:09 +00:00
|
|
|
}
|
2018-01-10 15:45:05 +00:00
|
|
|
};
|
|
|
|
|
2018-01-17 19:22:09 +00:00
|
|
|
template <typename Derived>
|
|
|
|
class ArraySourceImpl : public Visitable<Derived, IArraySource, ArraySourceVisitor> {};
|
|
|
|
|
2018-01-10 15:45:05 +00:00
|
|
|
}
|
2018-11-22 21:19:58 +00:00
|
|
|
|
|
|
|
}
|