Merge branch 'fix-avs-reportdatasource-filter' into 'master'

Fix AggregatingMergeTree engine to new format.

See merge request !5446
3 jobs for master in 96 minutes and 1 second (queued for 4 seconds)