Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14054#discussion_r71093530
  
    --- 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 --
    
    Maybe here, we can use a best-effort heuristics. If the 
`supportsTransactionIsolationLevel` calls for all the isolation levels return 
`false` (ideally, we should not hit this scenario), we can still keep the 
existing approach (i.e., do not set the isolation level).


---
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]

Reply via email to