Postgres Window Functions In Spark