Carter Shanklin created HIVE-14416:
--------------------------------------

             Summary: NPE trying to move results of a subselect into an RDBMS 
using HPL/SQL
                 Key: HIVE-14416
                 URL: https://issues.apache.org/jira/browse/HIVE-14416
             Project: Hive
          Issue Type: Bug
          Components: hpl/sql
    Affects Versions: 2.1.0
            Reporter: Carter Shanklin


I was trying to use HPL/SQL to move some records from Hive to Postgres using 
this script:

{code}
MAP OBJECT remote TO pgtable AT mydbconn;
insert into remote values ( select * from hivetable );
{code}

When I run this script I get this NPE:
{code}
Open connection: jdbc:hive2://hdp250.example.com:10000 (285 ms)
Starting query
Query executed successfully (127 ms)
Exception in thread "main" java.lang.NullPointerException
        at org.apache.hive.hplsql.Select.getIntoCount(Select.java:405)
        at org.apache.hive.hplsql.Select.select(Select.java:88)
        at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:1002)
        at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:52)
        at 
org.apache.hive.hplsql.HplsqlParser$Select_stmtContext.accept(HplsqlParser.java:14768)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
        at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:994)
        at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
        at 
org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1012)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
        at 
org.apache.hive.hplsql.HplsqlBaseVisitor.visitBlock(HplsqlBaseVisitor.java:28)
        at 
org.apache.hive.hplsql.HplsqlParser$BlockContext.accept(HplsqlParser.java:446)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
        at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:901)
        at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
        at 
org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:389)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
        at org.apache.hive.hplsql.Exec.run(Exec.java:760)
        at org.apache.hive.hplsql.Exec.run(Exec.java:736)
        at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
{code}

This is my configuration:
{code}
<configuration>
  <property>
    <name>hplsql.conn.default</name>
    <value>myhiveconn</value>
  </property>

  <property>
    <name>hplsql.conn.myhiveconn</name>
    
<value>org.apache.hive.jdbc.HiveDriver;jdbc:hive2://hdp250.example.com:10000</value>
  </property>

  <property>
    <name>hplsql.conn.mydbconn</name>
    
<value>com.mysql.jdbc.Driver;jdbc:mysql://hdp250.example.com:3306/hive;hive;vagrant</value>
  </property>
</configuration>
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to