Hi,

Unparsing of SqlWindow related to SqlRankFunction & SqlLeadLagFunction type
of SQL Operators should consider whether the Boundary Specifications should
be printed or not(where Framing is not allowed!)

For Instance,

*SELECT employee_id, ROW_NUMBER() OVER (PARTITION BY department_id ORDER BY
hire_date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)*
*FROM foodmart.employee;*

throws the following Exception in Hive 1.2:-

*Expecting right window frame boundary for function ROW_NUMBER() Window
Spec=[PartitioningSpec=[partitionColumns=[(TOK_TABLE_OR_COL
department_id)]orderColumns=[(TOK_TABLE_OR_COL hire_date)
ASC]]window(start=range(Unbounded PRECEDING), end=currentRow)] as
ROW_NUMBER_window_0 to be unbounded. Found : 2147483647*

In my opinion, the best Approach would be not to print any ROW or RANGE
specification as ROW_NUMBER is a fairly generic function and if Dialect
specific changes are required, then we can ask the dialect for syntax.

Reply via email to