[
https://issues.apache.org/jira/browse/HIVE-11106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14904327#comment-14904327
]
Tom Coleman commented on HIVE-11106:
------------------------------------
Thanks for the reply Chen Xin Yu. Given that I didn't try hive-jdbc 1.2.1 at
the time (tested up to 1.2.0) I did just there and it's still the same issue.
Aside from packaging, does hive-jdbc-1.2.0-standalone.jar differ to hive-jdbc
1.2.1 in this regard (i.e. being able to connect to a non-default database (in
our case Cloudera Impala))?
Our project is not using Hive from a standalone context (e.g. standalone SQL
client), ideally we just want the JDBC driver incorporated on our application
via maven and would prefer not to place a system dependency on an external
standalone JAR (downloaded from
http://repo.maven.apache.org/maven2/org/apache/hive/hive-jdbc/1.2.0/ and
understandably is big) in our class path and is some what outside of the maven
release management lifecycle but if that it is the only way for now I don't
have much choice.
Time has not been on my side but we I get the time, I'll try and revert that
feature (https://issues.apache.org/jira/browse/HIVE-5904, note: feature, not
exact change) from Hive 0.13.1 into the latest Hive driver as I'm astonished it
cannot be done currently via the latest non-standalone hive-jdbc driver.
> HiveServer2 JDBC (greater than v0.13.1) cannot connect to non-default database
> ------------------------------------------------------------------------------
>
> Key: HIVE-11106
> URL: https://issues.apache.org/jira/browse/HIVE-11106
> Project: Hive
> Issue Type: Improvement
> Components: JDBC
> Affects Versions: 0.14.0
> Reporter: Tom Coleman
>
> Using HiveServer 0.14.0 or greater, I cannot connect a non-default database.
> For example when connecting to HiveServer to via the following URLs, the
> session uses the 'default' database, instead of the intended database.
> jdbc://localhost:10000/customDb
> This exact issue was fixed in 0.13.1 of HiveServer from
> https://issues.apache.org/jira/browse/HIVE-5904 but for some reason this fix
> was not ported to v0.14.0 or greater. From looking at the source, it looks as
> if this fix was overriden by another change to the HiveConnection class, was
> this intentional or a defect reintroduced from another defect fix?
> This means that we need to use 0.13.1 in order to connect to a non-default
> database via JDBC and we cannot upgrade Hive versions. We don't want placing
> a JDBC interceptor to inject "use customDb" each time a connection is
> borrowed from the pool on production code. One should be able to connect
> straight to the non-default database via the JDBC URL.
> Now it perhaps could be a simple oversight on my behalf in which the syntax
> to connect to a non-default database has changed from 0.14.0 onwards but I'd
> be grateful is this could be confirmed.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)