Frank Kemmer created HIVE-17655:
-----------------------------------

             Summary: SQL UPDATE on Object mapped to mysqlconn fails
                 Key: HIVE-17655
                 URL: https://issues.apache.org/jira/browse/HIVE-17655
             Project: Hive
          Issue Type: Bug
          Components: hpl/sql
            Reporter: Frank Kemmer


We have a MySQL Database configured in hplsql-site.xml:

{code}
<property>
  <name>hplsql.conn.mysqlconn</name>
  <value>com.mysql.jdbc.Driver;jdbc:mysql://<our my sql 
server>/defaultdb;luser;strenggeheim</value>
  <description>MySQL connection</description>
</property>
{code}

In hplsqlrc:

{code}
MAP OBJECT T TO defaultdb.T AT mysqlconn;
{code}

This works:

{code}
$ hplsql -e "select * from T;"
Open connection: jdbc:mysql:/<our mysql server>/defaultdb (649 ms)
Starting query
Query executed successfully (5 ms)
1 Hans
$ 
{code}

This not:

{code}
$ hplsql -e "UPDATE T SET name = 'Peter' WHERE id = 1;"
{code}

This funnily tries to open the hive connection and fails with not knowing table 
T ... ofc T exists only on our MySQL DB ...

Really strange ... if we set the mysqlconn as default connection, then 
everything works as expected ...

It looks like hplsql forgets to lookup the mapped object and assumes it only 
needs to access the default connection.

Personally I would much more prefer, to have the connection in the table 
specification than in a MAP statement, like for exmaple in presto:

{code}
SELECT * FROM mysqlconn.T;
{code}

We are using cloudera 5.12 and I have downloaded hplsql-0.3.31 ...

Thx for any info in advance.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to