}
@Test
public void testWindowClause() throws WindowingException
{
QueryDef qDef = wshell.translate("select p_mfgr,p_name, p_size, " +
"sum(p_size) over w1 as s, " +
" denserank() as dr " +
" from part_demo " +
" partition by p_mfgr" +
" window w1 as rows between 2 preceding and 2 following" +
" into path='/tmp/wout2'" +
" serde 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'" +
" with serdeproperties('field.delim'=',')" +
" format 'org.apache.hadoop.mapred.TextOutputFormat'");
RangeBoundaryDef rBdef = (RangeBoundaryDef) qDef.getSelectList().getWindowFuncs().get(0).getWindow().getWindow().getStart();
assert rBdef.getAmt() == 2;
rBdef = (RangeBoundaryDef) qDef.getSelectList().getWindowFuncs().get(0).getWindow().getWindow().getEnd();
assert rBdef.getAmt() == 2;
}