hi all,

I’ve a request for adding some action when thrift to hiveserver2 and before 
call ExcuteStatement, for example, execute some other hql before hqls from 
python thrift client executed. My solution is modifying the 
ThriftCLIService.java, 
public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws 
TException{}
 However, when I modified this function and build the code, nothing happened!
shortly, I add two log records for test, as code below.

   public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) 
throws TException {
          LOG.warn("WARN #################");
          LOG.info(“INFO #################");
    TExecuteStatementResp resp = new TExecuteStatementResp();
    try {
      SessionHandle sessionHandle = new SessionHandle(req.getSessionHandle());
      String statement = req.getStatement();
      Map<String, String> confOverlay = req.getConfOverlay();
      Boolean runAsync = req.isRunAsync();
      OperationHandle operationHandle = runAsync ?
          cliService.executeStatementAsync(sessionHandle, statement, 
confOverlay)
          : cliService.executeStatement(sessionHandle, statement, confOverlay);
          resp.setOperationHandle(operationHandle.toTOperationHandle());
          resp.setStatus(OK_STATUS);
    } catch (Exception e) {
      LOG.warn("Error executing statement: ", e);
      resp.setStatus(HiveSQLException.toTStatus(e));
    }
    return resp;
  }

After that, I build the package, then start the server as “ bin/hive —service 
hiveserver2 —hiveconf hive.root.logger=INFO,console”. As far here, everything 
is ok.
Then I call python client send sql to execute, I get the result correctly, but 
never the log record print!

I want to know why?
Somebody give me out? Thanks a lot

祝好!
- 刘宗全
zongquan...@meilishuo.com



Reply via email to