Page MenuHomePhabricator

Upgrade Presto to access UDF library improvements
Closed, ResolvedPublic

Description

We ran into an unnecessary obstacle when analyzing some MediaWiki API request logs, trying to use the array_frequency function documented in the latest revision. Discovering this function was not available yet, I tried the historgram function and got an error that the maximum memory usage of 40GB had been exceeded. This is surprising because the columns I was trying to aggregate were on a table of 3.5M rows but with only a small, finite (either 2 or c. 900) number of distinct elements, so this built-in histogram must be doing something unscalable behind the scenes.

This isn't a blocker for our work, but I'm filing a task to put one finger on the scale the next time an upgrade is discussed.

Thank you for maintaining Superset and Presto, my team has been loving the experience so far!

Event Timeline

Now I've also tried approx_most_frequent and it also fails with an out-of-memory error, even when the capacity parameter is dialed down to a 100k rows: P17737

awight triaged this task as Lowest priority.Nov 12 2021, 1:09 PM

Full disclosure: I was experiencing OOM even after removing the CTE and switching to the simplest aggregation, the crashing can't be blamed on histogram or approx_most_frequent. By process of elimination, I found that histogram is fine for my needs and the problem is actually with this column:

select
  count_if(
    element_at(http.request_headers, 'user-agent') = 'kartotherian (yurik @ wikimedia)'
  ) as is_kartotherian,
  count_if(is_wmf_domain) as is_wmf_domain
from event.mediawiki_api_request
  where year=2021
  and month=11
  and day=1
;

Hi @awight - Apologies for the delay in getting around to this. Just FYI we have upgraded the version of presto on the test cluster to 0.281.

If all goes well with our testing, we should have this version rolled out to the prod cluster within the next week or so.

Those is now done, since we have presto version 0.281 deployed in production.

BTullis claimed this task.