mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 02:41:59 +00:00
Support for UUID in ODBC dictionaries
This commit is contained in:
parent
d1a548638f
commit
a9b3279265
@ -4,6 +4,7 @@
|
|||||||
#include <DataTypes/DataTypeString.h>
|
#include <DataTypes/DataTypeString.h>
|
||||||
#include <DataTypes/DataTypeDate.h>
|
#include <DataTypes/DataTypeDate.h>
|
||||||
#include <DataTypes/DataTypeDateTime.h>
|
#include <DataTypes/DataTypeDateTime.h>
|
||||||
|
#include <DataTypes/DataTypeUUID.h>
|
||||||
#include <Common/typeid_cast.h>
|
#include <Common/typeid_cast.h>
|
||||||
|
|
||||||
|
|
||||||
@ -55,6 +56,8 @@ void ExternalResultDescription::init(const Block & sample_block_)
|
|||||||
types.push_back(ValueType::Date);
|
types.push_back(ValueType::Date);
|
||||||
else if (typeid_cast<const DataTypeDateTime *>(type))
|
else if (typeid_cast<const DataTypeDateTime *>(type))
|
||||||
types.push_back(ValueType::DateTime);
|
types.push_back(ValueType::DateTime);
|
||||||
|
else if (typeid_cast<const DataTypeUUID *>(type))
|
||||||
|
types.push_back(ValueType::UUID);
|
||||||
else
|
else
|
||||||
throw Exception{"Unsupported type " + type->getName(), ErrorCodes::UNKNOWN_TYPE};
|
throw Exception{"Unsupported type " + type->getName(), ErrorCodes::UNKNOWN_TYPE};
|
||||||
|
|
||||||
|
@ -24,7 +24,8 @@ struct ExternalResultDescription
|
|||||||
Float64,
|
Float64,
|
||||||
String,
|
String,
|
||||||
Date,
|
Date,
|
||||||
DateTime
|
DateTime,
|
||||||
|
UUID
|
||||||
};
|
};
|
||||||
|
|
||||||
Block sample_block;
|
Block sample_block;
|
||||||
|
@ -59,6 +59,8 @@ namespace
|
|||||||
case ValueType::String: static_cast<ColumnString &>(column).insert(value.convert<String>()); break;
|
case ValueType::String: static_cast<ColumnString &>(column).insert(value.convert<String>()); break;
|
||||||
case ValueType::Date: static_cast<ColumnUInt16 &>(column).insert(UInt16{LocalDate{value.convert<String>()}.getDayNum()}); break;
|
case ValueType::Date: static_cast<ColumnUInt16 &>(column).insert(UInt16{LocalDate{value.convert<String>()}.getDayNum()}); break;
|
||||||
case ValueType::DateTime: static_cast<ColumnUInt32 &>(column).insert(time_t{LocalDateTime{value.convert<String>()}}); break;
|
case ValueType::DateTime: static_cast<ColumnUInt32 &>(column).insert(time_t{LocalDateTime{value.convert<String>()}}); break;
|
||||||
|
case ValueType::UUID: static_cast<ColumnUInt128 &>(column).insert(value.convert<UInt128>()); break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user