hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nemon Lou (JIRA)" <>
Subject [jira] [Commented] (HIVE-12538) After set spark related config, SparkSession never get reused
Date Sat, 28 Nov 2015 06:28:10 GMT


Nemon Lou commented on HIVE-12538:

After debugging ,i find the problem is that ,the operation conf object SparkUtilities used
to detect configuration change is different from session conf.
And the session conf object 's getSparkConfigUpdated method always return true after setting
spark related config.
The code path where SQLOperation copy a new conf object from session conf:
   * If there are query specific settings to overlay, then create a copy of config
   * There are two cases we need to clone the session config that's being passed to hive driver
   * 1. Async query -
   *    If the client changes a config setting, that shouldn't reflect in the execution already
   * 2. confOverlay -
   *    The query specific settings should only be applied to the query config and not session
   * @return new configuration
   * @throws HiveSQLException
  private HiveConf getConfigForOperation() throws HiveSQLException {
    HiveConf sqlOperationConf = getParentSession().getHiveConf();
    if (!getConfOverlay().isEmpty() || shouldRunAsync()) {
      // clone the partent session config for this query
      sqlOperationConf = new HiveConf(sqlOperationConf);

      // apply overlay query specific settings, if any
      for (Map.Entry<String, String> confEntry : getConfOverlay().entrySet()) {
        try {
          sqlOperationConf.verifyAndSet(confEntry.getKey(), confEntry.getValue());
        } catch (IllegalArgumentException e) {
          throw new HiveSQLException("Error applying statement specific settings", e);
    return sqlOperationConf;
The code path where SparkUtilities detect the change and close the spark session :
public static SparkSession getSparkSession(HiveConf conf,
      SparkSessionManager sparkSessionManager) throws HiveException {
    SparkSession sparkSession = SessionState.get().getSparkSession();

    // Spark configurations are updated close the existing session
    if (conf.getSparkConfigUpdated()) {
      sparkSession =  null;
    sparkSession = sparkSessionManager.getSession(sparkSession, conf, true);
    return sparkSession;

It shoud be easy to reproduce, i will dig more.

> After set spark related config, SparkSession never get reused
> -------------------------------------------------------------
>                 Key: HIVE-12538
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>          Components: Spark
>    Affects Versions: 1.3.0
>            Reporter: Nemon Lou
> Hive on Spark yarn-cluster mode.
> After setting "set spark.yarn.queue=QueueA;" ,
> run the query "select count(*) from test"  3 times and you will find  3 different yarn

This message was sent by Atlassian JIRA

View raw message