private List<KuduInputSplit> computeSplits(Configuration conf) throws IOException {
    try (KuduClient client = KuduHiveUtils.getKuduClient(conf)) {
      // Hive depends on FileSplits so we get the dummy Path for the Splits.
      Job job = Job.getInstance(conf);
      JobContext jobContext = ShimLoader.getHadoopShims().newJobContext(job);
      Path[] paths = FileInputFormat.getInputPaths(jobContext);
      Path dummyPath = paths[0];

      String tableName = conf.get(KUDU_TABLE_NAME_KEY);
      if (StringUtils.isEmpty(tableName)) {
        throw new IllegalArgumentException(KUDU_TABLE_NAME_KEY + " is not set.");
      }
      if (!client.tableExists(tableName)) {
        throw new IllegalArgumentException("Kudu table does not exist: " + tableName);
      }

      KuduTable table = client.openTable(tableName);
      List<KuduPredicate> predicates = KuduPredicateHandler.getPredicates(conf, table.getSchema());

      KuduScanToken.KuduScanTokenBuilder tokenBuilder = client.newScanTokenBuilder(table)
          .setProjectedColumnNames(getProjectedColumns(conf));

      for (KuduPredicate predicate : predicates) {
        tokenBuilder.addPredicate(predicate);
      }
      List<KuduScanToken> tokens = tokenBuilder.build();

      List<KuduInputSplit> splits = new ArrayList<>(tokens.size());
      for (KuduScanToken token : tokens) {
        List<String> locations = new ArrayList<>(token.getTablet().getReplicas().size());
        for (LocatedTablet.Replica replica : token.getTablet().getReplicas()) {
          locations.add(replica.getRpcHost());
        }
        splits.add(new KuduInputSplit(token, dummyPath, locations.toArray(new String[0])));
      }
      return splits;
    }
  }
A Kudu InputFormat implementation for use by Hive.
kudu-handler/src/java/org/apache/hadoop/hive/kudu/KuduInputFormat.java