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

    https://github.com/apache/spark/pull/10312#discussion_r47672516
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala ---
    @@ -303,7 +316,32 @@ final class DataFrameWriter private[sql](df: 
DataFrame) {
           conn.close()
         }
     
    -    JdbcUtils.saveTable(df, url, table, props)
    +    JdbcUtils.saveTable(df, url, table, props, columnMapping)
    +  }
    +
    +  /**
    +   * (java-specific) version of jdbc method
    +   */
    +   def jdbc(url: String,
    +           table: String,
    +           connectionProperties: Properties,
    +           columnMapping: java.util.Map[String, String]): Unit = {
    +    // Convert java Map into immutable scala Map
    +    var sColumnMapping: scala.collection.immutable.Map[String, String] = 
null
    --- End diff --
    
    You've already imported the `JavaConverters`, so all of this conversion is 
just `columnMapping.toScala` I agree it does matter whether you support `null` 
but you need not.


---
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