@Test
  public void test() throws ParseException {
    ASTNode ast = parse(//using target.a breaks this
      "MERGE INTO target USING source ON target.pk = source.pk WHEN MATCHED THEN UPDATE set a = source.b, c=d+1");
    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))" +
            ")" +
          ")" +
        ")" +
      ")", ast.toStringTree());
  }
Testing parsing for SQL Merge statement
parser/src/test/org/apache/hadoop/hive/ql/parse/TestMergeStatement.java