fix for origin

This commit is contained in:
yariks5s 2024-06-06 16:46:38 +00:00
parent 63b0d13a62
commit c5ba8eb477

View File

@ -192,6 +192,8 @@ public:
case ResultType::DateTime64: case ResultType::DateTime64:
{ {
UInt32 scale = 0; UInt32 scale = 0;
if (isDateTime64(arguments[0].type) && overload == Overload::Origin)
scale = assert_cast<const DataTypeDateTime64 &>(*arguments[0].type.get()).getScale();
if (interval_type->getKind() == IntervalKind::Kind::Nanosecond) if (interval_type->getKind() == IntervalKind::Kind::Nanosecond)
scale = (9 > scale) ? 9 : scale; scale = (9 > scale) ? 9 : scale;
else if (interval_type->getKind() == IntervalKind::Kind::Microsecond) else if (interval_type->getKind() == IntervalKind::Kind::Microsecond)