Skip to content

[fix](csv reader) fix csv parser incorrect if enclosing line_delimiter (#38347)#38445

Merged
liaoxin01 merged 1 commit intoapache:branch-2.1from
sollhui:2.1_fix_csv_reader
Jul 29, 2024
Merged

[fix](csv reader) fix csv parser incorrect if enclosing line_delimiter (#38347)#38445
liaoxin01 merged 1 commit intoapache:branch-2.1from
sollhui:2.1_fix_csv_reader

Conversation

@sollhui
Copy link
Copy Markdown
Contributor

@sollhui sollhui commented Jul 29, 2024

pick #38347

Csv reader parse data incorrect when data enclosing line_delimiter, for example, line_delimiter is \n and enclose is ', data as follows:

'aaaaaaaaaaaa
bbbb'

it will be parsed as two columns: 'aaaaaaaaaaaa and bbbb', rather than one column

'aaaaaaaaaaaa
bbbb'

The reason why this happened is csv reader will not reset result when not match enclose in this output_buf_read, causing incorrect truncation was made.

#38347)

Csv reader parse data incorrect when data enclosing line_delimiter, for
example, line_delimiter is \n and enclose is ', data as follows:
```
'aaaaaaaaaaaa
bbbb'
```
it will be parsed as two columns: `'aaaaaaaaaaaa` and `bbbb',` rather
than one column
```
'aaaaaaaaaaaa
bbbb'
```

The reason why this happened is csv reader will not reset result when
not match enclose in this `output_buf_read`, causing incorrect
truncation was made.

Co-authored-by: Xin Liao <liaoxinbit@126.com>
@doris-robot
Copy link
Copy Markdown

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@sollhui
Copy link
Copy Markdown
Contributor Author

sollhui commented Jul 29, 2024

run buildall

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link
Copy Markdown

TeamCity be ut coverage result:
Function Coverage: 36.44% (9254/25397)
Line Coverage: 27.99% (75655/270287)
Region Coverage: 26.80% (38892/145099)
Branch Coverage: 23.53% (19730/83862)
Coverage Report: http://coverage.selectdb-in.cc/coverage/1977434d178492e85abb0c3f92881fa808a56f74_1977434d178492e85abb0c3f92881fa808a56f74/report/index.html

@liaoxin01 liaoxin01 merged commit 17d351a into apache:branch-2.1 Jul 29, 2024
@yiguolei yiguolei mentioned this pull request Sep 5, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants