diff --git a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java index 2f2866f..a109a73 100644 --- a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java +++ b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java @@ -119,7 +119,7 @@ public TOpenSessionResp OpenSession(TOpenSessionReq req) throws TException { resp.setConfiguration(new HashMap()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error opening session: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -171,7 +171,7 @@ public TCloseSessionResp CloseSession(TCloseSessionReq req) throws TException { cliService.closeSession(sessionHandle); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error closing session: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -187,7 +187,7 @@ public TGetInfoResp GetInfo(TGetInfoReq req) throws TException { resp.setInfoValue(getInfoValue.toTGetInfoValue()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error getting info: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -207,7 +207,7 @@ public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws T resp.setOperationHandle(operationHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error executing statement: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -221,7 +221,7 @@ public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws TException { resp.setOperationHandle(operationHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error getting type info: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -235,7 +235,7 @@ public TGetCatalogsResp GetCatalogs(TGetCatalogsReq req) throws TException { resp.setOperationHandle(opHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error getting catalogs: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -250,7 +250,7 @@ public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws TException { resp.setOperationHandle(opHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error getting schemas: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -266,7 +266,7 @@ public TGetTablesResp GetTables(TGetTablesReq req) throws TException { resp.setOperationHandle(opHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error getting tables: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -280,7 +280,7 @@ public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws TException resp.setOperationHandle(opHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error getting table types: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -299,7 +299,7 @@ public TGetColumnsResp GetColumns(TGetColumnsReq req) throws TException { resp.setOperationHandle(opHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error getting columns: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -315,7 +315,7 @@ public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws TException { resp.setOperationHandle(opHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error getting functions: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -329,7 +329,7 @@ public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) th resp.setOperationState(operationState.toTOperationState()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error getting operation status: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -342,7 +342,7 @@ public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TExc cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error canceling operation: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -355,7 +355,7 @@ public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws TExcept cliService.closeOperation(new OperationHandle(req.getOperationHandle())); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error closing operation: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -370,7 +370,7 @@ public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq r resp.setSchema(schema.toTTableSchema()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error getting result set metadata: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -388,7 +388,7 @@ public TFetchResultsResp FetchResults(TFetchResultsReq req) throws TException { resp.setHasMoreRows(false); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.warn("Error fetching results: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -438,7 +438,7 @@ public void run() { server.serve(); } catch (Throwable t) { - t.printStackTrace(); + LOG.warn("Error starting ThriftCLIService: ", t); } }