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;
  }
Extract and clean up the first command in the input.
beeline/src/java/org/apache/hive/beeline/Commands.java