private static HiveConf.ConfVars getConfVar(String propName) { HiveConf.ConfVars confVars = HiveConf.getConfVars(propName); if (confVars == null) { throw new IllegalArgumentException(propName + " not found"); } return confVars; }
private static HiveConf.ConfVars getConfVar(String propName) { HiveConf.ConfVars confVars = HiveConf.getConfVars(propName); if (confVars == null) throw new IllegalArgumentException(propName + " not found"); return confVars; } }
/** * Utility method for a given RpcConfiguration key, to convert value to millisecond if it is a time value, * and return as string in either case. * @param conf hive configuration * @param key Rpc configuration to lookup (hive.spark.*) * @return string form of the value */ public static String getValue(HiveConf conf, String key) { if (HIVE_SPARK_TIME_CONFIGS.contains(key)) { HiveConf.ConfVars confVar = HiveConf.getConfVars(key); return String.valueOf(conf.getTimeVar(confVar, TimeUnit.MILLISECONDS)); } else { return conf.get(key); } }
private int showConf(Hive db, ShowConfDesc showConf) throws Exception { ConfVars conf = HiveConf.getConfVars(showConf.getConfName()); if (conf == null) { throw new HiveException("invalid configuration name " + showConf.getConfName()); } String description = conf.getDescription(); String defaultValue = conf.getDefaultValue(); DataOutputStream output = getOutputStream(showConf.getResFile()); try { if (defaultValue != null) { output.write(defaultValue.getBytes()); } output.write(separator); output.write(conf.typeString().getBytes()); output.write(separator); if (description != null) { output.write(description.replaceAll(" *\n *", " ").getBytes()); } output.write(terminator); } finally { output.close(); } return 0; }
int result = super.complete(buffer, cursor, clist); if (clist.isEmpty() && cursor > 1 && buffer.charAt(cursor - 1) == '=') { HiveConf.ConfVars var = HiveConf.getConfVars(buffer.substring(0, cursor - 1)); if (var == null) { return result;
HiveConf.ConfVars confVars = HiveConf.getConfVars(key); if (confVars != null) { if (!confVars.isType(value)) {
private int showConf(Hive db, ShowConfDesc showConf) throws Exception { ConfVars conf = HiveConf.getConfVars(showConf.getConfName()); if (conf == null) { throw new HiveException("invalid configuration name " + showConf.getConfName()); } String description = conf.getDescription(); String defaultValue = conf.getDefaultValue(); DataOutputStream output = getOutputStream(showConf.getResFile()); try { if (defaultValue != null) { output.write(defaultValue.getBytes()); } output.write(separator); output.write(conf.typeString().getBytes()); output.write(separator); if (description != null) { output.write(description.replaceAll(" *\n *", " ").getBytes()); } output.write(terminator); } finally { output.close(); } return 0; }
HiveConf.ConfVars confVars = HiveConf.getConfVars(key); if (confVars != null) { if (!confVars.isType(value)) {
continue; ConfVars var = HiveConf.getConfVars(key); if (var == null) { var = HiveConf.getConfVars(key.trim()); if (var != null) { trimmed.add(key);
/** * Utility method for a given RpcConfiguration key, to convert value to millisecond if it is a time value, * and return as string in either case. * @param conf hive configuration * @param key Rpc configuration to lookup (hive.spark.*) * @return string form of the value */ public static String getValue(HiveConf conf, String key) { if (HIVE_SPARK_TIME_CONFIGS.contains(key)) { HiveConf.ConfVars confVar = HiveConf.getConfVars(key); return String.valueOf(conf.getTimeVar(confVar, TimeUnit.MILLISECONDS)); } else { return conf.get(key); } }
/** * Utility method for a given RpcConfiguration key, to convert value to millisecond if it is a time value, * and return as string in either case. * @param conf hive configuration * @param key Rpc configuration to lookup (hive.spark.*) * @return string form of the value */ public static String getValue(HiveConf conf, String key) { if (HIVE_SPARK_TIME_CONFIGS.contains(key)) { HiveConf.ConfVars confVar = HiveConf.getConfVars(key); return String.valueOf(conf.getTimeVar(confVar, TimeUnit.MILLISECONDS)); } else { return conf.get(key); } }
private static void setConf(String varname, String key, String varvalue, boolean register) throws IllegalArgumentException { HiveConf conf = SessionState.get().getConf(); String value = new VariableSubstitution().substitute(conf, varvalue); if (conf.getBoolVar(HiveConf.ConfVars.HIVECONFVALIDATION)) { HiveConf.ConfVars confVars = HiveConf.getConfVars(key); if (confVars != null) { if (!confVars.isType(value)) { StringBuilder message = new StringBuilder(); message.append("'SET ").append(varname).append('=').append(varvalue); message.append("' FAILED because ").append(key).append(" expects "); message.append(confVars.typeString()).append(" type value."); throw new IllegalArgumentException(message.toString()); } String fail = confVars.validate(value); if (fail != null) { StringBuilder message = new StringBuilder(); message.append("'SET ").append(varname).append('=').append(varvalue); message.append("' FAILED in validation : ").append(fail).append('.'); throw new IllegalArgumentException(message.toString()); } } else if (key.startsWith("hive.")) { throw new IllegalArgumentException("hive configuration " + key + " does not exists."); } } conf.verifyAndSet(key, value); if (register) { SessionState.get().getOverriddenConfigurations().put(key, value); } }
private static void setConf(String varname, String key, String varvalue, boolean register) throws IllegalArgumentException { HiveConf conf = SessionState.get().getConf(); String value = new VariableSubstitution().substitute(conf, varvalue); if (conf.getBoolVar(HiveConf.ConfVars.HIVECONFVALIDATION)) { HiveConf.ConfVars confVars = HiveConf.getConfVars(key); if (confVars != null) { if (!confVars.isType(value)) { StringBuilder message = new StringBuilder(); message.append("'SET ").append(varname).append('=').append(varvalue); message.append("' FAILED because ").append(key).append(" expects "); message.append(confVars.typeString()).append(" type value."); throw new IllegalArgumentException(message.toString()); } String fail = confVars.validate(value); if (fail != null) { StringBuilder message = new StringBuilder(); message.append("'SET ").append(varname).append('=').append(varvalue); message.append("' FAILED in validation : ").append(fail).append('.'); throw new IllegalArgumentException(message.toString()); } } else if (key.startsWith("hive.")) { throw new IllegalArgumentException("hive configuration " + key + " does not exists."); } } conf.verifyAndSet(key, value); if (register) { SessionState.get().getOverriddenConfigurations().put(key, value); } }
int result = super.complete(buffer, cursor, clist); if (clist.isEmpty() && cursor > 1 && buffer.charAt(cursor - 1) == '=') { HiveConf.ConfVars var = HiveConf.getConfVars(buffer.substring(0, cursor - 1)); if (var == null) { return result;
private static void setConf(String varname, String key, String varvalue, boolean register) throws IllegalArgumentException { HiveConf conf = SessionState.get().getConf(); String value = new VariableSubstitution().substitute(conf, varvalue); if (conf.getBoolVar(HiveConf.ConfVars.HIVECONFVALIDATION)) { HiveConf.ConfVars confVars = HiveConf.getConfVars(key); if (confVars != null) { if (!confVars.isType(value)) { StringBuilder message = new StringBuilder(); message.append("'SET ").append(varname).append('=').append(varvalue); message.append("' FAILED because ").append(key).append(" expects "); message.append(confVars.typeString()).append(" type value."); throw new IllegalArgumentException(message.toString()); } String fail = confVars.validate(value); if (fail != null) { StringBuilder message = new StringBuilder(); message.append("'SET ").append(varname).append('=').append(varvalue); message.append("' FAILED in validation : ").append(fail).append('.'); throw new IllegalArgumentException(message.toString()); } } else if (key.startsWith("hive.")) { throw new IllegalArgumentException("hive configuration " + key + " does not exists."); } } conf.verifyAndSet(key, value); if (register) { SessionState.get().getOverriddenConfigurations().put(key, value); } }
int result = super.complete(buffer, cursor, clist); if (clist.isEmpty() && cursor > 1 && buffer.charAt(cursor - 1) == '=') { HiveConf.ConfVars var = HiveConf.getConfVars(buffer.substring(0, cursor - 1)); if (var == null) { return result;
int result = super.complete(buffer, cursor, clist); if (clist.isEmpty() && cursor > 1 && buffer.charAt(cursor - 1) == '=') { HiveConf.ConfVars var = HiveConf.getConfVars(buffer.substring(0, cursor - 1)); if (var == null) { return result;
private int showConf(Hive db, ShowConfDesc showConf) throws Exception { ConfVars conf = HiveConf.getConfVars(showConf.getConfName()); if (conf == null) { throw new HiveException("invalid configuration name " + showConf.getConfName()); } String description = conf.getDescription(); String defaultValue = conf.getDefaultValue(); DataOutputStream output = getOutputStream(showConf.getResFile()); try { if (defaultValue != null) { output.write(defaultValue.getBytes()); } output.write(separator); output.write(conf.typeString().getBytes()); output.write(separator); if (description != null) { output.write(description.replaceAll(" *\n *", " ").getBytes()); } output.write(terminator); } finally { output.close(); } return 0; }
continue; ConfVars var = HiveConf.getConfVars(key); if (var == null) { var = HiveConf.getConfVars(key.trim()); if (var != null) { trimmed.add(key);
continue; ConfVars var = HiveConf.getConfVars(key); if (var == null) { var = HiveConf.getConfVars(key.trim()); if (var != null) { trimmed.add(key);