Index: service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java =================================================================== --- service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java +++ service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java @@ -119,7 +119,7 @@ resp.setConfiguration(new HashMap()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error opening session: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -171,7 +171,7 @@ cliService.closeSession(sessionHandle); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error closing session: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -187,7 +187,7 @@ resp.setInfoValue(getInfoValue.toTGetInfoValue()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error getting info: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -207,7 +207,7 @@ resp.setOperationHandle(operationHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error executing statement: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -221,7 +221,7 @@ resp.setOperationHandle(operationHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error getting type info: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -235,7 +235,7 @@ resp.setOperationHandle(opHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error getting catalogs: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -250,7 +250,7 @@ resp.setOperationHandle(opHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error getting schemas: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -266,7 +266,7 @@ resp.setOperationHandle(opHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error getting tables: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -280,7 +280,7 @@ resp.setOperationHandle(opHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error getting table types: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -299,7 +299,7 @@ resp.setOperationHandle(opHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error getting columns: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -315,7 +315,7 @@ resp.setOperationHandle(opHandle.toTOperationHandle()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error getting functions: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -329,7 +329,7 @@ resp.setOperationState(operationState.toTOperationState()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error getting operation status: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -342,7 +342,7 @@ cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error canceling operation: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -355,7 +355,7 @@ cliService.closeOperation(new OperationHandle(req.getOperationHandle())); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error closing operation: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -370,7 +370,7 @@ resp.setSchema(schema.toTTableSchema()); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error getting result set metadata: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -388,7 +388,7 @@ resp.setHasMoreRows(false); resp.setStatus(OK_STATUS); } catch (Exception e) { - e.printStackTrace(); + LOG.error("Error fetching results: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; @@ -438,7 +438,7 @@ server.serve(); } catch (Throwable t) { - t.printStackTrace(); + LOG.error("Error starting ThriftCLIService: ", t); } }