Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/14054#discussion_r71093448
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
---
@@ -284,9 +286,17 @@ object JdbcUtils extends Logging {
val rddSchema = df.schema
val getConnection: () => Connection = createConnectionFactory(url,
properties)
val batchSize = properties.getProperty(JDBC_BATCH_INSERT_SIZE,
"1000").toInt
- df.foreachPartition { iterator =>
- savePartition(getConnection, table, iterator, rddSchema, nullTypes,
batchSize, dialect)
- }
+ val isolationLevel =
+ properties.getProperty(JDBC_TXN_ISOLATION_LEVEL, "READ_UNCOMMITTED")
match {
--- End diff --
If not specified, should we use the default transaction isolation level set
by the data sources?
My major concern is that the default level `READ_UNCOMMITTED` might not be
supported by the underlying JDBC sources. In this case, we might get a
`SQLException`?
Thus, maybe we should check whether the isolation we specified is supported
or not by using `supportsTransactionIsolationLevel`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]