Tabnine Logo
VariableSubstitution
Code IndexAdd Tabnine to your IDE (free)

How to use
VariableSubstitution
in
org.apache.hadoop.hive.conf

Best Java code snippets using org.apache.hadoop.hive.conf.VariableSubstitution (Showing top 20 results out of 315)

origin: apache/hive

public String substituteVariables(HiveConf conf, String line) {
 if (!beeLine.isBeeLine()) {
  // Substitution is only supported in non-beeline mode.
  return new VariableSubstitution(new HiveVariableSource() {
   @Override
   public Map<String, String> getHiveVariable() {
    return getHiveVariables();
   }
  }).substitute(conf, line);
 }
 return line;
}
origin: apache/hive

 public String substitute(HiveConf conf, String expr) {
  if (expr == null) {
   return expr;
  }
  if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVEVARIABLESUBSTITUTE)) {
   l4j.debug("Substitution is on: " + expr);
  } else {
   return expr;
  }
  int depth = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVEVARIABLESUBSTITUTEDEPTH);
  return substitute(conf, expr, depth);
 }
}
origin: com.klarna/hiverunner

  public VariableSubstitution getVariableSubstitution() {
    // Make sure to set the session state for this thread before returning the VariableSubstitution. If not set,
    // hivevar:s will not be evaluated.
    SessionState.setCurrentSessionState(currentSessionState);

    final SessionState ss = currentSessionState;
    return new VariableSubstitution(new HiveVariableSource() {
      @Override
      public Map<String, String> getHiveVariable() {
        return ss.getHiveVariables();
      }
    });

  }
}
origin: org.apache.hive/hive-common

 public String substitute(HiveConf conf, String expr) {
  if (expr == null) {
   return expr;
  }
  if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVEVARIABLESUBSTITUTE)) {
   l4j.debug("Substitution is on: " + expr);
  } else {
   return expr;
  }
  int depth = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVEVARIABLESUBSTITUTEDEPTH);
  return substitute(conf, expr, depth);
 }
}
origin: klarna/HiveRunner

  public VariableSubstitution getVariableSubstitution() {
    // Make sure to set the session state for this thread before returning the VariableSubstitution. If not set,
    // hivevar:s will not be evaluated.
    SessionState.setCurrentSessionState(currentSessionState);

    final SessionState ss = currentSessionState;
    return new VariableSubstitution(new HiveVariableSource() {
      @Override
      public Map<String, String> getHiveVariable() {
        return ss.getHiveVariables();
      }
    });

  }
}
origin: apache/hive

@Override
public CommandProcessorResponse run(String command) {
 SessionState ss = SessionState.get();
 command = new VariableSubstitution(() -> SessionState.get().getHiveVariables()).substitute(ss.getConf(), command);
 String[] tokens = command.split("\\s+");
 if (tokens.length < 1) {
  return returnErrorResponse("Command arguments are empty.");
 }
 String params[] = Arrays.copyOfRange(tokens, 1, tokens.length);
 try {
  return llapCacheCommandHandler(ss, params);
 } catch (Exception e) {
  return returnErrorResponse(e.getMessage());
 }
}
origin: klarna/HiveRunner

public String expandVariableSubstitutes(String expression) {
  return getVariableSubstitution().substitute(getHiveConf(), expression);
}
origin: apache/hive

@Override
public CommandProcessorResponse run(String command) {
 SessionState ss = SessionState.get();
 command = new VariableSubstitution(() -> SessionState.get().getHiveVariables()).substitute(ss.getConf(), command);
 String[] tokens = command.split("\\s+");
 if (tokens.length < 1) {
  return returnErrorResponse("Command arguments are empty.");
 }
 String params[] = Arrays.copyOfRange(tokens, 1, tokens.length);
 try {
  return llapClusterCommandHandler(ss, params);
 } catch (Exception e) {
  return returnErrorResponse(e.getMessage());
 }
}
origin: com.klarna/hiverunner

public String expandVariableSubstitutes(String expression) {
  return getVariableSubstitution().substitute(getHiveConf(), expression);
}
origin: apache/hive

