@Test
  public void testGetStagingDirEncryptedWithMV() throws Exception {
    Table table = createTable(TABLE, primary.warehouseRoot);
    QB qb = createQB(table);
    Context ctx = new Context(conf);
    ctx.setIsLoadingMaterializedView(true);
    Path path = SemanticAnalyzer.getStagingDirectoryPathname(qb, conf, ctx);
    Assert.assertFalse(miniDFSCluster.getFileSystem().exists(path.getParent()));
  }
Test to make sure staging directory is not created when the
isLoadingMaterializedView flag is true and the file system
is encrypted.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestParseUtilsStagingDir.java