@Override
  public InputSplit[] getSplits(JobConf jobConf, int numSplits) throws IOException {
    final AccumuloConnectionParameters accumuloParams = new AccumuloConnectionParameters(jobConf);
    final Instance instance = accumuloParams.getInstance();
    final ColumnMapper columnMapper;
    try {
      columnMapper = getColumnMapper(jobConf);
    } catch (TooManyAccumuloColumnsException e) {
      throw new IOException(e);
    }

    JobContext context = ShimLoader.getHadoopShims().newJobContext(Job.getInstance(jobConf));
    Path[] tablePaths = FileInputFormat.getInputPaths(context);

    try {
      Connector connector = null;

      // Need to get a Connector so we look up the user's authorizations if not otherwise specified
      if (accumuloParams.useSasl()) {
        log.info("Current user: " + UserGroupInformation.getCurrentUser());
        // In a YARN/Tez job, don't have the Kerberos credentials anymore, use the delegation token
        AuthenticationToken token = ConfiguratorBase.getAuthenticationToken(
            AccumuloInputFormat.class, jobConf);
        if (null != token && !jobConf.getCredentials().getAllTokens().isEmpty()) {
          // Convert the stub from the configuration back into a normal Token
          log.info("Found authentication token in Configuration: " + token);
          log.info("Job credential tokens: " + jobConf.getCredentials().getAllTokens());
          AuthenticationToken unwrappedToken = ConfiguratorBase.unwrapAuthenticationToken(jobConf, token);
          log.info("Converted authentication token from Configuration into: " + unwrappedToken);
          // It's possible that the Job doesn't have the token in its credentials. In this case, unwrapAuthenticationToken
          // will return back the original token (which we know is insufficient)
          if (unwrappedToken != token) {
            log.info("Creating Accumulo Connector with unwrapped delegation token");
            connector = instance.getConnector(accumuloParams.getAccumuloUserName(), unwrappedToken);
          } else {
            log.info("Job credentials did not contain delegation token, fetching new token");
          }
        }

        if (connector == null) {
          log.info("Obtaining Accumulo Connector using KerberosToken");
          // Construct a KerberosToken -- relies on ProxyUser configuration. Will be the client making
          // the request on top of the HS2's user. Accumulo will require proper proxy-user auth configs.
          connector = instance.getConnector(accumuloParams.getAccumuloUserName(), new KerberosToken(accumuloParams.getAccumuloUserName()));
        }
      } else {
        // Still in the local JVM, use the username+password or Kerberos credentials
        connector = accumuloParams.getConnector(instance);
      }

      final List<ColumnMapping> columnMappings = columnMapper.getColumnMappings();
      final List<IteratorSetting> iterators = predicateHandler.getIterators(jobConf, columnMapper);
      final Collection<Range> ranges = predicateHandler.getRanges(jobConf, columnMapper);

      // Setting an empty collection of ranges will, unexpectedly, scan all data
      // We don't want that.
      if (null != ranges && ranges.isEmpty()) {
        return new InputSplit[0];
      }

      // Set the relevant information in the Configuration for the AccumuloInputFormat
      configure(jobConf, instance, connector, accumuloParams, columnMapper, iterators, ranges);

      int numColumns = columnMappings.size();

      List<Integer> readColIds = ColumnProjectionUtils.getReadColumnIDs(jobConf);

      // Sanity check
      if (numColumns < readColIds.size())
        throw new IOException("Number of column mappings (" + numColumns + ")"
            + " numbers less than the hive table columns. (" + readColIds.size() + ")");

      // get splits from Accumulo
      InputSplit[] splits = accumuloInputFormat.getSplits(jobConf, numSplits);

      HiveAccumuloSplit[] hiveSplits = new HiveAccumuloSplit[splits.length];
      for (int i = 0; i < splits.length; i++) {
        RangeInputSplit ris = (RangeInputSplit) splits[i];
        ris.setLogLevel(Level.DEBUG);
        hiveSplits[i] = new HiveAccumuloSplit(ris, tablePaths[0]);
      }

      return hiveSplits;
    } catch (AccumuloException e) {
      log.error("Could not configure AccumuloInputFormat", e);
      throw new IOException(StringUtils.stringifyException(e));
    } catch (AccumuloSecurityException e) {
      log.error("Could not configure AccumuloInputFormat", e);
      throw new IOException(StringUtils.stringifyException(e));
    } catch (SerDeException e) {
      log.error("Could not configure AccumuloInputFormat", e);
      throw new IOException(StringUtils.stringifyException(e));
    }
  }
Wraps older InputFormat for use with Hive.

Configure input scan with proper ranges, iterators, and columns based on serde properties for
Hive table.
accumulo-handler/src/java/org/apache/hadoop/hive/accumulo/mr/HiveAccumuloTableInputFormat.java