@@ -273,6 +273,7 @@ bool CSVRowInputFormat::parseRowAndPrintDiagnosticInfo(MutableColumns & columns,
273273 return false ;
274274 }
275275
276+ skipWhitespacesAndTabs (in);
276277 if (column_indexes_for_input_fields[file_column].has_value ())
277278 {
278279 const auto & header = getPort ().getHeader ();
@@ -289,6 +290,7 @@ bool CSVRowInputFormat::parseRowAndPrintDiagnosticInfo(MutableColumns & columns,
289290 if (!deserializeFieldAndPrintDiagnosticInfo (skipped_column_str, skipped_column_type, *skipped_column, out, file_column))
290291 return false ;
291292 }
293+ skipWhitespacesAndTabs (in);
292294
293295 // / Delimiters
294296 if (file_column + 1 == column_indexes_for_input_fields.size ())
@@ -351,12 +353,8 @@ void CSVRowInputFormat::syncAfterError()
351353 skipToNextLineOrEOF (in);
352354}
353355
354- void CSVRowInputFormat::tryDeserializeFiled (const DataTypePtr & type, IColumn & column, size_t file_column,
355- ReadBuffer::Position & prev_pos, ReadBuffer::Position & curr_pos)
356+ void CSVRowInputFormat::tryDeserializeField (const DataTypePtr & type, IColumn & column, size_t file_column)
356357{
357- skipWhitespacesAndTabs (in);
358- prev_pos = in.position ();
359-
360358 if (column_indexes_for_input_fields[file_column])
361359 {
362360 const bool is_last_file_column = file_column + 1 == column_indexes_for_input_fields.size ();
@@ -367,9 +365,6 @@ void CSVRowInputFormat::tryDeserializeFiled(const DataTypePtr & type, IColumn &
367365 String tmp;
368366 readCSVString (tmp, in, format_settings.csv );
369367 }
370-
371- curr_pos = in.position ();
372- skipWhitespacesAndTabs (in);
373368}
374369
375370bool CSVRowInputFormat::readField (IColumn & column, const DataTypePtr & type, bool is_last_file_column)
0 commit comments