Are you interested in Data Engineering Essentials course on Kontext? Learn more
Spark SQL - NTILE Window Function
visibility 1,077
comment 0
Spark NTILE function divides the rows in each window to 'n' buckets ranging from 1 to at most 'n' (n is the specified parameter). The following sample SQL uses NTILE function to divide records in each window to two buckets. SELECT TXN.*, NTILE(2) OVER (PARTITION BY ...
thumb_up 0
Log in with external accounts
comment Comments
No comments yet.