@Test
  public void testParseWhenFunctionHasTrimLikeStructure() {
    try {
      parseDriver.parse("select upper(both 'rfo' from 'foo  bar')", null);
      Assert.fail("Expected ParseException");
    } catch (ParseException ex) {
      Assert.assertEquals("Failure didn't match.",
              "line 1:13 cannot recognize input near 'both' ''rfo'' 'from' in function specification",
              ex.getMessage());
    }
  }
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/TestParseTrim.java