You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Dudu Markovitz (JIRA)" <ji...@apache.org> on 2016/04/02 09:17:25 UTC

[jira] [Created] (HIVE-13411) Windowing and Analytics Functions - lead / lag wrong documentation

Dudu Markovitz created HIVE-13411:
-------------------------------------

             Summary: Windowing and Analytics Functions - lead / lag wrong documentation 
                 Key: HIVE-13411
                 URL: https://issues.apache.org/jira/browse/HIVE-13411
             Project: Hive
          Issue Type: Bug
          Components: Documentation
            Reporter: Dudu Markovitz
            Priority: Trivial


lead / lag should not contain ROWS clause.
The correct syntax would be  
SELECT a, LEAD(a) OVER (PARTITION BY b ORDER BY C)
FROM T;
SELECT a, LAG(a, 3, 0) OVER (PARTITION BY b ORDER BY C)
FROM T;
 and not like in the documentation:
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+WindowingAndAnalytics

LEAD using default 1 row lead and not specifying default value
SELECT a, LEAD(a) OVER (PARTITION BY b ORDER BY C ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING)
FROM T;
LAG specifying a lag of 3 rows and default value of 0
SELECT a, LAG(a, 3, 0) OVER (PARTITION BY b ORDER BY C ROWS 3 PRECEDING)
FROM T;



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)