gengliangwang commented on a change in pull request #24094: [SPARK-27162][SQL]
Add new method getOriginalMap in CaseInsensitiveStringMap
URL: https://github.com/apache/spark/pull/24094#discussion_r266319708
##########
File path:
sql/catalyst/src/main/java/org/apache/spark/sql/util/CaseInsensitiveStringMap.java
##########
@@ -40,11 +40,16 @@ public static CaseInsensitiveStringMap empty() {
return new CaseInsensitiveStringMap(new HashMap<>(0));
}
+ private final Map<String, String> original;
+
private final Map<String, String> delegate;
public CaseInsensitiveStringMap(Map<String, String> originalMap) {
- this.delegate = new HashMap<>(originalMap.size());
- putAll(originalMap);
+ original = new HashMap<>(originalMap);
+ delegate = new HashMap<>(originalMap.size());
+ for (Map.Entry<? extends String, ? extends String> entry :
originalMap.entrySet()) {
+ delegate.put(toLowerCase(entry.getKey()), entry.getValue());
Review comment:
How about showing warning message here?
E.g.
```
spark.read.option("foo", "bar").option("fOO", "bar")....
```
This is valid.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]