ClickHouse/dbms/Functions/GatherUtils/IArraySource.h
Ivan 97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

39 lines
825 B
C++

#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);
}
};
template <typename Derived>
class ArraySourceImpl : public Visitable<Derived, IArraySource, ArraySourceVisitor> {};
}
}