zhangxinyao88 opened a new pull request, #58588:
URL: https://github.com/apache/spark/pull/58588

   ### What changes were proposed in this pull request?
   
   Close the driver-side JDBC connection after Spark has finished checking, 
truncating, dropping, or creating the target table, and before it starts the 
distributed write.
   
   The write path opens its own JDBC connections for partitions, so keeping the 
setup connection open for the entire write is unnecessary.
   
   ### Why are the changes needed?
   
   The setup connection can remain idle for minutes or hours while a large 
write runs. Closing it before the distributed write avoids unnecessary resource 
consumption and prevents an idle connection from being dropped by a database, 
firewall, or proxy.
   
   ### Does this PR introduce any user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   `./build/sbt 'sql/testOnly org.apache.spark.sql.jdbc.JDBCWriteSuite'`
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Yes. Generated-by: Codex (GPT-5)


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

To unsubscribe, e-mail: [email protected]

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