ClickHouse/src/DataTypes/DataTypeNested.h
2020-11-21 20:27:42 +03:00

35 lines
679 B
C++

#pragma once
#include <DataTypes/DataTypeWithSimpleSerialization.h>
#include <DataTypes/DataTypeCustom.h>
namespace DB
{
class DataTypeNestedCustomName final : public IDataTypeCustomName
{
private:
DataTypes elems;
Strings names;
public:
DataTypeNestedCustomName(const DataTypes & elems_, const Strings & names_)
: elems(elems_), names(names_)
{
}
String getName() const override;
};
DataTypePtr createNested(const DataTypes & types, const Names & names);
template <typename DataType>
inline bool isNested(const DataType & data_type)
{
return typeid_cast<const DataTypeNestedCustomName *>(data_type->getCustomName()) != nullptr;
}
}