@Override
  public void beforeTest(QTestUtil qt) throws Exception {
    if (missingTables.isEmpty() && tablesToUnload.isEmpty()) {
      return;
    }
    synchronized (QTestUtil.class) {
      qt.newSession(true);
      for (String table : missingTables) {
        if (initDataset(table, qt.getCliDriver())) {
          addSrcTable(table);
        }
      }
      for (String table : tablesToUnload) {
        removeSrcTable(table);
        unloadDataset(table, qt.getCliDriver());
      }
      missingTables.clear();
      tablesToUnload.clear();
      qt.newSession(true);
    }
  }
Datasets are provided by this handler.

An invocation of:

<pre>
--! qt:dataset:sample
--! qt:dataset:sample:ONLY
</pre>

will make sure that the dataset named sample is loaded prior to executing the test.
itests/util/src/main/java/org/apache/hadoop/hive/ql/dataset/QTestDatasetHandler.java