mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 21:42:39 +00:00
30 lines
759 B
C++
30 lines
759 B
C++
#pragma once
|
|
|
|
#include <DataTypes/DataTypeNumberBase.h>
|
|
#include <base/DateLUT.h>
|
|
|
|
namespace DB
|
|
{
|
|
class DataTypeDate32 final : public DataTypeNumberBase<Int32>
|
|
{
|
|
public:
|
|
static constexpr auto family_name = "Date32";
|
|
|
|
TypeIndex getTypeId() const override { return TypeIndex::Date32; }
|
|
const char * getFamilyName() const override { return family_name; }
|
|
|
|
Field getDefault() const override
|
|
{
|
|
return -static_cast<Int64>(DateLUT::instance().getDayNumOffsetEpoch());
|
|
}
|
|
|
|
bool canBeUsedAsVersion() const override { return true; }
|
|
bool canBeInsideNullable() const override { return true; }
|
|
|
|
bool equals(const IDataType & rhs) const override;
|
|
|
|
protected:
|
|
SerializationPtr doGetDefaultSerialization() const override;
|
|
};
|
|
}
|