[ 
https://issues.apache.org/jira/browse/HIVE-4194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13617141#comment-13617141
 ] 

Thejas M Nair commented on HIVE-4194:
-------------------------------------

bq. Please also relocated acceptsURL() to HiveConnection and make it private
acceptsURL is part of the java.sql.Driver interface, so it is needed in 
HiveDriver

bq. We shouldn't let people instantiate malformed HiveConnection objects. 
Please make the HiveConnection constructor private and add static builder 
methods to HiveConnection
This change does not makes that possible . When users try to create it using 
Driver.connect(url,info), they will get a null value.
HiveConnection created using constructor directly will also throw an exception. 
To prevent users from creating/using HiveConnection directly, we should make 
that class package private. I think we should do that for all the Hive* 
subclasses of the java.sql.* classes. But that change is not directly related 
to this issue.
 
                
> JDBC2: HiveDriver should not throw RuntimeException when passed an invalid URL
> ------------------------------------------------------------------------------
>
>                 Key: HIVE-4194
>                 URL: https://issues.apache.org/jira/browse/HIVE-4194
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2, JDBC
>    Affects Versions: 0.11.0
>            Reporter: Richard Ding
>            Assignee: Richard Ding
>             Fix For: 0.11.0
>
>         Attachments: HIVE-4194.patch
>
>
> As per JDBC 3.0 Spec (section 9.2)
>     "If the Driver implementation understands the URL, it will return a 
> Connection object; otherwise it returns null"
> Currently HiveConnection constructor will throw IllegalArgumentException if 
> url string doesn't start with "jdbc:hive2". This exception should be caught 
> by HiveDriver.connect and return null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to