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