jack86596 commented on a change in pull request #3664: [CARBONDATA-3740] Add
line separator option to load command to configure the line separator during
csv parsing.
URL: https://github.com/apache/carbondata/pull/3664#discussion_r400696454
##########
File path:
sdk/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java
##########
@@ -256,6 +259,11 @@ public CarbonWriterBuilder withLoadOptions(Map<String,
String> options) {
if (escapeChar.length() > 1 &&
!CarbonLoaderUtil.isValidEscapeSequence(escapeChar)) {
throw new IllegalArgumentException("ESCAPECHAR cannot be more than
one character.");
}
+ } else if (entry.getKey().equalsIgnoreCase("line_separator")) {
+ String lineSeparator = CarbonUtil.unescapeChar(entry.getValue());
+ if (lineSeparator.isEmpty() || lineSeparator.length() > 2) {
Review comment:
> same as above comments, need to validate whether line separator is
validate line separator or not
Univocity parser allow any one or two characters to be the line separator,
we can just do the same. User may want use 'a' as line separator.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services