Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/20387
  
    Currently `DataSourceOptions` is the major way for Spark and users to pass 
information to the data source. It's very flexible and only defines one rule: 
the option key lookup should be case-insensitive.
    
    I agree with your point that more consistency is better. It's annoying if 
every data source needs to define their own option keys for table and database, 
and tell users about it. It's good if Spark can define some rules about what 
option keys should be used for some common information.
    
    My proposal:
    ```
    class DataSourceOptions {
      ...
      
      def getPath(): String = get("path")
    
      def getTimeZone(): String = get("timeZone")
    
      def getTableName(): String = get("table")
    }
    ```
    We can keep adding these options since this won't break binary 
compatibility.
    
    And then we just need to document it and tell both users and data source 
developers about how to specify and retrieve these common options.
    
    Then I think we don't need to add `table` and `database` parameters to 
`DataSourceV2Relation`, because we can easily do `relation.options.getTable`.
    
    BTW this doesn't change the API so I think it's fine to do it after 2.3.


---

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

Reply via email to