maropu commented on a change in pull request #30001:
URL: https://github.com/apache/spark/pull/30001#discussion_r505932800



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
##########
@@ -675,15 +676,19 @@ object JdbcUtils extends Logging {
             }
             i = i + 1
           }
-          stmt.addBatch()
-          rowCount += 1
-          totalRowCount += 1
-          if (rowCount % batchSize == 0) {
-            stmt.executeBatch()
-            rowCount = 0
+          if (supportsBatchUpdates) {

Review comment:
       Could you pull this check out from the loop? I think we don't need to 
check it in every iterations.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to