@Override public boolean nextKeyValue() {
    // Results

    if (getQueryResultsIterator().hasNext()) {
      final Row row = getQueryResultsIterator().next();
      // currently druid supports only MapBasedRow as Jackson SerDe so it should safe to cast without check
      currentRow = (MapBasedRow) row;
      currentEvent = currentRow.getEvent();
      return true;
    }
    return false;
  }
Record reader for results for Druid GroupByQuery.
druid-handler/src/java/org/apache/hadoop/hive/druid/serde/DruidGroupByQueryRecordReader.java