The MODE() function in DuckDB tries to load the entire dataset into memory, leading to excessive memory usage and session crashes when applied to large datasets. WITH download_counts AS ( SELECT app, ...