@VisibleForTesting
  static int getMaxExecutorsForInputListing(final Configuration conf, int inputLocationListSize) {
    if (inputLocationListSize < 1) {
      return 0;
    }

    int maxExecutors = 1;

    if (inputLocationListSize > 1) {
      int listingMaxThreads = HiveConf.getIntVar(conf, ConfVars.HIVE_EXEC_INPUT_LISTING_MAX_THREADS);

      // DEPRECATED_MAPRED_DFSCLIENT_PARALLELISM_MAX must be removed on next Hive version (probably on 3.0).
      // If HIVE_EXEC_INPUT_LISTING_MAX_THREADS is not set, then we check of the deprecated configuration.
      if (listingMaxThreads <= 0) {
        listingMaxThreads = conf.getInt(DEPRECATED_MAPRED_DFSCLIENT_PARALLELISM_MAX, 0);
        if (listingMaxThreads > 0) {
          LOG.warn("Deprecated configuration is used: {}. Please use {}",
              DEPRECATED_MAPRED_DFSCLIENT_PARALLELISM_MAX,
              ConfVars.HIVE_EXEC_INPUT_LISTING_MAX_THREADS.varname);
        }
      }

      if (listingMaxThreads > 1) {
        maxExecutors = Math.min(inputLocationListSize, listingMaxThreads);
      }
    }

    return maxExecutors;
  }
Returns the maximum number of executors required to get file information from several input locations.
It checks whether HIVE_EXEC_INPUT_LISTING_MAX_THREADS or DEPRECATED_MAPRED_DFSCLIENT_PARALLELISM_MAX are > 1

@param conf Configuration object to get the maximum number of threads.
@param inputLocationListSize Number of input locations required to process.
@return The maximum number of executors to use.
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java