hive中使用sql window函数 LAG/LEAD/FIRST/LAST

https://github.com/hbutani/SQLWindowing

 

 

经过测试,我使用的hadoop版本: hadoop-0.20.2-cdh3u3

hive版本:0.7.0,报错:

 

./hive --service windowingCli
Hive history file=/tmp/p_sdo_data_etl/hive_job_log_p_sdo_data_etl_201207191020_1015292447.txt
Exception in thread "main" groovy.lang.MissingMethodException: No signature of method: org.apache.hadoop.hive.cli.CliSessionState.getHost() is applicable for argument types: () values: []
Possible solutions: getConf(), getAt(java.lang.String), getClass(), get(), getCmd(), setConf(org.apache.hadoop.hive.conf.HiveConf)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
        at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
        at com.sap.hadoop.windowing.WindowingHiveCliDriver.main(WindowingHiveCliDriver.groovy:187)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:186)

 

应该要更高版本的hive:

 

Requirements
============

- Java 1.6
- Hadoop 0.20.x (x >= 1)
- Hive > 0.7.1
 

你可能感兴趣的:(hive,window function)