SelectWithUnionQuery (children 1)
 ExpressionList (children 1)
  SelectQuery (children 5)
   ExpressionList (children 3)
    Identifier nw
    Function sum (alias R) (children 1)
     ExpressionList (children 1)
      Identifier WR
    Function sumIf (alias UNR) (children 1)
     ExpressionList (children 2)
      Identifier WR
      Function equals (children 1)
       ExpressionList (children 2)
        Identifier uniq_rows
        Literal UInt64_1
   TablesInSelectQuery (children 1)
    TablesInSelectQueryElement (children 1)
     TableExpression (children 1)
      Subquery (children 1)
       SelectWithUnionQuery (children 1)
        ExpressionList (children 4)
         SelectQuery (children 4)
          ExpressionList (children 4)
           Function uniq (alias uniq_rows) (children 1)
            ExpressionList (children 1)
             Identifier nw
           Function AVG (alias WR) (children 1)
            ExpressionList (children 1)
             Identifier wg
           Identifier ac
           Identifier nw
          TablesInSelectQuery (children 1)
           TablesInSelectQueryElement (children 1)
            TableExpression (children 1)
             TableIdentifier window_function_threading
          Function equals (children 1)
           ExpressionList (children 2)
            Function modulo (children 1)
             ExpressionList (children 2)
              Identifier ac
              Literal UInt64_4
            Literal UInt64_0
          ExpressionList (children 2)
           Identifier ac
           Identifier nw
         SelectQuery (children 4)
          ExpressionList (children 4)
           Function uniq (alias uniq_rows) (children 1)
            ExpressionList (children 1)
             Identifier nw
           Function AVG (alias WR) (children 1)
            ExpressionList (children 1)
             Identifier wg
           Identifier ac
           Identifier nw
          TablesInSelectQuery (children 1)
           TablesInSelectQueryElement (children 1)
            TableExpression (children 1)
             TableIdentifier window_function_threading
          Function equals (children 1)
           ExpressionList (children 2)
            Function modulo (children 1)
             ExpressionList (children 2)
              Identifier ac
              Literal UInt64_4
            Literal UInt64_1
          ExpressionList (children 2)
           Identifier ac
           Identifier nw
         SelectQuery (children 4)
          ExpressionList (children 4)
           Function uniq (alias uniq_rows) (children 1)
            ExpressionList (children 1)
             Identifier nw
           Function AVG (alias WR) (children 1)
            ExpressionList (children 1)
             Identifier wg
           Identifier ac
           Identifier nw
          TablesInSelectQuery (children 1)
           TablesInSelectQueryElement (children 1)
            TableExpression (children 1)
             TableIdentifier window_function_threading
          Function equals (children 1)
           ExpressionList (children 2)
            Function modulo (children 1)
             ExpressionList (children 2)
              Identifier ac
              Literal UInt64_4
            Literal UInt64_2
          ExpressionList (children 2)
           Identifier ac
           Identifier nw
         SelectQuery (children 4)
          ExpressionList (children 4)
           Function uniq (alias uniq_rows) (children 1)
            ExpressionList (children 1)
             Identifier nw
           Function AVG (alias WR) (children 1)
            ExpressionList (children 1)
             Identifier wg
           Identifier ac
           Identifier nw
          TablesInSelectQuery (children 1)
           TablesInSelectQueryElement (children 1)
            TableExpression (children 1)
             TableIdentifier window_function_threading
          Function equals (children 1)
           ExpressionList (children 2)
            Function modulo (children 1)
             ExpressionList (children 2)
              Identifier ac
              Literal UInt64_4
            Literal UInt64_3
          ExpressionList (children 2)
           Identifier ac
           Identifier nw
   ExpressionList (children 1)
    Identifier nw
   ExpressionList (children 2)
    OrderByElement (children 1)
     Identifier nw
    OrderByElement (children 1)
     Identifier R
   Literal UInt64_10
