@Test
  public void testExceptDistinct() throws Exception {
    if (!useCbo){
      // Semantic EXCEPT and INTERSECT operations are only supported with Cost Based Optimizations enabled
      return;
    }
    QueryProperties properties = analyze(
        "SELECT t1 FROM test_db.test_table EXCEPT DISTINCT SELECT t2 FROM test_db.test_table", false);
    Assert.assertTrue(properties.hasExcept());
  }
Some unit tests expect the whole analyze process to run, which is the expected, preferred way.
@param sql the query to analyze
@param fullAnalyze whether to run the full analyze or just some parts of it
@return QueryProperties from the analyzer
ql/src/test/org/apache/hadoop/hive/ql/parse/TestQueryProperties.java