@Test
  public void test5() throws ParseException {
    ASTNode
      ast = parse(
      "MERGE INTO target USING source ON target.pk = source.pk WHEN MATCHED THEN UPDATE set a = source.b, c=d+1 WHEN NOT MATCHED THEN INSERT VALUES(source.a, 2, current_date())");
    Assert.assertEquals(
      "(tok_merge " +
        "(tok_tabref (tok_tabname target)) (tok_tabref (tok_tabname source)) (= (. (tok_table_or_col target) pk) (. (tok_table_or_col source) pk)) " +
        "(tok_matched " +
          "(tok_update " +
            "(tok_set_columns_clause (= (tok_table_or_col a) (. (tok_table_or_col source) b)) (= (tok_table_or_col c) (+ (tok_table_or_col d) 1)))" +
          ")" +
        ") " +
        "(tok_not_matched " +
          "(tok_insert " +
            "(tok_function struct " +
              "(. (tok_table_or_col source) a) " +
              "2 " +
              "(tok_function current_date)" +
            ")" +
          ")" +
        ")" + 
      ")", ast.toStringTree());

  }
both UPDATE and INSERT
@throws ParseException
parser/src/test/org/apache/hadoop/hive/ql/parse/TestMergeStatement.java