presto-main/src/main/java/io/prestosql/operator/window/WindowPartition.java/WindowPartition/preceding
class WindowPartition:    private static int preceding(int rowPosition, long value)
    {
        if (value > rowPosition) {
            return 0;
        }
        return toIntExact(rowPosition - value);
    }