Github user vlyubin commented on a diff in the pull request:
https://github.com/apache/spark/pull/4859#discussion_r26986539
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JDBCRelation.scala ---
@@ -115,18 +116,21 @@ private[sql] class DefaultSource extends
RelationProvider {
numPartitions.toInt)
}
val parts = JDBCRelation.columnPartition(partitionInfo)
- JDBCRelation(url, table, parts)(sqlContext)
+ val properties = new Properties() // Additional properties that we
will pass to getConnection
+ parameters.foreach(kv => properties.setProperty(kv._1, kv._2))
+ JDBCRelation(url, table, parts, properties)(sqlContext)
}
}
private[sql] case class JDBCRelation(
url: String,
table: String,
- parts: Array[Partition])(@transient val sqlContext: SQLContext)
+ parts: Array[Partition],
+ properties: Properties = null)(@transient val sqlContext: SQLContext)
--- End diff --
No particular reason really, both are fine with DriverManagers'
getConnection(). I've switched to empty properties map, I guess it is in fact
neater than null.
---
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]