Hive 在 Join 查询时报错: Bad status for request TFetchResultsReq ...

  1. 异常信息:
    Bad status for request TFetchResultsReq(fetchType=1, operationHandle=TOperationHandle(hasResultSet=True, modifiedRowCount=None, operationType=0, operationId=THandleIdentifier(secret='\xff\xe1\x85\x867JMQ\xa1H\x10\xa4\xbf\xd1\xe6\xab', guid='u\x91\xac[UCO\x8d\xbb\xd0\r\x87\xcd\xec\xc7\x87')), orientation=4, maxRows=-1):
    TFetchResultsResp(status=TStatus(errorCode=0, errorMessage="Couldn't find log associated with operation handle: 
    OperationHandle [opType=EXECUTE_STATEMENT, getHandleIdentifier()=7591ac5b-5543-4f8d-bbd0-0d87cdecc787]", 
    sqlState=None, infoMessages=["*org.apache.hive.service.cli.HiveSQLException:Couldn't find log associated with 
    operation handle: OperationHandle [opType=EXECUTE_STATEMENT, 
    getHandleIdentifier()=7591ac5b-5543-4f8d-bbd0-0d87cdecc787]:13:12", 
    'org.apache.hive.service.cli.operation.OperationManager:getOperationLogRowSet:OperationManager.java:310', 
    'org.apache.hive.service.cli.session.HiveSessionImpl:fetchResults:HiveSessionImpl.java:771', 
    'org.apache.hive.service.cli.CLIService:fetchResults:CLIService.java:462', 
    'org.apache.hive.service.cli.thrift.ThriftCLIService:FetchResults:ThriftCLIService.java:691', 
    '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.hive.service.auth.TSetIpAddressProcessor:process:TSetIpAddressProcessor.java:56', 
    'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:286', 
    'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1149', 
    'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:624', 
    'java.lang.Thread:run:Thread.java:748'], statusCode=3), results=None, hasMoreRows=None)
    
  2. 解决办法:
    1. 查看 HiveServer2 操作日志目录配置
      Hive --> 配置 --> 搜索 hive.server2.logging

      image

    2. 在所有安装了 HiveServer2 服务的节点上创建对应操作日志目录并修改用户权限

      mkdir -p /var/log/hive/operation_logs
      chown -R  hive:hive /var/log/hive/operation_logs/
      chmod -R 755 /var/log/hive/operation_logs/
      
    3. 重启所有 HiveServer2 服务。

你可能感兴趣的:(Hive 在 Join 查询时报错: Bad status for request TFetchResultsReq ...)