spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gatorsmile <...@git.apache.org>
Subject [GitHub] spark pull request #17886: [SPARK-13983][SQL] Fix HiveThriftServer2 can not ...
Date Thu, 01 Feb 2018 17:17:43 GMT
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17886#discussion_r165425929
  
    --- Diff: sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java
---
    @@ -221,6 +227,70 @@ private void configureSession(Map<String, String> sessionConfMap)
throws HiveSQL
         }
       }
     
    +  // Copy from org.apache.hadoop.hive.ql.processors.SetProcessor, only change:
    +  // setConf(varname, propName, varvalue, true) when varname.startsWith(HIVECONF_PREFIX)
    +  public static int setVariable(String varname, String varvalue) throws Exception {
    +    SessionState ss = SessionState.get();
    +    if (varvalue.contains("\n")){
    +      ss.err.println("Warning: Value had a \\n character in it.");
    +    }
    +    varname = varname.trim();
    +    if (varname.startsWith(ENV_PREFIX)){
    +      ss.err.println("env:* variables can not be set.");
    +      return 1;
    +    } else if (varname.startsWith(SYSTEM_PREFIX)){
    +      String propName = varname.substring(SYSTEM_PREFIX.length());
    +      System.getProperties().setProperty(propName,
    +              new VariableSubstitution().substitute(ss.getConf(),varvalue));
    +    } else if (varname.startsWith(HIVECONF_PREFIX)){
    +      String propName = varname.substring(HIVECONF_PREFIX.length());
    +      setConf(varname, propName, varvalue, true);
    --- End diff --
    
    If we just made a change for `HIVECONF_PREFIX`, how does this PR also claim it fixes the
issue of `HIVEVAR_PREFIX`?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message