Arnaud Larroque created HIVE-18470:
--------------------------------------

             Summary: MAP OBJECT statement ignored when working with multiple 
connections in HPLSQL
                 Key: HIVE-18470
                 URL: https://issues.apache.org/jira/browse/HIVE-18470
             Project: Hive
          Issue Type: Bug
          Components: HiveServer2, hpl/sql
    Affects Versions: 2.1.0
            Reporter: Arnaud Larroque


When running the following command:

 
{code:java}
/usr/hdp/2.6.3.0-235/hive2/bin/hplsql -e "
MAP OBJECT dep TO <SCHEMA>.<TABLE> AT lptdwhconn;
MAP OBJECT T TO <hive_table> AT hiveconn;
INSERT INTO T (cd_department,lb_departement,cd_region,lb_region)
SELECT d.cd_departement, d.lb_departement,d.lb_departement, d.cd_region, 
d.lb_region FROM dep d WHERE rownum < 2;"
{code}
 

I get an Exception :

 
{noformat}
Caused by: org.apache.hadoop.hive.ql.parse.SemanticException: Line 1:124 Table 
not found '<TABLE>'{noformat}
If i run a smilar command :
{code:java}
/usr/hdp/2.6.3.0-235/hive2/bin/hplsql -e "
MAP OBJECT dep TO <SCHEMA>.<TABLE> AT lptdwhconn;
MAP OBJECT T TO <hive_table> AT hiveconn;

INSERT INTO T (cd_department,lb_departement,cd_region,lb_region)
SELECT 'a' as c1, 'b' as c2, 'c' as c3, 'd' as c4;"
{code}
everything works fine !Running two select statements on each table using the 
same MAP OBJECT Statements works also fine.

It seems that running INSERT INTO .... SELECT statement  using two tables from 
different connections failed.

Somehow, the MAP OBJECT does not seem to use the correct connection to find the 
table in this case.

 

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to