mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
Added CSV (de)serialization
This commit is contained in:
parent
c92a0f3ac5
commit
ab9ce18fc7
@ -94,6 +94,8 @@ ParsedTemplateFormat::ColumnFormat ParsedTemplateFormat::stringToFormat(const St
|
||||
return ColumnFormat::Escaped;
|
||||
else if (col_format == "Quoted")
|
||||
return ColumnFormat::Quoted;
|
||||
else if (col_format == "CSV")
|
||||
return ColumnFormat::Csv;
|
||||
else if (col_format == "JSON")
|
||||
return ColumnFormat::Json;
|
||||
else if (col_format == "XML")
|
||||
@ -119,6 +121,8 @@ String ParsedTemplateFormat::formatToString(ParsedTemplateFormat::ColumnFormat f
|
||||
return "Escaped";
|
||||
case ColumnFormat::Quoted:
|
||||
return "Quoted";
|
||||
case ColumnFormat::Csv:
|
||||
return "CSV";
|
||||
case ColumnFormat::Json:
|
||||
return "Json";
|
||||
case ColumnFormat::Xml:
|
||||
@ -226,6 +230,9 @@ void TemplateBlockOutputStream::serializeField(const IColumn & column, const IDa
|
||||
case ColumnFormat::Quoted:
|
||||
type.serializeAsTextQuoted(column, row_num, ostr, settings);
|
||||
break;
|
||||
case ColumnFormat::Csv:
|
||||
type.serializeAsTextCSV(column, row_num, ostr, settings);
|
||||
break;
|
||||
case ColumnFormat::Json:
|
||||
type.serializeAsTextJSON(column, row_num, ostr, settings);
|
||||
break;
|
||||
|
@ -17,6 +17,7 @@ struct ParsedTemplateFormat
|
||||
Default,
|
||||
Escaped,
|
||||
Quoted,
|
||||
Csv,
|
||||
Json,
|
||||
Xml,
|
||||
Raw
|
||||
|
@ -101,6 +101,9 @@ void TemplateRowInputStream::deserializeField(const IDataType & type, IColumn &
|
||||
case ColumnFormat::Quoted:
|
||||
type.deserializeAsTextQuoted(column, buf, settings);
|
||||
break;
|
||||
case ColumnFormat::Csv:
|
||||
type.deserializeAsTextCSV(column, buf, settings);
|
||||
break;
|
||||
case ColumnFormat::Json:
|
||||
type.deserializeAsTextJSON(column, buf, settings);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user