Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-1865

0.20.0 TableInputFormatBase NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.20.0
    • 0.20.1, 0.90.0
    • None
    • None

    Description

      Spot the bug in this code:

      public List<InputSplit> getSplits(JobContext context) throws IOException {
      byte [][] startKeys = table.getStartKeys();
      if (startKeys == null || startKeys.length == 0)

      { throw new IOException("Expecting at least one region."); }

      if (table == null)

      { throw new IOException("No table was provided."); }

      ...
      }

      Should check if the table is null before calling a method on it.

      Admittedly, this isn't the worst bug in the world, it's really just more of a nuisance in that the "No table was provided" message becomes an NPE

      This bug is in both

      org.apache.hadoop.hbase.mapred.TableInputFormatBase
      org.apache.hadoop.hbase.mapreduce.TableInputFormatBase

      Attachments

        1. 1865.patch
          0.9 kB
          Michael Stack

        Activity

          People

            stack Michael Stack
            cheddar Eric Tschetter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: