mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 09:22:05 +00:00
fix date csv parsing
This commit is contained in:
parent
c8872fe96d
commit
087a0e939b
@ -76,9 +76,22 @@ void SerializationDate::serializeTextCSV(const IColumn & column, size_t row_num,
|
|||||||
|
|
||||||
void SerializationDate::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const FormatSettings &) const
|
void SerializationDate::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const FormatSettings &) const
|
||||||
{
|
{
|
||||||
LocalDate value;
|
DayNum x;
|
||||||
readCSV(value, istr);
|
|
||||||
assert_cast<ColumnUInt16 &>(column).getData().push_back(value.getDayNum());
|
if (istr.eof())
|
||||||
|
throwReadAfterEOF();
|
||||||
|
|
||||||
|
char maybe_quote = *istr.position();
|
||||||
|
|
||||||
|
if (maybe_quote == '\'' || maybe_quote == '\"')
|
||||||
|
++istr.position();
|
||||||
|
|
||||||
|
readDateText(x, istr);
|
||||||
|
|
||||||
|
if (maybe_quote == '\'' || maybe_quote == '\"')
|
||||||
|
assertChar(maybe_quote, istr);
|
||||||
|
|
||||||
|
assert_cast<ColumnType &>(column).getData().push_back(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user