Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --10M dataset
- with predictions as
- (
- select id ,probability
- from table
- )
- -- give a rom_number to each record and then create 1000 groups
- , bin_groups as (
- select
- id,
- ceiling(1000.0*ROW_NUMBER() over(order by probability desc) / (select count(distinct id) from predictions)) as bins
- from predictions
- )
- select *
- from bin_groups
- where bins = 1
- limit 100
- Resources exceeded during query execution: The query could not be executed in the allotted memory. Peak usage: 102% of limit. Top memory consumer(s): JOIN operations: 96% other/unattributed: 4%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement