@BeforeClass
  public static void setupClass() throws Exception {
    incrementalIndex =
        new OnheapIncrementalIndex(
            0,
            QueryGranularity.NONE,
            new AggregatorFactory[] {new CountAggregatorFactory("count")},
            true,
            5000);

    StringInputRowParser parser =
        new StringInputRowParser(
            new CSVParseSpec(
                new TimestampSpec("timestamp", "iso", null),
                new DimensionsSpec(ImmutableList.of("product", "tags"), null, null),
                "\t",
                ImmutableList.of("timestamp", "product", "tags")),
            "UTF-8");

    String[] rows =
        new String[] {
          "2011-01-12T00:00:00.000Z,product_1,t1\tt2\tt3",
          "2011-01-13T00:00:00.000Z,product_2,t3\tt4\tt5",
          "2011-01-14T00:00:00.000Z,product_3,t5\tt6\tt7",
        };

    for (String row : rows) {
      incrementalIndex.add(parser.parse(row));
    }

    persistedSegmentDir = Files.createTempDir();
    TestHelper.getTestIndexMerger()
        .persist(
            incrementalIndex,
            persistedSegmentDir,
            ImmutableMap.<String, Object>of(),
            new IndexSpec());

    queryableIndex = TestHelper.getTestIndexIO().loadIndex(persistedSegmentDir);
  }