Package org.apache.hadoop.hive.ql.parse

Examples of org.apache.hadoop.hive.ql.parse.VariableSubstitution


  public CommandProcessorResponse run(String command) {


    try {
      SessionState ss = SessionState.get();
      command = new VariableSubstitution().substitute(ss.getConf(),command);

      String[] tokens = command.split("\\s+");
      PrintStream oldOut = System.out;

      if (ss != null && ss.out != null) {
View Full Code Here


  public void init() {
  }

  public CommandProcessorResponse run(String command) {
    SessionState ss = SessionState.get();
    command = new VariableSubstitution().substitute(ss.getConf(),command);
    String[] tokens = command.split("\\s+");
    SessionState.ResourceType t;
    if (tokens.length < 2
        || (t = SessionState.find_resource_type(tokens[0])) == null) {
      console.printError("Usage: add ["
View Full Code Here

   * @throws CompileProcessorException if the code can not be compiled or the jar can not be made
   */
  @VisibleForTesting
  void parse(SessionState ss) throws CompileProcessorException {
    if (ss != null){
      command = new VariableSubstitution().substitute(ss.getConf(), command);
    }
    if (command == null || command.length() == 0) {
      throw new CompileProcessorException("Command was empty");
    }
    StringBuilder toCompile = new StringBuilder();
View Full Code Here

  public void init() {
  }

  public CommandProcessorResponse run(String command) {
    SessionState ss = SessionState.get();
    command = new VariableSubstitution().substitute(ss.getConf(),command);
    String[] tokens = command.split("\\s+");

    SessionState.ResourceType t;
    if (tokens.length < 1
        || (t = SessionState.find_resource_type(tokens[0])) == null) {
View Full Code Here

      TaskFactory.resetId();
    }
    saveSession(queryState);

    try {
      command = new VariableSubstitution().substitute(conf,command);
      ctx = new Context(conf);
      ctx.setTryCount(getTryCount());
      ctx.setCmd(command);
      ctx.setHDFSCleanup(true);
View Full Code Here

  public CommandProcessorResponse run(String command) {


    try {
      SessionState ss = SessionState.get();
      command = new VariableSubstitution().substitute(ss.getConf(),command);

      String[] tokens = command.split("\\s+");
      PrintStream oldOut = System.out;

      if (ss != null && ss.out != null) {
View Full Code Here

      TaskFactory.resetId();
    }
    saveSession(queryState);

    try {
      command = new VariableSubstitution().substitute(conf,command);
      ctx = new Context(conf);
      ctx.setTryCount(getTryCount());
      ctx.setCmd(command);
      ctx.setHDFSCleanup(true);
View Full Code Here

      // In Hive server mode, we are not able to retry in the FetchTask
      // case, when calling fetch queries since execute() has returned.
      // For now, we disable the test attempts.
      driver.setTryCount(Integer.MAX_VALUE);

      String subStatement = new VariableSubstitution().substitute(sqlOperationConf, statement);
      response = driver.compileAndRespond(subStatement);
      if (0 != response.getResponseCode()) {
        throw new HiveSQLException("Error while compiling statement: "
            + response.getErrorMessage(), response.getSQLState(), response.getResponseCode());
      }
View Full Code Here

      TaskFactory.resetId();
    }
    saveSession(queryState);

    try {
      command = new VariableSubstitution().substitute(conf,command);
      ctx = new Context(conf);
      ctx.setTryCount(getTryCount());
      ctx.setCmd(command);
      ctx.setHDFSCleanup(true);
View Full Code Here

    if (varname.startsWith(SetProcessor.ENV_PREFIX)){
      ss.err.println("env:* variables can not be set.");
      return new CommandProcessorResponse(1);
    } else if (varname.startsWith(SetProcessor.SYSTEM_PREFIX)){
      String propName = varname.substring(SetProcessor.SYSTEM_PREFIX.length());
      System.getProperties().setProperty(propName, new VariableSubstitution().substitute(ss.getConf(),varvalue));
      return new CommandProcessorResponse(0);
    } else if (varname.startsWith(SetProcessor.HIVECONF_PREFIX)){
      String propName = varname.substring(SetProcessor.HIVECONF_PREFIX.length());
      try {
        setConf(varname, propName, varvalue, false);
        return new CommandProcessorResponse(0);
      } catch (IllegalArgumentException e) {
        return new CommandProcessorResponse(1, e.getMessage(), "42000");
      }
    } else if (varname.startsWith(SetProcessor.HIVEVAR_PREFIX)) {
      String propName = varname.substring(SetProcessor.HIVEVAR_PREFIX.length());
      ss.getHiveVariables().put(propName, new VariableSubstitution().substitute(ss.getConf(),varvalue));
      return new CommandProcessorResponse(0);
    } else {
      try {
        setConf(varname, varname, varvalue, true);
        return new CommandProcessorResponse(0);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.parse.VariableSubstitution

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.