Moving Average Query is an extension which provides support for Moving Average and other Aggregate Window Functions in Druid queries.
See the druid.apache.org website or under Druid Github Repo.