Created
February 21, 2013 22:13
-
-
Save Rajmohan/5008840 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class RowNumberAFunc extends PlainAnalyticFunction<Integer> { | |
@Override | |
public void initialize(FunctionContext<Integer> fnCtx) { | |
fnCtx.setResult(Integer.valueOf(0)); | |
} | |
@Override | |
public void map(FunctionContext<Integer> fnCtx, Tuple current, List<Tuple> window) { | |
fnCtx.setResult( fnCtx.getResult() + 1 ); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment