SelectWithUnionQuery (children 1) ExpressionList (children 1) SelectQuery (children 2) ExpressionList (children 1) Function cityHash64 (children 1) ExpressionList (children 1) Function toString (children 1) ExpressionList (children 1) Function groupArray (children 1) ExpressionList (children 1) Function tuple (children 1) ExpressionList (children 1) Asterisk TablesInSelectQuery (children 1) TablesInSelectQueryElement (children 1) TableExpression (children 1) Subquery (alias t) (children 1) SelectWithUnionQuery (children 1) ExpressionList (children 1) SelectQuery (children 4) ExpressionList (children 3) Identifier brand_id Identifier rack_id Function arrayJoin (alias quantity) (children 1) ExpressionList (children 1) Function arraySlice (children 1) ExpressionList (children 3) Function arraySort (children 1) ExpressionList (children 1) Function groupArray (children 1) ExpressionList (children 1) Identifier quantity Literal UInt64_1 Literal UInt64_2 TablesInSelectQuery (children 1) TablesInSelectQueryElement (children 1) TableExpression (children 1) TableIdentifier stack ExpressionList (children 2) Identifier brand_id Identifier rack_id ExpressionList (children 3) OrderByElement (children 1) Identifier brand_id OrderByElement (children 1) Identifier rack_id OrderByElement (children 1) Identifier quantity