This commit is contained in:
Nikita Mikhailov 2021-02-24 20:12:22 +03:00 committed by Nikita Mikhaylov
parent 138dedf2df
commit 61fdeb5897
3 changed files with 4 additions and 3 deletions

View File

@ -53,7 +53,6 @@ public:
void resetParser() override; void resetParser() override;
protected: protected:
friend class ParallelParsingInputFormat;
/** Read next row and append it to the columns. /** Read next row and append it to the columns.
* If no more rows - return false. * If no more rows - return false.
*/ */

View File

@ -8,8 +8,6 @@
#include <DataTypes/DataTypeNothing.h> #include <DataTypes/DataTypeNothing.h>
#include <iostream>
namespace DB namespace DB
{ {
@ -157,6 +155,8 @@ void CSVRowInputFormat::readPrefix()
size_t num_columns = data_types.size(); size_t num_columns = data_types.size();
const auto & header = getPort().getHeader(); const auto & header = getPort().getHeader();
/// This is a bit of abstraction leakage, but we have almost the same code in other places.
/// Thus, we check if this InputFormat is working with the "real" beggining of the data in case of parallel parsing.
if (with_names && getCurrentUnitNumber() == 0) if (with_names && getCurrentUnitNumber() == 0)
{ {
/// This CSV file has a header row with column names. Depending on the /// This CSV file has a header row with column names. Depending on the

View File

@ -136,6 +136,8 @@ void TabSeparatedRowInputFormat::readPrefix()
skipBOMIfExists(in); skipBOMIfExists(in);
} }
/// This is a bit of abstraction leakage, but we have almost the same code in other places.
/// Thus, we check if this InputFormat is working with the "real" beggining of the data in case of parallel parsing.
if (with_names && getCurrentUnitNumber() == 0) if (with_names && getCurrentUnitNumber() == 0)
{ {
if (format_settings.with_names_use_header) if (format_settings.with_names_use_header)