[ 
https://issues.apache.org/jira/browse/HIVE-28247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Krisztian Kasa resolved HIVE-28247.
-----------------------------------
    Fix Version/s: 4.1.0
       Resolution: Fixed

Merged to master. Thanks [~Dayakar] for the patch.

> Execute immediate 'select count(*) from tbl' throwing ClassCastException in 
> hplsql mode.
> ----------------------------------------------------------------------------------------
>
>                 Key: HIVE-28247
>                 URL: https://issues.apache.org/jira/browse/HIVE-28247
>             Project: Hive
>          Issue Type: Bug
>          Components: hpl/sql
>            Reporter: Dayakar M
>            Assignee: Dayakar M
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.1.0
>
>
> Execute immediate 'select count(*) from tbl' throwing ClassCastException in 
> hplsql mode.
>  
> Steps to reproduce:
> {noformat}
> execute immediate 'SELECT count(*) from result';"{noformat}
> StackTrace in HS2 logs:
> {noformat}
> 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
> {noformat}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to