HeartSaVioR commented on a change in pull request #26109: [SPARK-29461][SQL]
Measure the number of records being updated for JDBC writer
URL: https://github.com/apache/spark/pull/26109#discussion_r337858970
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
##########
@@ -673,12 +673,12 @@ object JdbcUtils extends Logging {
stmt.addBatch()
rowCount += 1
if (rowCount % batchSize == 0) {
- stmt.executeBatch()
+ totalUpdatedRows += stmt.executeBatch().sum
rowCount = 0
}
}
if (rowCount > 0) {
- stmt.executeBatch()
+ totalUpdatedRows += stmt.executeBatch().sum
Review comment:
OK. Thanks for the guide! What about number of bytes? Reading the length of
file is easy, but measuring the size of row for every rows seems nontrivial.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]