Skip to content

Commit

Permalink
[SPARK-21446][SQL] Fix setAutoCommit never executed
Browse files Browse the repository at this point in the history
## 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 apache#18665 from DFFuture/sparksql_pg.

(cherry picked from commit c972918)
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
  • Loading branch information
DFFuture authored and MatthewRBruce committed Jul 31, 2018
1 parent e69e408 commit fff38be
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ private[jdbc] class JDBCRDD(
conn = getConnection()
val dialect = JdbcDialects.get(url)
import scala.collection.JavaConverters._
dialect.beforeFetch(conn, options.asConnectionProperties.asScala.toMap)
dialect.beforeFetch(conn, options.asProperties.asScala.toMap)

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

0 comments on commit fff38be

Please sign in to comment.