Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package com.facebook.presto.operator.window;
public abstract class ValueWindowFunction
        implements WindowFunction
    protected WindowIndex windowIndex;
    private int currentPosition;
    public final void reset(WindowIndex windowIndex)
        this. = windowIndex;
        this. = 0;
    public final void processRow(BlockBuilder outputint peerGroupStartint peerGroupEndint frameStartint frameEnd)

Reset state for a new partition (including the first one).
    public void reset()
        // subclasses can override

Process a row by outputting the result of the window function.

output the com.facebook.presto.spi.block.BlockBuilder to use for writing the output row
frameStart the position of the first row in the window frame
frameEnd the position of the last row in the window frame
currentPosition the current position for this row
    public abstract void processRow(BlockBuilder outputint frameStartint frameEndint currentPosition);
New to GrepCode? Check out our FAQ X