maropu 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_r337861171
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
 ##########
 @@ -615,7 +615,7 @@ object JdbcUtils extends Logging {
       batchSize: Int,
       dialect: JdbcDialect,
       isolationLevel: Int,
-      options: JDBCOptions): Iterator[Byte] = {
+      options: JDBCOptions): Long = {
 
 Review comment:
   I though we took care of the metric only if transaction committed like this;
   ```
       } finally {
         if (!committed) {
           // The stage must fail.  We got here through an exception path, so
           // let the exception through unless rollback() or close() want to
           // tell the user about another problem.
           if (supportsTransactions) {
             conn.rollback()
           }
           conn.close()
         } else {
           // If the transaction committed, updates the metric
           outputMetrics.setRecordsWritten(recordsWritten)
   
           // The stage must succeed.  We cannot propagate any exception 
close() might throw.
           try {
             conn.close()
           } catch {
             case e: Exception => logWarning("Transaction succeeded, but 
closing failed", e)
           }
         }
   ```
   cc: @HyukjinKwon @wangyum 

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

Reply via email to