HyukjinKwon commented on a change in pull request #23464: [SPARK-26383][Core] - 
NPE when use DataFrameReader.jdbc with wrong URL
URL: https://github.com/apache/spark/pull/23464#discussion_r245511183
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRDD.scala
 ##########
 @@ -54,6 +54,11 @@ object JDBCRDD extends Logging {
     val table = options.tableOrQuery
     val dialect = JdbcDialects.get(url)
     val conn: Connection = JdbcUtils.createConnectionFactory(options)()
+
+    if (null == conn) {
 
 Review comment:
   Yea. It should be in that function. We can use `require` function to throw 
illegal argument exception. Looks it can potentially return `null` assuming 
from it's doc.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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