Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-14416

NPE trying to move results of a subselect into an RDBMS using HPL/SQL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.1.0
    • None
    • hpl/sql
    • None

    Description

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

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

      When I run this script I get this NPE:

      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)
      

      This is my configuration:

      <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>
      

      Attachments

        Activity

          People

            dmtolpeko Dmitry Tolpeko
            cartershanklin Carter Shanklin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: