public static List<String> runStatementOnDriver(String stmt, HiveConf conf)
      throws Exception {
    IDriver driver = DriverFactory.newDriver(conf);
    driver.setMaxRows(10000);
    driver.run(stmt);
    List<String> rs = new ArrayList<String>();
    driver.getResults(rs);
    return rs;
  }
Run statement with customized hive conf
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/TestAcidOnTez.java