github-actions[bot] commented on code in PR #62575:
URL: https://github.com/apache/doris/pull/62575#discussion_r3144819924
##########
be/src/format/csv/csv_reader.cpp:
##########
@@ -772,6 +793,30 @@ Status CsvReader::_line_split_to_values(const Slice& line,
bool* success) {
void CsvReader::_split_line(const Slice& line) {
Review Comment:
`_record_split_value_enclosed_flags()` now runs for every CSV row, even when
`_enclose_reader_ctx == nullptr` or the schema has no nullable string columns.
The new flag is only consumed in the nullable-string fast path below, so plain
CSV scans and tables with no nullable string columns now pay an extra
`clear()/resize()` every row for no benefit. Please gate this bookkeeping on
the path that can actually use it instead of doing it unconditionally from
`_split_line()`.
##########
be/src/format/csv/csv_reader.cpp:
##########
@@ -772,6 +793,30 @@ Status CsvReader::_line_split_to_values(const Slice& line,
bool* success) {
void CsvReader::_split_line(const Slice& line) {
_split_values.clear();
_fields_splitter->split_line(line, &_split_values);
+ _record_split_value_enclosed_flags(line);
+}
+
+void CsvReader::_record_split_value_enclosed_flags(const Slice& line) {
+ _split_values_were_enclosed.clear();
+ _split_values_were_enclosed.reserve(_split_values.size());
+ if (_enclose_reader_ctx == nullptr) {
+ _split_values_were_enclosed.resize(_split_values.size(), 0);
+ return;
+ }
Review Comment:
This is a second full pass over the same row boundaries that
`EncloseCsvTextFieldSplitter::split_line()` just used to build `_split_values`.
Because `column_sep_positions()` returns by value, this also copies the
separator vector again here. CSV scan is a hot path for `file()`, `s3()`, and
`http_stream()`, so this extra pass/copy can noticeably reduce throughput on
wide files. Please carry the enclosed bit out of the original split pass (or at
least reuse the existing separator positions without another copy) instead of
rescanning the raw line here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]