@Override
    protected void initialize(JobContext job) throws IOException {
      Connection connection =
        ConnectionFactory.createConnection(HBaseConfiguration.create(job.getConfiguration()));
      TableName tableName = TableName.valueOf("exampleTable");
      // mandatory
      initializeTable(connection, tableName);
      byte[][] inputColumns = new byte[][] { Bytes.toBytes("columnA"), Bytes.toBytes("columnB") };
      // optional
      Scan scan = new Scan();
      for (byte[] family : inputColumns) {
        scan.addFamily(family);
      }
      Filter exampleFilter =
        new RowFilter(CompareOperator.EQUAL, new RegexStringComparator("aa.*"));
      scan.setFilter(exampleFilter);
      setScan(scan);
    }
Verify the example we present in javadocs on TableInputFormatBase
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormat.java