@Test
  public void test7() throws ParseException {
    ASTNode ast = parse("merge into acidTbl" + 
      " using nonAcidPart2 source ON acidTbl.a = source.a2 " +
      "WHEN MATCHED THEN UPDATE set b = source.b2 " +
      "WHEN NOT MATCHED THEN INSERT VALUES(source.a2, source.b2)");
    Assert.assertEquals(ast.toStringTree(), 
      "(tok_merge " +
        "(tok_tabref (tok_tabname acidtbl)) (tok_tabref (tok_tabname nonacidpart2) source) " +
        "(= (. (tok_table_or_col acidtbl) a) (. (tok_table_or_col source) a2)) " +
        "(tok_matched " +
          "(tok_update " +
            "(tok_set_columns_clause (= (tok_table_or_col b) (. (tok_table_or_col source) b2))))) " +
        "(tok_not_matched " +
          "(tok_insert " +
            "(tok_function struct (. (tok_table_or_col source) a2) (. (tok_table_or_col source) b2)))))");
  }
here we reverse the order of WHEN MATCHED/WHEN NOT MATCHED - should we allow it?
@throws ParseException
parser/src/test/org/apache/hadoop/hive/ql/parse/TestMergeStatement.java