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

HPL/SQL: CLI fails to exit after NPE using embedded connection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Resolved
    • None
    • None
    • hpl/sql
    • None

    Description

      This bug is part of a series of issues and surprising behavior I encountered writing a reporting script that would aggregate values and give rows different classifications based on an the aggregate. Addressing some or all of these issues would make HPL/SQL more accessible to newcomers.
      This happened during the error reported in XXX (bug TBD)

      Script is this:
      create table if not exists test1(col1 integer);
      create table if not exists test2(col1 double);
      create table if not exists test3(col1 decimal(10, 4));
      create table if not exists test4(col1 string);
      create table if not exists test5(col1 varchar(20));

      Output is this:
      [vagrant@trunk hplsql]$ hplsql -f temp3.sql
      SLF4J: Class path contains multiple SLF4J bindings.
      SLF4J: Found binding in [jar:file:/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/usr/hdp/2.6.1.0-128/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
      SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
      Open connection: jdbc:hive2:// (5.83 sec)
      Starting query
      OK
      Query executed successfully (2.31 sec)
      Exception in thread "main" java.lang.NullPointerException
      at org.apache.hive.hplsql.Exec.evalPop(Exec.java:2398)
      at org.apache.hive.hplsql.Stmt.createTableDefinition(Stmt.java:169)
      at org.apache.hive.hplsql.Stmt.createTable(Stmt.java:142)
      at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:1366)
      at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:52)
      at org.apache.hive.hplsql.HplsqlParser$Create_table_stmtContext.accept(HplsqlParser.java:4198)
      at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
      at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:1013)
      at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
      at org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1018)
      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:452)
      at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
      at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:920)
      at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
      at org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:393)
      at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
      at org.apache.hive.hplsql.Exec.run(Exec.java:775)
      at org.apache.hive.hplsql.Exec.run(Exec.java:751)
      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)

      I attached a jstack.

      When I use a Hiveserver2 connection instead, I get an NPE but it doesn't hang (at least not on the client side)

      Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2

      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: