@Test
  public void testParseMultipleColumnRefs() throws Exception {
    ASTNode tree = parseDriver.parseSelect(
            "SELECT rank(3, 4) WITHIN GROUP (ORDER BY val, val2) FROM src", null).getTree();
    ASTNode selExprNode = (ASTNode) tree.getChild(0);
    ASTNode functionNode = (ASTNode) selExprNode.getChild(0);
    ASTNode withinGroupNode = (ASTNode) functionNode.getChild(3);
    ASTNode orderByNode = (ASTNode) withinGroupNode.getChild(0);
    assertEquals(2, orderByNode.getChildCount());
  }
Test cases for parse WITHIN GROUP clause syntax.
function(expression) WITHIN GROUP (ORDER BY sort_expression)
parser/src/test/org/apache/hadoop/hive/ql/parse/TestParseWithinGroupClause.java