mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Fix type in odbc source and remove pointer from mongo source
This commit is contained in:
parent
cd07fd6246
commit
aaf5720198
@ -79,9 +79,8 @@ namespace
|
||||
}
|
||||
|
||||
void insertValue(
|
||||
IColumn & column, const ValueType type, Poco::MongoDB::Element::Ptr value_ptr, const std::string & name)
|
||||
IColumn & column, const ValueType type, const Poco::MongoDB::Element & value, const std::string & name)
|
||||
{
|
||||
const Poco::MongoDB::Element & value = *value_ptr;
|
||||
switch (type)
|
||||
{
|
||||
case ValueType::UInt8: insertNumber<UInt8>(column, value, name); break;
|
||||
@ -186,7 +185,7 @@ Block MongoDBBlockInputStream::readImpl()
|
||||
if (value.isNull() || value->type() == Poco::MongoDB::ElementTraits<Poco::MongoDB::NullValue>::TypeId)
|
||||
insertDefaultValue(*columns[idx], *description.sample_columns[idx]);
|
||||
else
|
||||
insertValue(*columns[idx], description.types[idx], value, name);
|
||||
insertValue(*columns[idx], description.types[idx], *value, name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ namespace
|
||||
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::DateTime: static_cast<ColumnUInt32 &>(column).insert(time_t{LocalDateTime{value.convert<String>()}}); break;
|
||||
case ValueType::UUID: static_cast<ColumnUInt128 &>(column).insert(parse<UInt128>(value.convert<std::string>())); break;
|
||||
case ValueType::UUID: static_cast<ColumnUInt128 &>(column).insert(parse<UUID>(value.convert<std::string>())); break;
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user