@Override
  protected String getSubstitute(Configuration conf, String var) {
    String val = super.getSubstitute(conf, var);
    if (val == null && hiveVariableSource != null) {
      Map<String, String> vars = hiveVariableSource.getHiveVariable();
      if (var.startsWith(HIVEVAR_PREFIX)) {
        val = vars.get(var.substring(HIVEVAR_PREFIX.length()));
      } else {
        val = vars.get(var);
      }
    }
    return val;
  }
The super method will handle with the case of substitutions for system variables,
hive conf variables and env variables. In this method, it will retrieve the hive
variables using hiveVariableSource.

@param conf
@param var
@return
common/src/java/org/apache/hadoop/hive/conf/VariableSubstitution.java