The following works against a hive table from spark sql hc.sql("select id,r from (select id, name, rank() over (order by name) as r from tt2) v where v.r >= 1 and v.r <= 12")
But when using a standard sql context against a temporary table the following occurs: Exception in thread "main" java.lang.RuntimeException: [3.25] failure: ``)'' expected but `(' found rank() over (order by name) as r ^