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

   ### What changes were proposed in this pull request?
   
   Close the JDBC connection created for a DSv2 truncate operation in 
`JDBCWriteBuilder`.
   Add a regression test that verifies every JDBC connection created during the 
write is closed.
   
   ### Why are the changes needed?
   
   `JDBCWriteBuilder` creates a driver-side connection for truncate, while
   `JdbcUtils.truncateTable` closes only its statement. The connection 
otherwise remains open.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Added a `JDBCV2Suite` regression test for `DataFrameWriterV2` truncate 
connection closure.
   
   Attempted:
   `build/sbt 'sql/testOnly org.apache.spark.sql.jdbc.JDBCV2Suite -- -z 
"DataFrameWriterV2: truncate closes JDBC connections"'`
   
   The local build was blocked while compiling unrelated Parquet test sources 
because
   `org.apache.parquet.column.values.Utils` and
   `org.apache.parquet.column.page.mem.MemPageStore` were unavailable. The new 
test's missing
   `JDBCOptions` import was fixed before that unrelated failure.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Codex
   


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