private void updateNumRows() {
    if (runtimeContext.counters != null) {
      TezCounter counter = runtimeContext.counters.findCounter(
        conf.getVar(HiveConf.ConfVars.HIVE_COUNTER_GROUP), FileSinkOperator.TOTAL_TABLE_ROWS_WRITTEN);
      if (counter != null) {
        queryState.setNumModifiedRows(counter.getValue());
      }
    }
  }
Making TezTask backward compatible with the old MR-based Task API (ExecDriver/MapRedTask)
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezTask.java