mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 13:13:36 +00:00
Fixed build errors for GCC-9 and Apple Clang.
This commit is contained in:
parent
5c125dff90
commit
d227712f84
@ -69,7 +69,7 @@ void DataTypeDateTime64::serializeText(const IColumn & column, size_t row_num, W
|
|||||||
|
|
||||||
void DataTypeDateTime64::deserializeText(IColumn & column, ReadBuffer & istr, const FormatSettings &) const
|
void DataTypeDateTime64::deserializeText(IColumn & column, ReadBuffer & istr, const FormatSettings &) const
|
||||||
{
|
{
|
||||||
DateTime64 result;
|
DateTime64 result = 0;
|
||||||
readDateTime64Text(result, this->getScale(), istr, time_zone);
|
readDateTime64Text(result, this->getScale(), istr, time_zone);
|
||||||
assert_cast<ColumnType &>(column).getData().push_back(result);
|
assert_cast<ColumnType &>(column).getData().push_back(result);
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ void DataTypeDateTime64::serializeTextEscaped(const IColumn & column, size_t row
|
|||||||
|
|
||||||
void DataTypeDateTime64::deserializeTextEscaped(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const
|
void DataTypeDateTime64::deserializeTextEscaped(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const
|
||||||
{
|
{
|
||||||
DateTime64 x;
|
DateTime64 x = 0;
|
||||||
::readText(x, scale, istr, settings, time_zone, utc_time_zone);
|
::readText(x, scale, istr, settings, time_zone, utc_time_zone);
|
||||||
assert_cast<ColumnType &>(column).getData().push_back(x);
|
assert_cast<ColumnType &>(column).getData().push_back(x);
|
||||||
}
|
}
|
||||||
@ -100,7 +100,7 @@ void DataTypeDateTime64::serializeTextQuoted(const IColumn & column, size_t row_
|
|||||||
|
|
||||||
void DataTypeDateTime64::deserializeTextQuoted(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const
|
void DataTypeDateTime64::deserializeTextQuoted(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const
|
||||||
{
|
{
|
||||||
DateTime64 x;
|
DateTime64 x = 0;
|
||||||
if (checkChar('\'', istr)) /// Cases: '2017-08-31 18:36:48' or '1504193808'
|
if (checkChar('\'', istr)) /// Cases: '2017-08-31 18:36:48' or '1504193808'
|
||||||
{
|
{
|
||||||
::readText(x, scale, istr, settings, time_zone, utc_time_zone);
|
::readText(x, scale, istr, settings, time_zone, utc_time_zone);
|
||||||
@ -122,7 +122,7 @@ void DataTypeDateTime64::serializeTextJSON(const IColumn & column, size_t row_nu
|
|||||||
|
|
||||||
void DataTypeDateTime64::deserializeTextJSON(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const
|
void DataTypeDateTime64::deserializeTextJSON(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const
|
||||||
{
|
{
|
||||||
DateTime64 x;
|
DateTime64 x = 0;
|
||||||
if (checkChar('"', istr))
|
if (checkChar('"', istr))
|
||||||
{
|
{
|
||||||
::readText(x, scale, istr, settings, time_zone, utc_time_zone);
|
::readText(x, scale, istr, settings, time_zone, utc_time_zone);
|
||||||
@ -144,7 +144,7 @@ void DataTypeDateTime64::serializeTextCSV(const IColumn & column, size_t row_num
|
|||||||
|
|
||||||
void DataTypeDateTime64::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const
|
void DataTypeDateTime64::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const
|
||||||
{
|
{
|
||||||
DateTime64 x;
|
DateTime64 x = 0;
|
||||||
|
|
||||||
if (istr.eof())
|
if (istr.eof())
|
||||||
throwReadAfterEOF();
|
throwReadAfterEOF();
|
||||||
@ -172,7 +172,7 @@ void DataTypeDateTime64::serializeProtobuf(const IColumn & column, size_t row_nu
|
|||||||
void DataTypeDateTime64::deserializeProtobuf(IColumn & column, ProtobufReader & protobuf, bool allow_add_row, bool & row_added) const
|
void DataTypeDateTime64::deserializeProtobuf(IColumn & column, ProtobufReader & protobuf, bool allow_add_row, bool & row_added) const
|
||||||
{
|
{
|
||||||
row_added = false;
|
row_added = false;
|
||||||
DateTime64 t;
|
DateTime64 t = 0;
|
||||||
if (!protobuf.readDateTime64(t, scale))
|
if (!protobuf.readDateTime64(t, scale))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -641,7 +641,7 @@ struct ConvertThroughParsing
|
|||||||
{
|
{
|
||||||
if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
|
if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
|
||||||
{
|
{
|
||||||
DateTime64 res;
|
DateTime64 res = 0;
|
||||||
parseDateTime64BestEffort(res, vec_to.getScale(), read_buffer, *local_time_zone, *utc_time_zone);
|
parseDateTime64BestEffort(res, vec_to.getScale(), read_buffer, *local_time_zone, *utc_time_zone);
|
||||||
vec_to[i] = res;
|
vec_to[i] = res;
|
||||||
}
|
}
|
||||||
@ -656,7 +656,7 @@ struct ConvertThroughParsing
|
|||||||
{
|
{
|
||||||
if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
|
if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
|
||||||
{
|
{
|
||||||
DateTime64 value;
|
DateTime64 value = 0;
|
||||||
readDateTime64Text(value, vec_to.getScale(), read_buffer, *local_time_zone);
|
readDateTime64Text(value, vec_to.getScale(), read_buffer, *local_time_zone);
|
||||||
vec_to[i] = value;
|
vec_to[i] = value;
|
||||||
}
|
}
|
||||||
@ -677,7 +677,7 @@ struct ConvertThroughParsing
|
|||||||
{
|
{
|
||||||
if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
|
if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
|
||||||
{
|
{
|
||||||
DateTime64 res;
|
DateTime64 res = 0;
|
||||||
parsed = tryParseDateTime64BestEffort(res, vec_to.getScale(), read_buffer, *local_time_zone, *utc_time_zone);
|
parsed = tryParseDateTime64BestEffort(res, vec_to.getScale(), read_buffer, *local_time_zone, *utc_time_zone);
|
||||||
vec_to[i] = res;
|
vec_to[i] = res;
|
||||||
}
|
}
|
||||||
@ -692,7 +692,7 @@ struct ConvertThroughParsing
|
|||||||
{
|
{
|
||||||
if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
|
if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
|
||||||
{
|
{
|
||||||
DateTime64 value;
|
DateTime64 value = 0;
|
||||||
parsed = tryReadDateTime64Text(value, vec_to.getScale(), read_buffer, *local_time_zone);
|
parsed = tryReadDateTime64Text(value, vec_to.getScale(), read_buffer, *local_time_zone);
|
||||||
vec_to[i] = value;
|
vec_to[i] = value;
|
||||||
}
|
}
|
||||||
@ -1132,7 +1132,7 @@ public:
|
|||||||
res = std::make_shared<DataTypeDateTime>(extractTimeZoneNameFromFunctionArguments(arguments, 1, 0));
|
res = std::make_shared<DataTypeDateTime>(extractTimeZoneNameFromFunctionArguments(arguments, 1, 0));
|
||||||
else if constexpr (to_decimal)
|
else if constexpr (to_decimal)
|
||||||
{
|
{
|
||||||
UInt64 scale = extractToDecimalScale(arguments[1]);
|
UInt64 scale [[maybe_unused]] = extractToDecimalScale(arguments[1]);
|
||||||
|
|
||||||
if constexpr (std::is_same_v<ToDataType, DataTypeDecimal<Decimal32>>)
|
if constexpr (std::is_same_v<ToDataType, DataTypeDecimal<Decimal32>>)
|
||||||
res = createDecimal<DataTypeDecimal>(9, scale);
|
res = createDecimal<DataTypeDecimal>(9, scale);
|
||||||
|
@ -543,7 +543,7 @@ bool tryParseDateTimeBestEffort(time_t & res, ReadBuffer & in, const DateLUTImpl
|
|||||||
|
|
||||||
void parseDateTime64BestEffort(DateTime64 & res, UInt32 scale, ReadBuffer & in, const DateLUTImpl & local_time_zone, const DateLUTImpl & utc_time_zone)
|
void parseDateTime64BestEffort(DateTime64 & res, UInt32 scale, ReadBuffer & in, const DateLUTImpl & local_time_zone, const DateLUTImpl & utc_time_zone)
|
||||||
{
|
{
|
||||||
DateTime64::NativeType whole;
|
time_t whole;
|
||||||
DateTime64::NativeType fractional;
|
DateTime64::NativeType fractional;
|
||||||
parseDateTimeBestEffortImpl<void>(whole, in, local_time_zone, utc_time_zone, &fractional);
|
parseDateTimeBestEffortImpl<void>(whole, in, local_time_zone, utc_time_zone, &fractional);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user