Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19902#discussion_r155387709
  
    --- Diff: 
sql/core/src/main/java/org/apache/spark/sql/sources/v2/DataSourceV2Options.java 
---
    @@ -49,4 +49,41 @@ public DataSourceV2Options(Map<String, String> 
originalMap) {
       public Optional<String> get(String key) {
         return Optional.ofNullable(keyLowerCasedMap.get(toLowerCase(key)));
       }
    +
    +  public Optional<Boolean> getBoolean(String key) {
    +    String lcaseKey = toLowerCase(key);
    +    return Optional.ofNullable(keyLowerCasedMap.containsKey(lcaseKey) ?
    +      Boolean.parseBoolean(keyLowerCasedMap.get(lcaseKey)) : null);
    +  }
    +
    +  public Optional<Integer> getInt(String key) {
    +    String lcaseKey = toLowerCase(key);
    +    return Optional.ofNullable(keyLowerCasedMap.containsKey(lcaseKey) ?
    +      Integer.parseInt(keyLowerCasedMap.get(lcaseKey)) : null);
    +  }
    +
    +  public Optional<Long> getLong(String key) {
    --- End diff --
    
    Can you also remove the three APIs without the default values?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to