You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/03/04 13:15:45 UTC

[GitHub] [spark] beliefer commented on a change in pull request #35727: [SPARK-38361][SQL] Add factory method `getConnection` into `JDBCDialect`.

beliefer commented on a change in pull request #35727:
URL: https://github.com/apache/spark/pull/35727#discussion_r819560129



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala
##########
@@ -99,6 +99,16 @@ abstract class JdbcDialect extends Serializable with Logging{
    */
   def getJDBCType(dt: DataType): Option[JdbcType] = None
 
+  /**
+   * Get the factory method for create JDBC connection.
+   * In general, creating a connection has nothing to do with JDBC partition.
+   * But sometimes it is needed, such as a database with multiple shard nodes.
+   * @param options JDBC options.
+   * @return The factory method for create JDBC connection.
+   */
+  def getConnection(options: JDBCOptions): JDBCPartition => Connection =

Review comment:
       Yes. Users could use the JDBCPartition to get connection with different partition.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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