Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

sollhui
Copy link
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.

apache#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

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
Contributor Author

sollhui commented Jul 29, 2024

run buildall

Copy link
Contributor

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

@doris-robot
Copy link

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
20 of 22 checks passed
@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