@Test
  public void testAccuracy2() throws IOException {
    fileSystem.mkdirs(symlinkDir);

    FileInputFormat.setInputPaths(job, symlinkDir);

    SymlinkTextInputFormat inputFormat = new SymlinkTextInputFormat();

    ContentSummary cs = inputFormat.getContentSummary(symlinkDir, job);

    assertEquals(0, cs.getLength());
    assertEquals(0, cs.getFileCount());
    assertEquals(0, cs.getDirectoryCount());

    InputSplit[] splits = inputFormat.getSplits(job, 2);

    log.info("Number of splits: " + splits.length);

    // Read all values.
    List<String> received = new ArrayList<String>();
    for (InputSplit split : splits) {
      RecordReader<LongWritable, Text> reader =
          inputFormat.getRecordReader(split, job, reporter);

      LongWritable key = reader.createKey();
      Text value = reader.createValue();
      while (reader.next(key, value)) {
        received.add(value.toString());
      }
      reader.close();
    }

    List<String> expected = new ArrayList<String>();

    assertEquals(expected, received);
  }
Scenario: Empty input directory, i.e. no symlink file.

Expected: Should return empty result set without any exception.
ql/src/test/org/apache/hadoop/hive/ql/io/TestSymlinkTextInputFormat.java