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

[feature](csv)Supports reading CSV data using LF and CRLF as line separators. (#37687) #39980

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

hubgeter
Copy link
Contributor

bp #37687

Proposed changes

Supports reading CSV data using LF and CRLF as line separators.

csv file:

1,abc
2,def\r
3,qwe
4,hello\r

if you set keep_carriage_return = false
you will get :

1   abc
2   def
3   qwe
4   hello

Here, both \r\n and \n are used as delimiters.

if you set keep_carriage_return = true
you will get :

1   abc
2   def\r
3   qwe
4   hello\r

Here only \n is used as a delimiter.

It should be noted that set keep_carriage_return = true is valid for tvf, but not for stream load/mysql load. This means that when you perform stream load/mysql load, crlf and lf will be automatically used as delimiters, even if you set keep_carriage_return = true.

…arators. (apache#37687)

Supports reading CSV data using LF and CRLF as line separators.

csv file:
```
1,abc
2,def\r
3,qwe
4,hello\r
```
if you  `set keep_carriage_return = false`
you will get :
```mysql
1   abc
2   def
3   qwe
4   hello
```
Here, both \r\n and \n are used as delimiters.

if you  `set keep_carriage_return = true`
you will get :
```mysql
1   abc
2   def\r
3   qwe
4   hello\r
```
Here only \n is used as a delimiter.

It should be noted that `set keep_carriage_return = true` is valid for
tvf, but not for stream load/mysql load. This means that when you
perform stream load/mysql load, crlf and lf will be automatically used
as delimiters, even if you `set keep_carriage_return = true`.
@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.

@hubgeter
Copy link
Contributor Author

run buildall

Copy link
Contributor

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

@morningman morningman merged commit 50015d7 into apache:branch-3.0 Aug 28, 2024
21 of 27 checks passed
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