Finalizes the process of the chunk.
168596 {
168597 if (result.result_position == result.result_size || result.error) {
168598
168599 return;
168600 }
168601
168602 while (!
FinishedFile() && result.result_position < result.result_size && !result.error) {
168604
168606
168609 if (
states.IsQuotedCurrent() && !
states.IsUnquoted()) {
168610
168611 result.error = true;
168612 return;
168613 }
168615 return;
168616 }
168617
168618 if (result.comment) {
168619
168620 result.UnsetComment(result, NumericLimits<idx_t>::Maximum());
168621 } else {
168622
168623 result.AddRow(result, NumericLimits<idx_t>::Maximum());
168624 }
168625 return;
168626 } else {
168628 result.cur_buffer_idx =
iterator.pos.buffer_idx;
168630
168631 const LinePosition cur_position(result.cur_buffer_idx, 0, result.current_buffer_size);
168632 LinesPerBoundary lines_per_batch;
168633 if (cur_position - result.last_position > result.state_machine.options.maximum_line_size.GetValue()) {
168634 FullLinePosition current_line_position;
168635 current_line_position.begin = result.last_position;
168636 current_line_position.end = cur_position;
168637 bool mock = false;
168638 string csv_row = current_line_position.ReconstructCurrentLine(mock, result.buffer_handles, true);
168639 auto error =
168641 result.last_position.GetGlobalPosition(
168642 result.state_machine.options.buffer_size_option.GetValue(), false),
168643 result.state_machine.options.file_path);
168645 result.error = true;
168646 return;
168647 }
168648 }
168649 if (result.buffer_handles.size() > 2) {
168650
168651 result.buffer_handles.erase(result.buffer_handles.begin());
168652 }
168655 }
168657 }
168658}
void Process(T &result)
Process one chunk.
Definition duckdb.cpp:167343
bool FinishedFile() const
Returns true if the scanner is finished.
Definition duckdb.cpp:168380
char * buffer_handle_ptr
Hold the current buffer ptr.
Definition duckdb.cpp:167330
static CSVError LineSizeError(const CSVReaderOptions &options, LinesPerBoundary error_info, string &csv_row, idx_t byte_position, const String ¤t_path)
Produces error for when the line size exceeds the maximum line size option.
Definition duckdb.cpp:175889