String result = null;
HiveConf conf = ss.getConf();
String value = new VariableSubstitution(new HiveVariableSource() {
 @Override
 public Map<String, String> getHiveVariable() {
  return ss.getHiveVariables();
}).substitute(conf, varvalue);
if (conf.getBoolVar(HiveConf.ConfVars.HIVECONFVALIDATION)) {
 HiveConf.ConfVars confVars = HiveConf.getConfVars(key);
origin: com.klarna/hiverunner

@Override
public String expandVariableSubstitutes(String expression) {
  assertStarted();
  HiveConf hiveConf = getHiveConf();
  Preconditions.checkNotNull(hiveConf);
  return hiveServerContainer.getVariableSubstitution().substitute(hiveConf, expression);
}
origin: apache/drill

rewrittenQuery = new VariableSubstitution(new HiveVariableSource() {
 @Override
 public Map<String, String> getHiveVariable() {
  return SessionState.get().getHiveVariables();
}).substitute(conf, rewrittenQuery);
return rewrittenQuery;
origin: klarna/HiveRunner

@Override
public String expandVariableSubstitutes(String expression) {
  assertStarted();
  HiveConf hiveConf = getHiveConf();
  Preconditions.checkNotNull(hiveConf);
  return hiveServerContainer.getVariableSubstitution().substitute(hiveConf, expression);
}
origin: apache/hive

 String propName = varname.substring(SYSTEM_PREFIX.length());
 System.getProperties()
   .setProperty(propName, new VariableSubstitution(new HiveVariableSource() {
    @Override
    public Map<String, String> getHiveVariable() {
     return SessionState.get().getHiveVariables();
   }).substitute(ss.getConf(), varvalue));
} else if (varname.startsWith(HIVECONF_PREFIX)){
 String propName = varname.substring(HIVECONF_PREFIX.length());
} else if (varname.startsWith(HIVEVAR_PREFIX)) {
 String propName = varname.substring(HIVEVAR_PREFIX.length());
 ss.getHiveVariables().put(propName, new VariableSubstitution(new HiveVariableSource() {
  @Override
  public Map<String, String> getHiveVariable() {
   return SessionState.get().getHiveVariables();
 }).substitute(ss.getConf(), varvalue));
} else if (varname.startsWith(METACONF_PREFIX)) {
 String propName = varname.substring(METACONF_PREFIX.length());
 Hive hive = Hive.get(ss.getConf());
 hive.setMetaConf(propName, new VariableSubstitution(new HiveVariableSource() {
  @Override
  public Map<String, String> getHiveVariable() {
   return SessionState.get().getHiveVariables();
 }).substitute(ss.getConf(), varvalue));
} else {
origin: apache/hive

rewrittenQuery = new VariableSubstitution(new HiveVariableSource() {
 @Override
 public Map<String, String> getHiveVariable() {
  return SessionState.get().getHiveVariables();
}).substitute(conf, rewrittenQuery);
return rewrittenQuery;
origin: apache/hive

void parse(SessionState ss) throws CompileProcessorException {
 if (ss != null){
  command = new VariableSubstitution(new HiveVariableSource() {
   @Override
   public Map<String, String> getHiveVariable() {
    return SessionState.get().getHiveVariables();
  }).substitute(ss.getConf(), command);
origin: apache/drill

String result = null;
HiveConf conf = SessionState.get().getConf();
String value = new VariableSubstitution(new HiveVariableSource() {
 @Override
 public Map<String, String> getHiveVariable() {
  return SessionState.get().getHiveVariables();
}).substitute(conf, varvalue);
if (conf.getBoolVar(HiveConf.ConfVars.HIVECONFVALIDATION)) {
 HiveConf.ConfVars confVars = HiveConf.getConfVars(key);
origin: apache/drill

 String propName = varname.substring(SYSTEM_PREFIX.length());
 System.getProperties()
   .setProperty(propName, new VariableSubstitution(new HiveVariableSource() {
    @Override
    public Map<String, String> getHiveVariable() {
     return SessionState.get().getHiveVariables();
   }).substitute(ss.getConf(), varvalue));
} else if (varname.startsWith(HIVECONF_PREFIX)){
 String propName = varname.substring(HIVECONF_PREFIX.length());
} else if (varname.startsWith(HIVEVAR_PREFIX)) {
 String propName = varname.substring(HIVEVAR_PREFIX.length());
 ss.getHiveVariables().put(propName, new VariableSubstitution(new HiveVariableSource() {
  @Override
  public Map<String, String> getHiveVariable() {
   return SessionState.get().getHiveVariables();
 }).substitute(ss.getConf(), varvalue));
} else if (varname.startsWith(METACONF_PREFIX)) {
 String propName = varname.substring(METACONF_PREFIX.length());
 Hive hive = Hive.get(ss.getConf());
 hive.setMetaConf(propName, new VariableSubstitution(new HiveVariableSource() {
  @Override
  public Map<String, String> getHiveVariable() {
   return SessionState.get().getHiveVariables();
 }).substitute(ss.getConf(), varvalue));
} else {
origin: apache/drill

void parse(SessionState ss) throws CompileProcessorException {
 if (ss != null){
  command = new VariableSubstitution(new HiveVariableSource() {
   @Override
   public Map<String, String> getHiveVariable() {
    return SessionState.get().getHiveVariables();
  }).substitute(ss.getConf(), command);
origin: apache/hive

 @Test public void testVariableSource() throws InterruptedException {
  final VariableSubstitution variableSubstitution =
    new VariableSubstitution(new HiveVariableSource() {
     @Override public Map<String, String> getHiveVariable() {
      return TestVariableSubstitution.getMySource().map;
     }
    });

  String v = variableSubstitution.substitute(new HiveConf(), "${a}");
  Assert.assertEquals("${a}", v);
  TestVariableSubstitution.getMySource().put("a", "b");
  v = variableSubstitution.substitute(new HiveConf(), "${a}");
  Assert.assertEquals("b", v);
 }
}
org.apache.hadoop.hive.confVariableSubstitution

Most used methods

  • substitute
  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Path (java.nio.file)
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now