Support Questions
Find answers, ask questions, and share your expertise

Select query fails with some exception error.

Select query fails with some exception error.

After loading the ORC file to Hive table, My select * query gets aborted with below error:

Fetching results ran into the following error(s):

Bad status for request TFetchResultsReq(fetchType=0, operationHandle=TOperationHandle(hasResultSet=True, modifiedRowCount=None, operationType=0, operationId=THandleIdentifier(secret='f\xfa\xf32\xd1KB\xbb\xb9\t\xe8\x1c\xd1\x01\xa5\xf2', guid=')\x17\r4\x7f D\xcf\xa0Z\xff\x8a70\xaa\x93')), orientation=4, maxRows=100): TFetchResultsResp(status=TStatus(errorCode=0, errorMessage='java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException', sqlState=None, infoMessages=['*org.apache.hive.service.cli.HiveSQLException:java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException:25:24', 'org.apache.hive.service.cli.operation.SQLOperation:getNextRowSet:SQLOperation.java:352', 'org.apache.hive.service.cli.operation.OperationManager:getOperationNextRowSet:OperationManager.java:221', 'org.apache.hive.service.cli.session.HiveSessionImpl:fetchResults:HiveSessionImpl.java:707', 'sun.reflect.GeneratedMethodAccessor45:invoke::-1', 'sun.reflect.DelegatingMethodAccessorImpl:invoke:DelegatingMethodAccessorImpl.java:43', 'java.lang.reflect.Method:invoke:Method.java:606', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:78', 'org.apache.hive.service.cli.session.HiveSessionProxy:access$000:HiveSessionProxy.java:36', 'org.apache.hive.service.cli.session.HiveSessionProxy$1:run:HiveSessionProxy.java:63', 'java.security.AccessController:doPrivileged:AccessController.java:-2', 'javax.security.auth.Subject:doAs:Subject.java:415', 'org.apache.hadoop.security.UserGroupInformation:doAs:UserGroupInformation.java:1692', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:59', 'com.sun.proxy.$Proxy45:fetchResults::-1', 'org.apache.hive.service.cli.CLIService:fetchResults:CLIService.java:454', 'org.apache.hive.service.cli.thrift.ThriftCLIService:FetchResults:ThriftCLIService.java:672', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults:getResult:TCLIService.java:1553', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults:getResult:TCLIService.java:1538', 'org.apache.thrift.ProcessFunction:process:ProcessFunction.java:39', 'org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39', 'org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor:process:HadoopThriftAuthBridge.java:692', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:285', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1145', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:615', 'java.lang.Thread:run:Thread.java:745', '*java.io.IOException:org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException:27:2', 'org.apache.hadoop.hive.ql.exec.FetchTask:fetch:FetchTask.java:154', 'org.apache.hadoop.hive.ql.Driver:getResults:Driver.java:1720', 'org.apache.hive.service.cli.operation.SQLOperation:getNextRowSet:SQLOperation.java:347', '*org.apache.hadoop.hive.ql.metadata.HiveException:java.lang.ClassCastException:34:7', 'org.apache.hadoop.hive.ql.exec.ListSinkOperator:process:ListSinkOperator.java:93', 'org.apache.hadoop.hive.ql.exec.Operator:forward:Operator.java:838', 'org.apache.hadoop.hive.ql.exec.SelectOperator:process:SelectOperator.java:88', 'org.apache.hadoop.hive.ql.exec.Operator:forward:Operator.java:838', 'org.apache.hadoop.hive.ql.exec.TableScanOperator:process:TableScanOperator.java:97', 'org.apache.hadoop.hive.ql.exec.FetchOperator:pushRow:FetchOperator.java:425', 'org.apache.hadoop.hive.ql.exec.FetchOperator:pushRow:FetchOperator.java:417', 'org.apache.hadoop.hive.ql.exec.FetchTask:fetch:FetchTask.java:140', '*java.lang.ClassCastException:null:0:-1'], statusCode=3), results=None, hasMoreRows=None)

3 REPLIES 3

Re: Select query fails with some exception error.

From unix I am geting below error:

Failed with exception java.io.IOException:org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.ClassCastException: org.apache.hadoop.hive.serde2.io.HiveVarcharWritable cannot be cast to org.apache.hadoop.io.Text

Re: Select query fails with some exception error.

Hi @Atul Goel

Could you please share the table DDL?

Re: Select query fails with some exception error.

Here is DDL

create table if not exists <TABLENAME> ( audit_crz_create_ts timestamp comment "audit trail CRZ load timestamp", zpctyp string comment "code type", zpfcod string comment "currency code", zp_sg079 string comment "filler", zplang string comment "language code", zp_sg080 string comment "filler", zpfdes string comment "currency description", zpfdec int comment "no.of decimal places", zp_sg223 string comment "filler", f_d_cc string comment "delete code", f_r_cc string comment "record id") partitioned by (businesseffectivedate date) row format delimited fields terminated by '\t' lines terminated by '\n' stored as orc location '/data/crz/bb5g/con/<TABLENAME>/';