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

    https://github.com/apache/spark/pull/20535#discussion_r180171421
  
    --- Diff: 
sql/core/src/main/java/org/apache/spark/sql/sources/v2/DataSourceOptions.java 
---
    @@ -97,4 +142,66 @@ public double getDouble(String key, double 
defaultValue) {
         return keyLowerCasedMap.containsKey(lcaseKey) ?
           Double.parseDouble(keyLowerCasedMap.get(lcaseKey)) : defaultValue;
       }
    +
    +  /**
    +   * The option key for singular path.
    +   */
    +  public static final String PATH_KEY = "path";
    +
    +  /**
    +   * The option key for multiple paths.
    +   */
    +  public static final String PATHS_KEY = "paths";
    +
    +  /**
    +   * The option key for table name.
    +   */
    +  public static final String TABLE_KEY = "table";
    +
    +  /**
    +   * The option key for database name.
    +   */
    +  public static final String DATABASE_KEY = "database";
    +
    +  /**
    +   * Returns the value of the singular path option.
    +   */
    +  public Optional<String> path() {
    +    return get(PATH_KEY);
    +  }
    +
    +  /**
    +   * Returns all the paths specified by both the singular path option and 
the multiple
    +   * paths option.
    +   */
    +  public String[] paths() {
    +    String[] singularPath = path().map(s -> new String[]{s}).orElseGet(() 
-> new String[0]);
    +    Optional<String> pathsStr = get(PATHS_KEY);
    +    System.out.println(pathsStr);
    --- End diff --
    
    remove println :)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to