Skip to content

Commit 308bce0

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 <albert.zhang23@gmail.com> Closes #18665 from DFFuture/sparksql_pg. (cherry picked from commit c972918) Signed-off-by: gatorsmile <gatorsmile@gmail.com>
1 parent 86cd3c0 commit 308bce0

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
@@ -286,7 +286,7 @@ private[jdbc] class JDBCRDD(
286286
conn = getConnection()
287287
val dialect = JdbcDialects.get(url)
288288
import scala.collection.JavaConverters._
289-
dialect.beforeFetch(conn, options.asConnectionProperties.asScala.toMap)
289+
dialect.beforeFetch(conn, options.asProperties.asScala.toMap)
290290

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

0 commit comments

Comments
 (0)