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

Execute immediate 'select count(*) from tbl' throwing ClassCastException in hplsql mode.

    XMLWordPrintableJSON

Details

    Description

      Execute immediate 'select count from tbl' throwing ClassCastException in hplsql mode.

       

      Steps to reproduce:

      execute immediate 'SELECT count(*) from result';"

      StackTrace in HS2 logs:

      2024-05-06T08:45:42,730 ERROR [HiveServer2-Background-Pool: Thread-850] hplsql.HplSqlOperation: Error running hive query
      org.apache.hive.service.cli.HiveSQLException: Error running HPL/SQL operation
         at org.apache.hive.service.cli.operation.hplsql.HplSqlOperation.interpret(HplSqlOperation.java:111) ~[hive-service-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.service.cli.operation.hplsql.HplSqlOperation.access$500(HplSqlOperation.java:54) ~[hive-service-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.service.cli.operation.hplsql.HplSqlOperation$BackgroundWork.lambda$run$0(HplSqlOperation.java:207) ~[hive-service-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_292]
         at javax.security.auth.Subject.doAs(Subject.java:422) ~[?:1.8.0_292]
         at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1899) ~[hadoop-common-3.3.6.jar:?]
         at org.apache.hive.service.cli.operation.hplsql.HplSqlOperation$BackgroundWork.run(HplSqlOperation.java:219) ~[hive-service-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_292]
         at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_292]
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_292]
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_292]
         at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_292]
      Caused by: java.lang.ClassCastException: class java.lang.Long cannot be casted to class java.lang.String
         at org.apache.hive.service.cli.operation.hplsql.HplSqlQueryExecutor$OperationRowResult.get(HplSqlQueryExecutor.java:147) ~[hive-service-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.hplsql.executor.QueryResult.column(QueryResult.java:49) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.hplsql.Stmt.exec(Stmt.java:1095) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.hplsql.Exec.visitExec_stmt(Exec.java:2061) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.hplsql.Exec.visitExec_stmt(Exec.java:96) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.hplsql.HplsqlParser$Exec_stmtContext.accept(HplsqlParser.java:10369) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46) ~[antlr4-runtime-4.9.3.jar:4.9.3]
         at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:1103) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:96) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1054) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46) ~[antlr4-runtime-4.9.3.jar:4.9.3]
         at org.apache.hive.hplsql.HplsqlBaseVisitor.visitBlock(HplsqlBaseVisitor.java:27) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.hplsql.HplsqlParser$BlockContext.accept(HplsqlParser.java:473) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46) ~[antlr4-runtime-4.9.3.jar:4.9.3]
         at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:999) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:96) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:414) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18) ~[antlr4-runtime-4.9.3.jar:4.9.3]
         at org.apache.hive.hplsql.Exec.evaluate(Exec.java:817) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.hplsql.Exec.parseAndEval(Exec.java:796) ~[hive-hplsql-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         at org.apache.hive.service.cli.operation.hplsql.HplSqlOperation.interpret(HplSqlOperation.java:98) ~[hive-service-4.1.0-SNAPSHOT.jar:4.1.0-SNAPSHOT]
         ... 11 more
      

       

      Attachments

        Issue Links

          Activity

            People

              Dayakar Dayakar M
              Dayakar Dayakar M
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: