Skip to content


Subversion checkout URL

You can clone with
Download ZIP
SQL Windowing Functions for Hadoop
Java Shell Groovy Perl Other
Latest commit 9500e71 @hbutani regenerate pdf
Failed to load latest commit information.
docs regenerate pdf
windowing refactor PTF ifc;
.gitignore change .gitignore
README.txt update README


SQL Windowing

SQL Windowing provides a add-on component for Apache Hive for SQL Windowing clauses and table functions. 

Windowing Queries can be expressed on any hive Query or Table or on an HDFS file. 
The Engine generates a MR job to evaluate the windowing functions. Support for 16 functions divided into: Ranking, Aggregation 
and navigation. Support for both value and range boundaries for Windows. 

Table functions can be invoked as table expressions in Select statements; Table functions maybe chained together.

Read a detailed introduction at; a writeup on the 
internal details is at

Getting Started
- download
- copy it to $HIVE_HOME/lib
- download groovy-all-1.8.0.jar and copy it to $HIVE_HOME/lib. If you want a more recent version of groovy, download from
- cp $HIVE_HOME/bin/ext/ $HIVE_HOME/bin/ext/
- edit; change to

windowingCli () {
  if $cygwin; then
    HIVE_LIB=`cygpath -w "$HIVE_LIB"`
  exec $HADOOP jar $JAR $CLASS "$@"

windowingCli_help () {
  windowingCli "--help"

- to run invoke:
hive --service windowingCli

- in a session use wmode to switch between hive & windowing mode. For e.g.:
wmode windowing;
from census_q1 partition by county order by county, arealand desc with rank() as r select county, tract, arealand, r into path='/tmp/wout';
wmode hive;


- Java 1.6
- Hadoop 0.20.x (x >= 1)
- Hive > 0.7.1
Something went wrong with that request. Please try again.