[
https://issues.apache.org/jira/browse/HIVE-16188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15929135#comment-15929135
]
Sahil Takiar commented on HIVE-16188:
-------------------------------------
We could do it client side, but it would have to be after the connection is
made. We have no way of knowing whether the database name exists or not without
making a {{HiveConnection}} and querying the metastore to see if the database
exists.
The only way I can think of doing it client side, would be to make the
connection, and then execute a {{describe database [db-name]}} command. If the
the query throws an exception, then it should exit. If it works then everything
executes normally.
> beeline should block the connection if given invalid database name.
> -------------------------------------------------------------------
>
> Key: HIVE-16188
> URL: https://issues.apache.org/jira/browse/HIVE-16188
> Project: Hive
> Issue Type: Bug
> Components: Hive
> Reporter: Pavas Garg
> Assignee: Sahil Takiar
> Priority: Minor
> Attachments: HIVE-16188.1.patch, HIVE-16188.2.patch
>
>
> When using beeline shell to connect to HS2 or impalaD as below -
> Connection to HS2 using beeline tool on port 10000 -
> beeline -u
> "jdbc:hive2://HS2-host-name:10000/default;principal=hive/[email protected]"
> Connection to ImpalaD using beeline tool on port 21050 -
> beeline -u
> "jdbc:hive2://impalad-host-name.com:21050/XXX;principal=impala/[email protected]"
>
> Providing a invalid database name as XXX - the connection is made.
> It should ideally stop the connection to be successfull.
> Even though, the beeline tool does not allow to move forward, unless you
> provide a valid DB name, like
> Use <Database-Name>;
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)