public CommandProcessorResponse executeSetVariable(String varname, String varvalue) { try { return setVariable(varname, varvalue); } catch (Exception e) { return new CommandProcessorResponse(1, e.getMessage(), "42000", e instanceof IllegalArgumentException ? null : e); } }
public CommandProcessorResponse executeSetVariable(String varname, String varvalue) { try { return setVariable(varname, varvalue); } catch (Exception e) { return new CommandProcessorResponse(1, e.getMessage(), "42000", e instanceof IllegalArgumentException ? null : e); } }
private void configureSession(Map<String, String> sessionConfMap) throws HiveSQLException { SessionState.setCurrentSessionState(sessionState); for (Map.Entry<String, String> entry : sessionConfMap.entrySet()) { String key = entry.getKey(); if (key.startsWith("set:")) { try { SetProcessor.setVariable(key.substring(4), entry.getValue()); } catch (Exception e) { throw new HiveSQLException(e); } } else if (key.startsWith("use:")) { try { if (sessionHive.getDatabase(entry.getValue()) == null) { throw new HiveSQLException("Database " + entry.getValue() + " does not exist"); } } catch (HiveException e) { throw new HiveSQLException(e); } SessionState.get().setCurrentDatabase(entry.getValue()); } else { sessionConf.verifyAndSet(key, entry.getValue()); } } }
public CommandProcessorResponse executeSetVariable(String varname, String varvalue) { try { return new CommandProcessorResponse(setVariable(varname, varvalue)); } catch (Exception e) { return new CommandProcessorResponse(1, e.getMessage(), "42000", e instanceof IllegalArgumentException ? null : e); } }
private void configureSession(Map<String, String> sessionConfMap) throws HiveSQLException { SessionState.setCurrentSessionState(sessionState); for (Map.Entry<String, String> entry : sessionConfMap.entrySet()) { String key = entry.getKey(); if (key.startsWith("set:")) { try { SetProcessor.setVariable(key.substring(4), entry.getValue()); } catch (Exception e) { throw new HiveSQLException(e); } } else if (key.startsWith("use:")) { SessionState.get().setCurrentDatabase(entry.getValue()); } else { hiveConf.verifyAndSet(key, entry.getValue()); } } }
private void configureSession(Map<String, String> sessionConfMap) throws HiveSQLException { SessionState.setCurrentSessionState(sessionState); for (Map.Entry<String, String> entry : sessionConfMap.entrySet()) { String key = entry.getKey(); if (key.startsWith("set:")) { try { SetProcessor.setVariable(key.substring(4), entry.getValue()); } catch (Exception e) { throw new HiveSQLException(e); } } else if (key.startsWith("use:")) { SessionState.get().setCurrentDatabase(entry.getValue()); } else { hiveConf.verifyAndSet(key, entry.getValue()); } } }
private void configureSession(Map<String, String> sessionConfMap) throws HiveSQLException { SessionState.setCurrentSessionState(sessionState); for (Map.Entry<String, String> entry : sessionConfMap.entrySet()) { String key = entry.getKey(); if (key.startsWith("set:")) { try { SetProcessor.setVariable(key.substring(4), entry.getValue()); } catch (Exception e) { throw new HiveSQLException(e); } } else if (key.startsWith("use:")) { try { if (sessionHive.getDatabase(entry.getValue()) == null) { throw new HiveSQLException("Database " + entry.getValue() + " does not exist"); } } catch (HiveException e) { throw new HiveSQLException(e); } SessionState.get().setCurrentDatabase(entry.getValue()); } else { sessionConf.verifyAndSet(key, entry.getValue()); } } }
return new CommandProcessorResponse(0); return setVariable(part[0],part[1]); } else { return getVariable(nwcmd);