SelectWithUnionQuery (children 1)
 ExpressionList (children 1)
  SelectQuery (children 4)
   ExpressionList (children 5)
    Identifier k
    Function groupArray (alias res1) (children 1)
     ExpressionList (children 1)
      Identifier x
    Function toTypeName (children 1)
     ExpressionList (children 1)
      Identifier res1
    Function avg (alias res2) (children 1)
     ExpressionList (children 1)
      Identifier x
    Function toTypeName (children 1)
     ExpressionList (children 1)
      Identifier res2
   TablesInSelectQuery (children 1)
    TablesInSelectQueryElement (children 1)
     TableExpression (children 1)
      Subquery (children 1)
       SelectWithUnionQuery (children 1)
        ExpressionList (children 2)
         SelectQuery (children 1)
          ExpressionList (children 2)
           Literal UInt64_1 (alias k)
           Function arrayJoin (alias x) (children 1)
            ExpressionList (children 1)
             Literal Array_[UInt64_1, NULL, UInt64_2]
         SelectQuery (children 1)
          ExpressionList (children 2)
           Literal UInt64_2 (alias k)
           Function CAST (alias x) (children 1)
            ExpressionList (children 2)
             Function arrayJoin (children 1)
              ExpressionList (children 1)
               Literal Array_[NULL, NULL]
             Literal \'Nullable(UInt8)\'
   ExpressionList (children 1)
    Identifier k
   ExpressionList (children 1)
    OrderByElement (children 1)
     Identifier k
