style check

This commit is contained in:
nikitamikhaylov 2020-09-10 19:35:18 +03:00
parent 6e0d2a427c
commit d0c259974d
2 changed files with 7 additions and 10 deletions

View File

@ -8,8 +8,7 @@ namespace DB
namespace ErrorCodes
{
extern const int LOGICAL_ERROR;
extern const int INCORRECT_DATA;
extern const int INCORRECT_QUERY;
}
LineAsStringRowInputFormat::LineAsStringRowInputFormat(const Block & header_, ReadBuffer & in_, Params params_) :
@ -17,7 +16,7 @@ LineAsStringRowInputFormat::LineAsStringRowInputFormat(const Block & header_, Re
{
if (header_.columns() > 1 || header_.getDataTypes()[0]->getTypeId() != TypeIndex::String)
{
throw Exception("This input format is only suitable for tables with a single column of type String.", ErrorCodes::LOGICAL_ERROR);
throw Exception("This input format is only suitable for tables with a single column of type String.", ErrorCodes::INCORRECT_QUERY);
}
}
@ -39,7 +38,8 @@ void LineAsStringRowInputFormat::readLineObject(IColumn & column)
{
pos = find_first_symbols<'\n', '\\'>(buf.position(), buf.buffer().end());
buf.position() = pos;
if (buf.position() == buf.buffer().end()) {
if (buf.position() == buf.buffer().end())
{
over = true;
break;
}
@ -48,14 +48,11 @@ void LineAsStringRowInputFormat::readLineObject(IColumn & column)
newline = false;
}
else if (*buf.position() == '\\')
{
{
++buf.position();
if (!buf.eof())
{
++buf.position();
}
++buf.position();
}
}
buf.makeContinuousMemoryFromCheckpointToPos();

View File

@ -25,7 +25,6 @@ SRCS(
Formats/Impl/ConstantExpressionTemplate.cpp
Formats/Impl/CSVRowInputFormat.cpp
Formats/Impl/CSVRowOutputFormat.cpp
Formats/Impl/LineAsStringRowInputFormat.cpp
Formats/Impl/JSONAsStringRowInputFormat.cpp
Formats/Impl/JSONCompactEachRowRowInputFormat.cpp
Formats/Impl/JSONCompactEachRowRowOutputFormat.cpp
@ -34,6 +33,7 @@ SRCS(
Formats/Impl/JSONEachRowRowOutputFormat.cpp
Formats/Impl/JSONEachRowWithProgressRowOutputFormat.cpp
Formats/Impl/JSONRowOutputFormat.cpp
Formats/Impl/LineAsStringRowInputFormat.cpp
Formats/Impl/MarkdownRowOutputFormat.cpp
Formats/Impl/MsgPackRowInputFormat.cpp
Formats/Impl/MsgPackRowOutputFormat.cpp