Skip to content

Commit c972918

Browse files
DFFuturegatorsmile
authored andcommitted
[SPARK-21446][SQL] Fix setAutoCommit never executed
## What changes were proposed in this pull request? JIRA Issue: https://issues.apache.org/jira/browse/SPARK-21446 options.asConnectionProperties can not have fetchsize,because fetchsize belongs to Spark-only options, and Spark-only options have been excluded in connection properities. So change properties of beforeFetch from options.asConnectionProperties.asScala.toMap to options.asProperties.asScala.toMap ## How was this patch tested? Author: DFFuture <[email protected]> Closes #18665 from DFFuture/sparksql_pg.
1 parent ef61775 commit c972918

File tree

1 file changed

+1
-1
lines changed
  • sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc

1 file changed

+1
-1
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ private[jdbc] class JDBCRDD(
271271
conn = getConnection()
272272
val dialect = JdbcDialects.get(url)
273273
import scala.collection.JavaConverters._
274-
dialect.beforeFetch(conn, options.asConnectionProperties.asScala.toMap)
274+
dialect.beforeFetch(conn, options.asProperties.asScala.toMap)
275275

276276
// H2's JDBC driver does not support the setSchema() method. We pass a
277277
// fully-qualified table name in the SELECT statement. I don't know how to

0 commit comments

Comments
 (0)