mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 05:32:52 +00:00
36 lines
892 B
C++
36 lines
892 B
C++
#pragma once
|
|
|
|
#include <Columns/IColumnDummy.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class Set;
|
|
using ConstSetPtr = std::shared_ptr<const Set>;
|
|
|
|
|
|
/** A column containing multiple values in the `IN` section.
|
|
* Behaves like a constant-column (because the set is one, not its own for each line).
|
|
* This column has a nonstandard value, so it can not be obtained via a normal interface.
|
|
*/
|
|
class ColumnSet final : public COWPtrHelper<IColumnDummy, ColumnSet>
|
|
{
|
|
private:
|
|
friend class COWPtrHelper<IColumnDummy, ColumnSet>;
|
|
|
|
ColumnSet(size_t s_, const ConstSetPtr & data_) : data(data_) { s = s_; }
|
|
ColumnSet(const ColumnSet &) = default;
|
|
|
|
public:
|
|
const char * getFamilyName() const override { return "Set"; }
|
|
MutableColumnPtr cloneDummy(size_t s_) const override { return ColumnSet::create(s_, data); }
|
|
|
|
ConstSetPtr getData() const { return data; }
|
|
|
|
private:
|
|
ConstSetPtr data;
|
|
};
|
|
|
|
}
|