Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21173#discussion_r184909615
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala
 ---
    @@ -56,6 +56,7 @@ object JDBCRDD extends Logging {
         val conn: Connection = JdbcUtils.createConnectionFactory(options)()
         try {
           val statement = conn.prepareStatement(dialect.getSchemaQuery(table))
    +      statement.setQueryTimeout(options.queryTimeout)
    --- End diff --
    
    Since `setQueryTimeout` can raise `SQLException`, we had better keep this 
inside `try` (line 60). Otherwise, `statement.close()` will not be called.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to