Created
March 24, 2016 18:55
-
-
Save dennyglee/c2bad25837c5d4ad0193 to your computer and use it in GitHub Desktop.
Introducing Window Functions in Spark SQL: Define window specification
This file contains hidden or 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
| from pyspark.sql.window import Window | |
| # Defines partitioning specification and ordering specification. | |
| windowSpec = \ | |
| Window \ | |
| .partitionBy(...) \ | |
| .orderBy(...) | |
| # Defines a Window Specification with a ROW frame. | |
| windowSpec.rowsBetween(start, end) | |
| # Defines a Window Specification with a RANGE frame. | |
| windowSpec.rangeBetween(start, end) | |
| from pyspark.sql.window import Window |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment