@VisibleForTesting
  static List<Path> getInputPathsWithPool(JobConf job, MapWork work, Path hiveScratchDir,
                                           Context ctx, boolean skipDummy, List<Path> pathsToAdd,
                                           ExecutorService pool) throws IOException, ExecutionException, InterruptedException {
    DriverState driverState = DriverState.getDriverState();
    List<Path> finalPathsToAdd = new ArrayList<>();
    try {
      Map<GetInputPathsCallable, Future<Path>> getPathsCallableToFuture = new LinkedHashMap<>();
      for (final Path path : pathsToAdd) {
        if (driverState != null && driverState.isAborted()) {
          throw new IOException("Operation is Canceled.");
        }
        GetInputPathsCallable callable = new GetInputPathsCallable(path, job, work, hiveScratchDir, ctx, skipDummy);
        getPathsCallableToFuture.put(callable, pool.submit(callable));
      }
      pool.shutdown();

      for (Map.Entry<GetInputPathsCallable, Future<Path>> future : getPathsCallableToFuture.entrySet()) {
        if (driverState != null && driverState.isAborted()) {
          throw new IOException("Operation is Canceled.");
        }

        Path newPath = future.getValue().get();
        updatePathForMapWork(newPath, work, future.getKey().path);
        finalPathsToAdd.add(newPath);
      }
    } finally {
      pool.shutdownNow();
    }
    return finalPathsToAdd;
  }
Computes a list of all input paths needed to compute the given MapWork. All aliases
are considered and a merged list of input paths is returned. If any input path points
to an empty table or partition a dummy file in the scratch dir is instead created and
added to the list. This is needed to avoid special casing the operator pipeline for
these cases.

@param job JobConf used to run the job
@param work MapWork encapsulating the info about the task
@param hiveScratchDir The tmp dir used to create dummy files if needed
@param ctx Context object
@return List of paths to process for the given MapWork
@throws Exception
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java