/** * For a given error message string, searches for a <code>ErrorMsg</code> enum * that appears to be a match. If a match is found, returns the * <code>SQLState</code> associated with the <code>ErrorMsg</code>. If a match * is not found or <code>ErrorMsg</code> has no <code>SQLState</code>, returns * the <code>SQLState</code> bound to the <code>GENERIC_ERROR</code> * <code>ErrorMsg</code>. * * @param mesg * An error message string * @return SQLState */ public static String findSQLState(String mesg) { ErrorMsg error = getErrorMsg(mesg); return error.getSQLState(); }
/** * For a given error message string, searches for a <code>ErrorMsg</code> enum * that appears to be a match. If a match is found, returns the * <code>SQLState</code> associated with the <code>ErrorMsg</code>. If a match * is not found or <code>ErrorMsg</code> has no <code>SQLState</code>, returns * the <code>SQLState</code> bound to the <code>GENERIC_ERROR</code> * <code>ErrorMsg</code>. * * @param mesg * An error message string * @return SQLState */ public static String findSQLState(String mesg) { ErrorMsg error = getErrorMsg(mesg); return error.getSQLState(); }
public CommandProcessorResponse(int responseCode, ErrorMsg canonicalErrMsg, Throwable t, String ... msgArgs) { this(responseCode, canonicalErrMsg.format(msgArgs), canonicalErrMsg.getSQLState(), null, t, canonicalErrMsg.getErrorCode(), null); }
public CommandProcessorResponse(int responseCode, ErrorMsg canonicalErrMsg, Throwable t, String ... msgArgs) { this(responseCode, canonicalErrMsg.format(msgArgs), canonicalErrMsg.getSQLState(), null, t, canonicalErrMsg.getErrorCode(), null); }
private CommandProcessorResponse handleHiveException(HiveException e, int ret, String rootMsg) throws CommandProcessorResponse { errorMessage = "FAILED: Hive Internal Error: " + Utilities.getNameMessage(e); if(rootMsg != null) { errorMessage += "\n" + rootMsg; } SQLState = e.getCanonicalErrorMsg() != null ? e.getCanonicalErrorMsg().getSQLState() : ErrorMsg.findSQLState(e.getMessage()); downstreamError = e; console.printError(errorMessage + "\n" + org.apache.hadoop.util.StringUtils.stringifyException(e)); throw createProcessorResponse(ret); } private boolean requiresLock() {
private CommandProcessorResponse handleHiveException(HiveException e, int ret, String rootMsg) { errorMessage = "FAILED: Hive Internal Error: " + Utilities.getNameMessage(e); if(rootMsg != null) { errorMessage += "\n" + rootMsg; } SQLState = e.getCanonicalErrorMsg() != null ? e.getCanonicalErrorMsg().getSQLState() : ErrorMsg.findSQLState(e.getMessage()); downstreamError = e; console.printError(errorMessage + "\n" + org.apache.hadoop.util.StringUtils.stringifyException(e)); return createProcessorResponse(ret); } private boolean requiresLock() {
getCanonicalErrorMsg(); if (errorMsg != ErrorMsg.GENERIC_ERROR) { SQLState = errorMsg.getSQLState();
SQLState = error.getSQLState(); downstreamError = e; console.printError(errorMessage, "\n"
SQLState = error.getSQLState(); downstreamError = e; console.printError(errorMessage, "\n"
/** * For a given error message string, searches for a <code>ErrorMsg</code> enum * that appears to be a match. If a match is found, returns the * <code>SQLState</code> associated with the <code>ErrorMsg</code>. If a match * is not found or <code>ErrorMsg</code> has no <code>SQLState</code>, returns * the <code>SQLState</code> bound to the <code>GENERIC_ERROR</code> * <code>ErrorMsg</code>. * * @param mesg * An error message string * @return SQLState */ public static String findSQLState(String mesg) { ErrorMsg error = getErrorMsg(mesg); return error.getSQLState(); }
/** * Validate configuration variables. * * @return */ private boolean validateConfVariables() { boolean valid = true; if ((!conf.getBoolVar(HiveConf.ConfVars.HIVE_HADOOP_SUPPORTS_SUBDIRECTORIES)) && ((conf.getBoolVar(HiveConf.ConfVars.HADOOPMAPREDINPUTDIRRECURSIVE)) || (conf .getBoolVar(HiveConf.ConfVars.HIVEOPTLISTBUCKETING)) || ((conf .getBoolVar(HiveConf.ConfVars.HIVE_OPTIMIZE_UNION_REMOVE))))) { errorMessage = "FAILED: Hive Internal Error: " + ErrorMsg.SUPPORT_DIR_MUST_TRUE_FOR_LIST_BUCKETING.getMsg(); SQLState = ErrorMsg.SUPPORT_DIR_MUST_TRUE_FOR_LIST_BUCKETING.getSQLState(); console.printError(errorMessage + "\n"); valid = false; } return valid; }
SQLState = error.getSQLState(); downstreamError = e; console.printError(errorMessage, "\n"