Repository: spark
Updated Branches:
  refs/heads/branch-2.2 86cd3c088 -> 308bce0eb


[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.

(cherry picked from commit c9729187bcef78299390e53cd9af38c3e084060e)
Signed-off-by: gatorsmile <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/308bce0e
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/308bce0e
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/308bce0e

Branch: refs/heads/branch-2.2
Commit: 308bce0eb60649b15836614567532460ea73bd12
Parents: 86cd3c0
Author: DFFuture <[email protected]>
Authored: Wed Jul 19 14:45:11 2017 -0700
Committer: gatorsmile <[email protected]>
Committed: Wed Jul 19 14:45:23 2017 -0700

----------------------------------------------------------------------
 .../org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/308bce0e/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala
----------------------------------------------------------------------
diff --git 
a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala
 
b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala
index 2bdc432..7097069 100644
--- 
a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala
+++ 
b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala
@@ -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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to