Minor: Comment reworded and style fixes

This commit is contained in:
Vasily Nemkov 2020-03-10 16:17:34 +08:00
parent 5fc89bce7c
commit 2cb3d37913
2 changed files with 5 additions and 4 deletions

View File

@ -823,11 +823,12 @@ public:
type_res = std::make_shared<LeftDataType>(left.getPrecision(), left.getScale());
else if constexpr (IsDataTypeDecimal<RightDataType>)
type_res = std::make_shared<RightDataType>(right.getPrecision(), right.getScale());
// Special case for DateTime: binary OPS should not looze the timezone of the result type,
// but reuse timezone of DateTime argument.
// NOTE: binary plus/minus are not allowed on DateTime64, and we are not handling it here.
else if constexpr (std::is_same_v<ResultDataType, DataTypeDateTime>)
{
// Special case for DateTime: binary OPS should reuse timezone
// of DateTime argument as timezeone of result type.
// NOTE: binary plus/minus are not allowed on DateTime64, and we are not handling it here.
const TimezoneMixin * tz = nullptr;
if constexpr (std::is_same_v<RightDataType, DataTypeDateTime>)
tz = &right;

View File

@ -315,7 +315,7 @@ public:
const DateLUTImpl * time_zone_tmp = nullptr;
if (std::is_same_v<DataType, DataTypeDateTime64> || std::is_same_v<DataType, DataTypeDateTime>)
time_zone_tmp = &extractTimeZoneFromFunctionArguments(block, arguments, 3, 0);
time_zone_tmp = &extractTimeZoneFromFunctionArguments(block, arguments, 3, 0);
else
time_zone_tmp = &DateLUT::instance();