[
https://issues.apache.org/jira/browse/HIVE-4797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15784148#comment-15784148
]
Lefty Leverenz commented on HIVE-4797:
--------------------------------------
The documentation for LEAD and LAG still needs to be reviewed and improved
(with syntax details):
* [Windowing and Analytics Functions |
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+WindowingAndAnalytics]
** [Enhancements to Hive QL |
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+WindowingAndAnalytics#LanguageManualWindowingAndAnalytics-EnhancementstoHiveQL]
** [LEAD using default 1 row lead and not specifying default value |
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+WindowingAndAnalytics#LanguageManualWindowingAndAnalytics-LEADusingdefault1rowleadandnotspecifyingdefaultvalue]
** [LAG specifying a lag of 3 rows and default value of 0 |
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+WindowingAndAnalytics#LanguageManualWindowingAndAnalytics-LAGspecifyingalagof3rowsanddefaultvalueof0]
Once that is done, this JIRA issue can be closed.
> Hive Lead/Lag OLAP Not Functioning
> ----------------------------------
>
> Key: HIVE-4797
> URL: https://issues.apache.org/jira/browse/HIVE-4797
> Project: Hive
> Issue Type: Bug
> Components: OLAP
> Affects Versions: 0.11.0
> Environment: Linux version 2.6.18-308.24.1.el5
> ([email protected]) (gcc version 4.1.2 20080704 (Red
> Hat 4.1.2-52))
> Java 1.6.0_31
> Hadoop 1.2.0
> Hive 0.11.0
> Reporter: Joshua Lee
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Unable to use built in LAG/LEAD functionality. Following the example in
> documentation at
> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+WindowingAndAnalytics
> leads to error. This leads me to believe that this is a bug rather than
> something wrong with my query. Specifically:
> -- Set up database
> hive> create table lag_test(a int, b int, c string, d string) row format
> delimited fields terminated by "\t";
> -- load test data using local file
> -- Run test query
> hive> SELECT a, LEAD(a) OVER (PARTITION BY b ORDER BY C ROWS BETWEEN CURRENT
> ROW AND 1 FOLLOWING) FROM lag_test; -- copied from documentation
> FAILED: SemanticException Failed to breakup Windowing invocations into
> Groups. At least 1 group must only depend on input columns. Also check for
> circular dependencies.
> Underlying error: Expecting left window frame boundary for function
> LEAD((TOK_TABLE_OR_COL a))
> org.apache.hadoop.hive.ql.parse.WindowingSpec$WindowSpec@39fe9830 as _wcol0
> to be unbounded. Found : 0
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)