Miklos Szurap created HIVE-28826:
------------------------------------

             Summary: Beeline fails to connect with spaces in the jdbc url
                 Key: HIVE-28826
                 URL: https://issues.apache.org/jira/browse/HIVE-28826
             Project: Hive
          Issue Type: Bug
          Components: Beeline
    Affects Versions: 4.0.1, 3.1.3
            Reporter: Miklos Szurap
            Assignee: Miklos Szurap


In some environments we need to customize the javax.jdo.option.ConnectionURL, 
and typically with Oracle databases the JDBC connection URL might contain 
spaces, like 
{code}
jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST=...
{code}
For more examples see:
https://docs.oracle.com/en/database/oracle/oracle-database/19/jjdbc/data-sources-and-URLs.html#GUID-08D5A76B-163A-4AA2-A11C-F273B66338FE

HiveMetaStore works fine when there are such spaces in the JDBC connection URL. 
We can agree that spaces are not ideal in URLs, however this can be a hidden 
source of problem during upgrades, because the "hive.sh upgrade_metastore" is 
using beeline and the same JDBC connection url to connect directly to the HMS 
database and run the upgrade schema scripts, and in such cases the beeline 
command is failing with:
{code}
Connecting to jdbc:oracle:thin:@(DESCRIPTION
...
No current connection
Connection is already closed.
{code}
In the above error message, the URL is stripped till the first space, thus it 
is not going to be valid, and the connection cannot succeed.
This can be verified with (will fail with the "No current connection") :
{code}
beeline -u 'jdbc:oracle:thin:@(DESCRIPTION = 
(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLDB)))'
 -d oracle.jdbc.OracleDriver -n hiveusername -p hivepwd -e "select * from 
VERSION;"
{code}

To make the upgades more robust, we should handle these situations.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to