KanakaKumar commented on a change in pull request #3288: [CARBONDATA-3437] Changed implementation of Map datatype
URL:
https://github.com/apache/carbondata/pull/3288#discussion_r294786582
##########
File path: processing/src/main/java/org/apache/carbondata/processing/loading/parser/impl/MapParserImpl.java
##########
@@ -44,12 +44,13 @@ public MapParserImpl(String delimiter, String nullFormat, String keyValueDelimit
String[] split = pattern.split(value, -1);
if (ArrayUtils.isNotEmpty(split)) {
ArrayList<Object> array = new ArrayList<>();
- Set<Object> set = new HashSet<>();
+ Map<Object, String> map = new HashMap<>();
for (int i = 0; i < split.length; i++) {
Object currKey = split[i].split(keyValueDelimiter)[0];
- if (set.add(currKey)) {
- array.add(child.parse(split[i]));
- }
+ map.put(currKey, split[i]);
+ }
+ for (Map.Entry<Object, String> entry : map.entrySet()) {
Review comment:
This may change the order of user input. You can use LinkedHashMap to maintain the insertion order.
----------------------------------------------------------------
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:
[hidden email]
With regards,
Apache Git Services