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

    https://github.com/apache/spark/pull/17758#discussion_r125482229
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSource.scala
 ---
    @@ -468,7 +489,13 @@ case class DataSource(
           throw new AnalysisException("Cannot save interval data type into 
external storage.")
         }
     
    -    providingClass.newInstance() match {
    +    val resolvedRelation = providingClass.newInstance() match {
    +      case relationToCheck: DataSourceValidator =>
    --- End diff --
    
    I tried though, I couldn't because the check at this point couldn't pass 
[this `JDBCWrite` 
test](https://github.com/apache/spark/pull/17758/files#diff-4e7d97319461efb33f06b6d245254dcdL477).
 This test catches name duplication specified by a JDBC option 
`createTableColumnTypes`. But, if we move [this 
check](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala#L744)
 in `JdbcUtils` into here, [the following 
logic](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala#L764)
 eats the duplication and `r.schema` above does not have the duplication (so, I 
think this is a corner case though, IIUC we couldn't catch at this point for 
JDBC relations)....


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to