Skip Menu |

This queue is for tickets about the DBD-JDBC CPAN distribution.

Report information
The Basics
Id: 105849
Status: new
Priority: 0/
Queue: DBD-JDBC

People
Owner: Nobody in particular
Requestors: mathewkbentley [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Defect
Date: Tue, 14 Jul 2015 01:35:49 -0400
To: bug-DBD-JDBC [...] rt.cpan.org
From: mat bentley <mathewkbentley [...] gmail.com>
Description: DBD-JDBC throws an exception when connecting to a HiveQL service in any Hadoop distribution. This is due to Apache's decision to throw exceptions from the DatabaseMetaData implementation in their driver for the method "supportsGetGeneratedKeys()" instead of returning false. Ideally this would be fixed in Apache's Hive drivers, however that isn't an option for those using DBD with a commercial distribution of Apache's Hive Drivers where source code is not available (in violation of the GPL, talking about IBM's BigInsights specifically). Desired behavior: I can load hive-jdbc jar and connect to hive through DBD without errors. Actual behavior: I can load hive-jdbc and start a dbd service, however when connecting an exception is thrown and DBD effectively dies: com.vizdom.dbd.jdbc.Connection - Error java.sql.SQLException: Method not supported at org.apache.hive.jdbc.HiveDatabaseMetaData.supportsGetGeneratedKeys(HiveDatabaseMetaData.java:931) at com.vizdom.dbd.jdbc.Connection.handleRequest(Connection.java:425) at com.vizdom.dbd.jdbc.Connection.run(Connection.java:211) at java.lang.Thread.run(Thread.java:636) Solution: catch SQLException when calling supportsGetGeneratedKeys on DatabaseMetaData instance within the com.vizdom.dbd.jdbc.Connection class. Changed: mSupportsGetGeneratedKeys = dbmd.supportsGetGeneratedKeys(); to: try{ mSupportsGetGeneratedKeys = dbmd.supportsGetGeneratedKeys(); }catch(SQLException x){ gLog.debug("Driver threw exception checking if generated keys are supported. (\"DatabaseMetaData.supportsGetGeneratedKeys()\")", x); } mSupportsGetGeneratedKeys is a boolean primitive which defaults to false, if the invocation causes an exception to throw, that can be inferred as false without a negative impact to application behavior. This impacts at least 0,71 of DBD. Cheers, Mat