https://blog.youkuaiyun.com/moon_yang_bj/article/details/17200367
参考资料
apache hive窗口函数官方介绍:http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.0.0.2/ds_Hive/language_manual/ptf-window.html
apache hive官方:cube、rollup函数介绍:https://cwiki.apache.org/confluence/display/Hive/Enhanced+Aggregation,+Cube,+Grouping+and+Rollup
oracle窗口函数介绍:http://www.blogjava.net/pengpenglin/archive/2012/04/12/211334.html