@Test
  public void testGetSplitsLocksWithMaterializedView() throws Exception {
    // Need to test this with LLAP settings, which requires some additional configurations set.
    hiveConf.setVar(ConfVars.HIVE_FETCH_TASK_CONVERSION, "more");
    hiveConf.setVar(HiveConf.ConfVars.LLAP_DAEMON_SERVICE_HOSTS, "localhost");

    // SessionState/Driver needs to be restarted with the Tez conf settings.
    restartSessionAndDriver(hiveConf);
    TxnStore txnHandler = TxnUtils.getTxnStore(hiveConf);
    String mvName = "mv_acidTbl";
    try {
      runStatementOnDriver("create materialized view " + mvName + " as select a from " + Table.ACIDTBL + " where a > 5");

      // Request LLAP splits for a table.
      String queryParam = "select a from " + Table.ACIDTBL + " where a > 5";
      runStatementOnDriver("select get_splits(\"" + queryParam + "\", 1)");

      // The get_splits call should have resulted in a lock on ACIDTBL and materialized view mv_acidTbl
      ShowLocksResponse slr = txnHandler.showLocks(new ShowLocksRequest());
      TestTxnDbUtil.checkLock(LockType.SHARED_READ, LockState.ACQUIRED,
              "default", Table.ACIDTBL.name, null, slr.getLocks());
      TestTxnDbUtil.checkLock(LockType.SHARED_READ, LockState.ACQUIRED,
              "default", mvName, null, slr.getLocks());
      assertEquals(2, slr.getLocksSize());
    } finally {
      // Close the session which should free up the TxnHandler/locks held by the session.
      // Done in the finally block to make sure we free up the locks; otherwise
      // the cleanup in tearDown() will get stuck waiting on the lock held here on ACIDTBL.
      restartSessionAndDriver(hiveConf);
      runStatementOnDriver("drop materialized view if exists " + mvName);
    }

    // Lock should be freed up now.
    ShowLocksResponse slr = txnHandler.showLocks(new ShowLocksRequest());
    assertEquals(0, slr.getLocksSize());

    List<String> rows = runStatementOnDriver("show transactions");
    // Transactions should be committed.
    // No transactions - just the header row
    assertEquals(1, rows.size());
  }
1. Insert into unbucketed acid table from Union all - union is removed and data is placed in
subdirs of target table.
2. convert to acid table and check data
3. compact and check data
Compare with {@link #testInsertWithRemoveUnion()} where T is transactional=false
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/TestAcidOnTez.java