@Test
  public void testMajor() throws Exception {
    AlterTableCompactDesc desc =
        parseAndAnalyzeAlterTable("alter table foo partition(ds = 'today') compact 'major'");
    Assert.assertEquals("major", desc.getCompactionType());
    Assert.assertEquals("default.foo", desc.getTableName());
    Map<String, String> parts = desc.getPartitionSpec();
    Assert.assertEquals(1, parts.size());
    Assert.assertEquals("today", parts.get("ds"));
  }
Tests for parsing and semantic analysis of ALTER TABLE ... compact.
ql/src/test/org/apache/hadoop/hive/ql/parse/TestQBCompact.java