ClickHouse/src/DataTypes/DataTypeNested.h

34 lines
619 B
C++
Raw Normal View History

2020-11-05 13:24:31 +00:00
#pragma once
2021-03-09 14:10:28 +00:00
#include <DataTypes/IDataType.h>
2020-11-05 13:24:31 +00:00
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;
};
2020-11-10 17:32:00 +00:00
DataTypePtr createNested(const DataTypes & types, const Names & names);
2020-11-05 13:24:31 +00:00
template <typename DataType>
inline bool isNested(const DataType & data_type)
{
2020-11-10 17:32:00 +00:00
return typeid_cast<const DataTypeNestedCustomName *>(data_type->getCustomName()) != nullptr;
2020-11-05 13:24:31 +00:00
}
}