mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 18:02:24 +00:00
use getScaleMultiplier
This commit is contained in:
parent
0d873d50a3
commit
954e76cb7a
@ -194,13 +194,15 @@ Field convertFieldToTypeImpl(const Field & src, const IDataType & type, const ID
|
|||||||
}
|
}
|
||||||
else if (which_type.isDateTime64() && which_from_type.isDate())
|
else if (which_type.isDateTime64() && which_from_type.isDate())
|
||||||
{
|
{
|
||||||
const auto value = static_cast<const DataTypeDateTime64 &>(type).getTimeZone().fromDayNum(DayNum(src.get<UInt64>()));
|
const DataTypeDateTime64 & data_type_date_time64 = static_cast<const DataTypeDateTime64 &>(type);
|
||||||
return DecimalUtils::decimalFromComponentsWithMultiplier<DateTime64>(value, 0, 1);
|
const Int64 value = data_type_date_time64.getTimeZone().fromDayNum(DayNum(src.get<UInt64>()));
|
||||||
|
return DecimalUtils::decimalFromComponentsWithMultiplier<DateTime64>(value, 0, data_type_date_time64.getScaleMultiplier());
|
||||||
}
|
}
|
||||||
else if (which_type.isDateTime64() && which_from_type.isDate32())
|
else if (which_type.isDateTime64() && which_from_type.isDate32())
|
||||||
{
|
{
|
||||||
const auto value = static_cast<const DataTypeDateTime64 &>(type).getTimeZone().fromDayNum(DayNum(src.get<Int32>()));
|
const DataTypeDateTime64 & data_type_date_time64 = static_cast<const DataTypeDateTime64 &>(type);
|
||||||
return DecimalUtils::decimalFromComponentsWithMultiplier<DateTime64>(value, 0, 1);
|
const Int64 value = data_type_date_time64.getTimeZone().fromDayNum(DayNum(src.get<Int32>()));
|
||||||
|
return DecimalUtils::decimalFromComponentsWithMultiplier<DateTime64>(value, 0, data_type_date_time64.getScaleMultiplier());
|
||||||
}
|
}
|
||||||
else if (type.isValueRepresentedByNumber() && src.getType() != Field::Types::String)
|
else if (type.isValueRepresentedByNumber() && src.getType() != Field::Types::String)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user