Fix Exception when using subscript operator in aggregation query

Fix issue:
https://github.com/facebook/presto/issues/1828