-
Notifications
You must be signed in to change notification settings - Fork 98
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] add stream load config to add double quotes for field when csv format. #119
Conversation
FIELD_DELIMITER = EscapeHandler.escapeString(streamLoadProp.getOrDefault("column_separator", "\t")); | ||
this.trimDoubleQuotes = Boolean.parseBoolean(streamLoadProp.getOrDefault("trim_double_quotes", "false")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #121
Thank you for your contribution, this error means that the delimiter is -->, and then ---> is not recognized? |
yes,the problem occurs in the delimited implementation of CSVReader. |
row.stream().map(field -> field == null ? NULL_VALUE : field.toString()) | ||
.collect(Collectors.joining(FIELD_DELIMITER)) | ||
).collect(Collectors.joining(LINE_DELIMITER)); | ||
if (addDoubleQuotes && trimDoubleQuotes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this feature only works if both add_double_quotes
and trim_double_quotes
are set to true
. So is it necessary to enforce setting trim_double_quotes
to true when add_double_quotes
is true
?
df64983
to
5a2a72e
Compare
5a2a72e
to
5448717
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…csv format.
Proposed changes
Issue Number: close #xxx
Problem Summary:
Describe the overview of changes.
add config "add_double_quotes" Add double quotes to filed before streamload, combined with "trim_double_quotes" to prevent CsvReader from failing to split data when the last character of the field data is the same as the first character of the field separator
Checklist(Required)
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...