[jira] [Commented] (HIVE-6363) IllegalArgumentException is thrown instead of SQLException
[ https://issues.apache.org/jira/browse/HIVE-6363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14166820#comment-14166820 ] Brian Muray commented on HIVE-6363: --- The issue appears to have been resolved by the fix for HIVE-7935. > IllegalArgumentException is thrown instead of SQLException > -- > > Key: HIVE-6363 > URL: https://issues.apache.org/jira/browse/HIVE-6363 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 0.10.0, 0.11.0, 0.12.0 >Reporter: chandra sekhar gunturi >Priority: Critical > Labels: JDBC, unit-test > Attachments: HIVE-6363.patch.1.txt, HIVE-6363.patch.2.txt > > Original Estimate: 24h > Remaining Estimate: 24h > > parseURL in the following code is throwing IllegalArgumentException > http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hive/jdbc/Utils.java?view=markup > > This is going to break other JDBC based connectors because > java.sql.DriverManager doesn’t catch IllegalArgumentException while probing > for correct Driver for a given URL. > A simple test case can have class.forName(org.apache.hive.jdbc.HiveDriver) > (Loading hiveserver2 JDBC driver) followed by > class.forName(org.apache.hadoop.hive.jdbc.HiveDriver)(Loading hiveserver JDBC > driver). > In this case hiveserver connection will fail with BAD URL format for > hiveserver. If you reverse the driver loading to hiveserver followed by > hiveserver2, both the connections will be successful. > Following code in java.sql.DriverManager is causing the issue > [[ > // Worker method called by the public getConnection() methods. > private static Connection getConnection( > // Walk through the loaded registeredDrivers attempting to make a connection. > // Remember the first exception that gets raised so we can reraise it. > for(DriverInfo aDriver : registeredDrivers) { > // If the caller does not have permission to load the driver then > // skip it. > if(isDriverAllowed(aDriver.driver, callerCL)) { > try { > Connection con = aDriver.driver.connect(url, info); > if (con != null) { > // Success! > println("getConnection returning " + aDriver.driver.getClass().getName()); > return (con); > } > } catch (SQLException ex) { > if (reason == null) { > reason = ex; > } > } > } else { > println(" skipping: " + aDriver.getClass().getName()); > } > } > } > ]] > Marking it as critical because this is going to restrict consuming JDBC > driver in production environment where many drivers are loaded on requirement > rather than statically loading all drivers. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-6363) IllegalArgumentException is thrown instead of SQLException
[ https://issues.apache.org/jira/browse/HIVE-6363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14164827#comment-14164827 ] Rémy DUBOIS commented on HIVE-6363: --- Hello everyone, I don't understand clearly the status of this issue. I understand a patch has been created, but I also see that HIVE-4194 should fix this issue, but has not been closed after it's been reopened. Can you please clarify? Thanks in advance, > IllegalArgumentException is thrown instead of SQLException > -- > > Key: HIVE-6363 > URL: https://issues.apache.org/jira/browse/HIVE-6363 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 0.10.0, 0.11.0, 0.12.0 >Reporter: chandra sekhar gunturi >Priority: Critical > Labels: JDBC, unit-test > Attachments: HIVE-6363.patch.1.txt, HIVE-6363.patch.2.txt > > Original Estimate: 24h > Remaining Estimate: 24h > > parseURL in the following code is throwing IllegalArgumentException > http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hive/jdbc/Utils.java?view=markup > > This is going to break other JDBC based connectors because > java.sql.DriverManager doesn’t catch IllegalArgumentException while probing > for correct Driver for a given URL. > A simple test case can have class.forName(org.apache.hive.jdbc.HiveDriver) > (Loading hiveserver2 JDBC driver) followed by > class.forName(org.apache.hadoop.hive.jdbc.HiveDriver)(Loading hiveserver JDBC > driver). > In this case hiveserver connection will fail with BAD URL format for > hiveserver. If you reverse the driver loading to hiveserver followed by > hiveserver2, both the connections will be successful. > Following code in java.sql.DriverManager is causing the issue > [[ > // Worker method called by the public getConnection() methods. > private static Connection getConnection( > // Walk through the loaded registeredDrivers attempting to make a connection. > // Remember the first exception that gets raised so we can reraise it. > for(DriverInfo aDriver : registeredDrivers) { > // If the caller does not have permission to load the driver then > // skip it. > if(isDriverAllowed(aDriver.driver, callerCL)) { > try { > Connection con = aDriver.driver.connect(url, info); > if (con != null) { > // Success! > println("getConnection returning " + aDriver.driver.getClass().getName()); > return (con); > } > } catch (SQLException ex) { > if (reason == null) { > reason = ex; > } > } > } else { > println(" skipping: " + aDriver.getClass().getName()); > } > } > } > ]] > Marking it as critical because this is going to restrict consuming JDBC > driver in production environment where many drivers are loaded on requirement > rather than statically loading all drivers. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-6363) IllegalArgumentException is thrown instead of SQLException
[ https://issues.apache.org/jira/browse/HIVE-6363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13923834#comment-13923834 ] chandra sekhar gunturi commented on HIVE-6363: -- I think the issue is resolved by [HIVE-4194|https://issues.apache.org/jira/browse/HIVE-4194]. The parseURL is called from two places. https://github.com/apache/hive/blob/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveDriver.java#L233 (from parseURLforPropertyInfo() function) https://github.com/apache/hive/blob/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java#L122 (Constructor of HiveConnection) Both are having the condition check if(URI.startsWith("jdbc:hive2://"), hence the parseURL() never gets called when the condition uri.startsWith(URL_PREFIX) is false. But it is good to have fix so that if some one calls the function unconditionally in future, the issue will resurface. I think [HIVE-4802|https://issues.apache.org/jira/browse/HIVE-4802] did not affect changes made by [HIVE-4194|https://issues.apache.org/jira/browse/HIVE-4194] as conditional call is still in place. I was testing this on Hive 0.11 & saw the code for parseURL was not changed from throwing IllegalArgumentException. I think the JIRA can be changed to lower priority. > IllegalArgumentException is thrown instead of SQLException > -- > > Key: HIVE-6363 > URL: https://issues.apache.org/jira/browse/HIVE-6363 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 0.10.0, 0.11.0, 0.12.0 >Reporter: chandra sekhar gunturi >Priority: Critical > Labels: JDBC, unit-test > Attachments: HIVE-6363.patch.1.txt, HIVE-6363.patch.2.txt > > Original Estimate: 24h > Remaining Estimate: 24h > > parseURL in the following code is throwing IllegalArgumentException > http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hive/jdbc/Utils.java?view=markup > > This is going to break other JDBC based connectors because > java.sql.DriverManager doesn’t catch IllegalArgumentException while probing > for correct Driver for a given URL. > A simple test case can have class.forName(org.apache.hive.jdbc.HiveDriver) > (Loading hiveserver2 JDBC driver) followed by > class.forName(org.apache.hadoop.hive.jdbc.HiveDriver)(Loading hiveserver JDBC > driver). > In this case hiveserver connection will fail with BAD URL format for > hiveserver. If you reverse the driver loading to hiveserver followed by > hiveserver2, both the connections will be successful. > Following code in java.sql.DriverManager is causing the issue > [[ > // Worker method called by the public getConnection() methods. > private static Connection getConnection( > // Walk through the loaded registeredDrivers attempting to make a connection. > // Remember the first exception that gets raised so we can reraise it. > for(DriverInfo aDriver : registeredDrivers) { > // If the caller does not have permission to load the driver then > // skip it. > if(isDriverAllowed(aDriver.driver, callerCL)) { > try { > Connection con = aDriver.driver.connect(url, info); > if (con != null) { > // Success! > println("getConnection returning " + aDriver.driver.getClass().getName()); > return (con); > } > } catch (SQLException ex) { > if (reason == null) { > reason = ex; > } > } > } else { > println(" skipping: " + aDriver.getClass().getName()); > } > } > } > ]] > Marking it as critical because this is going to restrict consuming JDBC > driver in production environment where many drivers are loaded on requirement > rather than statically loading all drivers. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (HIVE-6363) IllegalArgumentException is thrown instead of SQLException
[ https://issues.apache.org/jira/browse/HIVE-6363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13891653#comment-13891653 ] Brian Muray commented on HIVE-6363: --- Thejas M Nair: Yes, the change to jdbc/pom.xml is to add unit test coverage to the methods that were modified. > IllegalArgumentException is thrown instead of SQLException > -- > > Key: HIVE-6363 > URL: https://issues.apache.org/jira/browse/HIVE-6363 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 0.10.0, 0.11.0, 0.12.0 >Reporter: chandra sekhar gunturi >Priority: Critical > Labels: JDBC, unit-test > Attachments: HIVE-6363.patch.1.txt, HIVE-6363.patch.2.txt > > Original Estimate: 24h > Remaining Estimate: 24h > > parseURL in the following code is throwing IllegalArgumentException > http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hive/jdbc/Utils.java?view=markup > > This is going to break other JDBC based connectors because > java.sql.DriverManager doesn’t catch IllegalArgumentException while probing > for correct Driver for a given URL. > A simple test case can have class.forName(org.apache.hive.jdbc.HiveDriver) > (Loading hiveserver2 JDBC driver) followed by > class.forName(org.apache.hadoop.hive.jdbc.HiveDriver)(Loading hiveserver JDBC > driver). > In this case hiveserver connection will fail with BAD URL format for > hiveserver. If you reverse the driver loading to hiveserver followed by > hiveserver2, both the connections will be successful. > Following code in java.sql.DriverManager is causing the issue > [[ > // Worker method called by the public getConnection() methods. > private static Connection getConnection( > // Walk through the loaded registeredDrivers attempting to make a connection. > // Remember the first exception that gets raised so we can reraise it. > for(DriverInfo aDriver : registeredDrivers) { > // If the caller does not have permission to load the driver then > // skip it. > if(isDriverAllowed(aDriver.driver, callerCL)) { > try { > Connection con = aDriver.driver.connect(url, info); > if (con != null) { > // Success! > println("getConnection returning " + aDriver.driver.getClass().getName()); > return (con); > } > } catch (SQLException ex) { > if (reason == null) { > reason = ex; > } > } > } else { > println(" skipping: " + aDriver.getClass().getName()); > } > } > } > ]] > Marking it as critical because this is going to restrict consuming JDBC > driver in production environment where many drivers are loaded on requirement > rather than statically loading all drivers. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (HIVE-6363) IllegalArgumentException is thrown instead of SQLException
[ https://issues.apache.org/jira/browse/HIVE-6363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13891471#comment-13891471 ] Thejas M Nair commented on HIVE-6363: - Thanks for the patch. It looks good. Is the jdbc/pom.xml change related to this issue ? > IllegalArgumentException is thrown instead of SQLException > -- > > Key: HIVE-6363 > URL: https://issues.apache.org/jira/browse/HIVE-6363 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 0.10.0, 0.11.0, 0.12.0 >Reporter: chandra sekhar gunturi >Priority: Critical > Labels: JDBC, unit-test > Attachments: HIVE-6363.patch.1.txt, HIVE-6363.patch.2.txt > > Original Estimate: 24h > Remaining Estimate: 24h > > parseURL in the following code is throwing IllegalArgumentException > http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hive/jdbc/Utils.java?view=markup > > This is going to break other JDBC based connectors because > java.sql.DriverManager doesn’t catch IllegalArgumentException while probing > for correct Driver for a given URL. > A simple test case can have class.forName(org.apache.hive.jdbc.HiveDriver) > (Loading hiveserver2 JDBC driver) followed by > class.forName(org.apache.hadoop.hive.jdbc.HiveDriver)(Loading hiveserver JDBC > driver). > In this case hiveserver connection will fail with BAD URL format for > hiveserver. If you reverse the driver loading to hiveserver followed by > hiveserver2, both the connections will be successful. > Following code in java.sql.DriverManager is causing the issue > [[ > // Worker method called by the public getConnection() methods. > private static Connection getConnection( > // Walk through the loaded registeredDrivers attempting to make a connection. > // Remember the first exception that gets raised so we can reraise it. > for(DriverInfo aDriver : registeredDrivers) { > // If the caller does not have permission to load the driver then > // skip it. > if(isDriverAllowed(aDriver.driver, callerCL)) { > try { > Connection con = aDriver.driver.connect(url, info); > if (con != null) { > // Success! > println("getConnection returning " + aDriver.driver.getClass().getName()); > return (con); > } > } catch (SQLException ex) { > if (reason == null) { > reason = ex; > } > } > } else { > println(" skipping: " + aDriver.getClass().getName()); > } > } > } > ]] > Marking it as critical because this is going to restrict consuming JDBC > driver in production environment where many drivers are loaded on requirement > rather than statically loading all drivers. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (HIVE-6363) IllegalArgumentException is thrown instead of SQLException
[ https://issues.apache.org/jira/browse/HIVE-6363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13891462#comment-13891462 ] Brian Muray commented on HIVE-6363: --- A similar issue was fixed in HIVE-4194. The changes were overwritten by the changes to HIVE-4802. > IllegalArgumentException is thrown instead of SQLException > -- > > Key: HIVE-6363 > URL: https://issues.apache.org/jira/browse/HIVE-6363 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 0.10.0, 0.11.0, 0.12.0 >Reporter: chandra sekhar gunturi >Priority: Critical > Labels: JDBC, unit-test > Attachments: HIVE-6363.patch.1.txt, HIVE-6363.patch.2.txt > > Original Estimate: 24h > Remaining Estimate: 24h > > parseURL in the following code is throwing IllegalArgumentException > http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hive/jdbc/Utils.java?view=markup > > This is going to break other JDBC based connectors because > java.sql.DriverManager doesn’t catch IllegalArgumentException while probing > for correct Driver for a given URL. > A simple test case can have class.forName(org.apache.hive.jdbc.HiveDriver) > (Loading hiveserver2 JDBC driver) followed by > class.forName(org.apache.hadoop.hive.jdbc.HiveDriver)(Loading hiveserver JDBC > driver). > In this case hiveserver connection will fail with BAD URL format for > hiveserver. If you reverse the driver loading to hiveserver followed by > hiveserver2, both the connections will be successful. > Following code in java.sql.DriverManager is causing the issue > [[ > // Worker method called by the public getConnection() methods. > private static Connection getConnection( > // Walk through the loaded registeredDrivers attempting to make a connection. > // Remember the first exception that gets raised so we can reraise it. > for(DriverInfo aDriver : registeredDrivers) { > // If the caller does not have permission to load the driver then > // skip it. > if(isDriverAllowed(aDriver.driver, callerCL)) { > try { > Connection con = aDriver.driver.connect(url, info); > if (con != null) { > // Success! > println("getConnection returning " + aDriver.driver.getClass().getName()); > return (con); > } > } catch (SQLException ex) { > if (reason == null) { > reason = ex; > } > } > } else { > println(" skipping: " + aDriver.getClass().getName()); > } > } > } > ]] > Marking it as critical because this is going to restrict consuming JDBC > driver in production environment where many drivers are loaded on requirement > rather than statically loading all drivers. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (HIVE-6363) IllegalArgumentException is thrown instead of SQLException
[ https://issues.apache.org/jira/browse/HIVE-6363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13891123#comment-13891123 ] Brian Muray commented on HIVE-6363: --- Found same bug. Will have patch ready soon. > IllegalArgumentException is thrown instead of SQLException > -- > > Key: HIVE-6363 > URL: https://issues.apache.org/jira/browse/HIVE-6363 > Project: Hive > Issue Type: Bug > Components: JDBC >Affects Versions: 0.10.0, 0.11.0, 0.12.0 >Reporter: chandra sekhar gunturi >Priority: Critical > Original Estimate: 24h > Remaining Estimate: 24h > > parseURL in the following code is throwing IllegalArgumentException > http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hive/jdbc/Utils.java?view=markup > > This is going to break other JDBC based connectors because > java.sql.DriverManager doesn’t catch IllegalArgumentException while probing > for correct Driver for a given URL. > A simple test case can have class.forName(org.apache.hive.jdbc.HiveDriver) > (Loading hiveserver2 JDBC driver) followed by > class.forName(org.apache.hadoop.hive.jdbc.HiveDriver)(Loading hiveserver JDBC > driver). > In this case hiveserver connection will fail with BAD URL format for > hiveserver. If you reverse the driver loading to hiveserver followed by > hiveserver2, both the connections will be successful. > Following code in java.sql.DriverManager is causing the issue > [[ > // Worker method called by the public getConnection() methods. > private static Connection getConnection( > // Walk through the loaded registeredDrivers attempting to make a connection. > // Remember the first exception that gets raised so we can reraise it. > for(DriverInfo aDriver : registeredDrivers) { > // If the caller does not have permission to load the driver then > // skip it. > if(isDriverAllowed(aDriver.driver, callerCL)) { > try { > Connection con = aDriver.driver.connect(url, info); > if (con != null) { > // Success! > println("getConnection returning " + aDriver.driver.getClass().getName()); > return (con); > } > } catch (SQLException ex) { > if (reason == null) { > reason = ex; > } > } > } else { > println(" skipping: " + aDriver.getClass().getName()); > } > } > } > ]] > Marking it as critical because this is going to restrict consuming JDBC > driver in production environment where many drivers are loaded on requirement > rather than statically loading all drivers. -- This message was sent by Atlassian JIRA (v6.1.5#6160)