@Before
  public void setUp() throws Exception {
    hiveConf = new HiveConfForTest(getClass());
    hiveConf.set(ConfVars.PRE_EXEC_HOOKS.varname, "");
    hiveConf.set(ConfVars.POST_EXEC_HOOKS.varname, "");
    hiveConf.set(ConfVars.METASTORE_WAREHOUSE.varname, TEST_WAREHOUSE_DIR);
    hiveConf.setBoolVar(ConfVars.HIVE_VECTORIZATION_ENABLED, false);
    hiveConf.setVar(ConfVars.HIVE_MAPRED_MODE, "nonstrict");
    hiveConf.setVar(ConfVars.HIVE_INPUT_FORMAT, HiveInputFormat.class.getName());
    hiveConf
        .setVar(ConfVars.HIVE_AUTHORIZATION_MANAGER,
            "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory");
    TestTxnDbUtil.setConfValues(hiveConf);
    hiveConf.setInt(MRJobConfig.MAP_MEMORY_MB, 1024);
    hiveConf.setInt(MRJobConfig.REDUCE_MEMORY_MB, 1024);
    TestTxnDbUtil.prepDb(hiveConf);
    File f = new File(TEST_WAREHOUSE_DIR);
    if (f.exists()) {
      FileUtil.fullyDelete(f);
    }
    if (!(new File(TEST_WAREHOUSE_DIR).mkdirs())) {
      throw new RuntimeException("Could not create " + TEST_WAREHOUSE_DIR);
    }
    SessionState.start(new SessionState(hiveConf));
    d = DriverFactory.newDriver(hiveConf);
    dropTables();
    runStatementOnDriver("create table " + Table.TBL_SOURCE + "(name string, age int, gpa double) " +
            "clustered by (name) into " + BUCKET_COUNT + " buckets stored as orc " + getTblProperties(), hiveConf);
    runStatementOnDriver("create table " + Table.TBL_CHECK_MERGE
        + "(name string, age int, gpa double  CHECK (gpa BETWEEN 0.0 AND 4.0)) " +
            "clustered by (name) into " + BUCKET_COUNT + " buckets stored as orc " + getTblProperties(), hiveConf);
    runStatementOnDriver("insert into " + Table.TBL_SOURCE + "(name, age, gpa) values " +
            "('student1', 16, null)," +
            "(null, 20, 4.0)", hiveConf);
  }
This class resides in itests to facilitate running query using Tez engine, since the jars are
fully loaded here, which is not the case if it stays in ql.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/TestConstraintsMerge.java