SelectWithUnionQuery (children 1)
 ExpressionList (children 1)
  SelectQuery (children 3)
   ExpressionList (children 1)
    Asterisk
   TablesInSelectQuery (children 1)
    TablesInSelectQueryElement (children 1)
     TableExpression (children 1)
      Subquery (alias c0) (children 1)
       SelectWithUnionQuery (children 1)
        ExpressionList (children 1)
         SelectQuery (children 2)
          ExpressionList (children 4)
           Identifier m0.pt (alias pt)
           Identifier m0.uvctr (alias uvctr)
           Function round (alias uvctr_hb_last_value) (children 1)
            ExpressionList (children 2)
             Identifier m1.uvctr
             Literal UInt64_4
           Function round (alias uvctr_tb_last_value) (children 1)
            ExpressionList (children 2)
             Identifier m2.uvctr
             Literal UInt64_4
          TablesInSelectQuery (children 3)
           TablesInSelectQueryElement (children 1)
            TableExpression (children 1)
             Subquery (alias m0) (children 1)
              SelectWithUnionQuery (children 1)
               ExpressionList (children 1)
                SelectQuery (children 2)
                 ExpressionList (children 3)
                  Identifier m0.pt (alias pt)
                  Function COALESCE (alias brand_name) (children 1)
                   ExpressionList (children 2)
                    Identifier m0.brand_name
                    Identifier m1.brand_name
                  Function if (alias uvctr) (children 1)
                   ExpressionList (children 3)
                    Function or (children 1)
                     ExpressionList (children 2)
                      Function isNaN (children 1)
                       ExpressionList (children 1)
                        Function divide (children 1)
                         ExpressionList (children 2)
                          Identifier click_uv
                          Identifier exposure_uv
                      Function isInfinite (children 1)
                       ExpressionList (children 1)
                        Function divide (children 1)
                         ExpressionList (children 2)
                          Identifier click_uv
                          Identifier exposure_uv
                    Literal NULL
                    Function divide (children 1)
                     ExpressionList (children 2)
                      Identifier click_uv
                      Identifier exposure_uv
                 TablesInSelectQuery (children 2)
                  TablesInSelectQueryElement (children 1)
                   TableExpression (children 1)
                    Subquery (alias m0) (children 1)
                     SelectWithUnionQuery (children 1)
                      ExpressionList (children 1)
                       SelectQuery (children 3)
                        ExpressionList (children 4)
                         Identifier pt (alias pt)
                         Identifier brand_name (alias brand_name)
                         Identifier exposure_uv (alias exposure_uv)
                         Identifier click_uv (alias click_uv)
                        TablesInSelectQuery (children 1)
                         TablesInSelectQueryElement (children 1)
                          TableExpression (children 1)
                           TableIdentifier test2
                        Function equals (children 1)
                         ExpressionList (children 2)
                          Identifier pt
                          Literal \'20230626\'
                  TablesInSelectQueryElement (children 2)
                   TableExpression (children 1)
                    Subquery (alias m1) (children 1)
                     SelectWithUnionQuery (children 1)
                      ExpressionList (children 1)
                       SelectQuery (children 3)
                        ExpressionList (children 4)
                         Identifier pt (alias pt)
                         Identifier brand_name (alias brand_name)
                         Identifier total_indirect_order_cnt (alias total_indirect_order_cnt)
                         Identifier total_indirect_gmv (alias total_indirect_gmv)
                        TablesInSelectQuery (children 1)
                         TablesInSelectQueryElement (children 1)
                          TableExpression (children 1)
                           TableIdentifier test1
                        Function equals (children 1)
                         ExpressionList (children 2)
                          Identifier pt
                          Literal \'20230626\'
                   TableJoin (children 1)
                    Function and (children 1)
                     ExpressionList (children 2)
                      Function equals (children 1)
                       ExpressionList (children 2)
                        Identifier m0.brand_name
                        Identifier m1.brand_name
                      Function equals (children 1)
                       ExpressionList (children 2)
                        Identifier m0.pt
                        Identifier m1.pt
           TablesInSelectQueryElement (children 2)
            TableExpression (children 1)
             Subquery (alias m1) (children 1)
              SelectWithUnionQuery (children 1)
               ExpressionList (children 1)
                SelectQuery (children 2)
                 ExpressionList (children 5)
                  Identifier m0.pt (alias pt)
                  Function if (alias uvctr) (children 1)
                   ExpressionList (children 3)
                    Function or (children 1)
                     ExpressionList (children 2)
                      Function isNaN (children 1)
                       ExpressionList (children 1)
                        Function divide (children 1)
                         ExpressionList (children 2)
                          Identifier click_uv
                          Identifier exposure_uv
                      Function isInfinite (children 1)
                       ExpressionList (children 1)
                        Function divide (children 1)
                         ExpressionList (children 2)
                          Identifier click_uv
                          Identifier exposure_uv
                    Literal NULL
                    Function divide (children 1)
                     ExpressionList (children 2)
                      Identifier click_uv
                      Identifier exposure_uv
                  Function COALESCE (alias brand_name) (children 1)
                   ExpressionList (children 2)
                    Identifier m0.brand_name
                    Identifier m1.brand_name
                  Identifier exposure_uv (alias exposure_uv)
                  Identifier click_uv
                 TablesInSelectQuery (children 2)
                  TablesInSelectQueryElement (children 1)
                   TableExpression (children 1)
                    Subquery (alias m0) (children 1)
                     SelectWithUnionQuery (children 1)
                      ExpressionList (children 1)
                       SelectQuery (children 3)
                        ExpressionList (children 4)
                         Identifier pt (alias pt)
                         Identifier brand_name (alias brand_name)
                         Identifier exposure_uv (alias exposure_uv)
                         Identifier click_uv (alias click_uv)
                        TablesInSelectQuery (children 1)
                         TablesInSelectQueryElement (children 1)
                          TableExpression (children 1)
                           TableIdentifier test2
                        Function equals (children 1)
                         ExpressionList (children 2)
                          Identifier pt
                          Literal \'20230625\'
                  TablesInSelectQueryElement (children 2)
                   TableExpression (children 1)
                    Subquery (alias m1) (children 1)
                     SelectWithUnionQuery (children 1)
                      ExpressionList (children 1)
                       SelectQuery (children 3)
                        ExpressionList (children 4)
                         Identifier pt (alias pt)
                         Identifier brand_name (alias brand_name)
                         Identifier total_indirect_order_cnt (alias total_indirect_order_cnt)
                         Identifier total_indirect_gmv (alias total_indirect_gmv)
                        TablesInSelectQuery (children 1)
                         TablesInSelectQueryElement (children 1)
                          TableExpression (children 1)
                           TableIdentifier test1
                        Function equals (children 1)
                         ExpressionList (children 2)
                          Identifier pt
                          Literal \'20230625\'
                   TableJoin (children 1)
                    Function and (children 1)
                     ExpressionList (children 2)
                      Function equals (children 1)
                       ExpressionList (children 2)
                        Identifier m0.brand_name
                        Identifier m1.brand_name
                      Function equals (children 1)
                       ExpressionList (children 2)
                        Identifier m0.pt
                        Identifier m1.pt
            TableJoin (children 1)
             Function and (children 1)
              ExpressionList (children 2)
               Function equals (children 1)
                ExpressionList (children 2)
                 Identifier m0.brand_name
                 Identifier m1.brand_name
               Function equals (children 1)
                ExpressionList (children 2)
                 Identifier m0.pt
                 Identifier m1.pt
           TablesInSelectQueryElement (children 2)
            TableExpression (children 1)
             Subquery (alias m2) (children 1)
              SelectWithUnionQuery (children 1)
               ExpressionList (children 1)
                SelectQuery (children 2)
                 ExpressionList (children 5)
                  Identifier m0.pt (alias pt)
                  Function if (alias uvctr) (children 1)
                   ExpressionList (children 3)
                    Function or (children 1)
                     ExpressionList (children 2)
                      Function isNaN (children 1)
                       ExpressionList (children 1)
                        Function divide (children 1)
                         ExpressionList (children 2)
                          Identifier click_uv
                          Identifier exposure_uv
                      Function isInfinite (children 1)
                       ExpressionList (children 1)
                        Function divide (children 1)
                         ExpressionList (children 2)
                          Identifier click_uv
                          Identifier exposure_uv
                    Literal NULL
                    Function divide (children 1)
                     ExpressionList (children 2)
                      Identifier click_uv
                      Identifier exposure_uv
                  Function COALESCE (alias brand_name) (children 1)
                   ExpressionList (children 2)
                    Identifier m0.brand_name
                    Identifier m1.brand_name
                  Identifier exposure_uv (alias exposure_uv)
                  Identifier click_uv
                 TablesInSelectQuery (children 2)
                  TablesInSelectQueryElement (children 1)
                   TableExpression (children 1)
                    Subquery (alias m0) (children 1)
                     SelectWithUnionQuery (children 1)
                      ExpressionList (children 1)
                       SelectQuery (children 3)
                        ExpressionList (children 4)
                         Identifier pt (alias pt)
                         Identifier brand_name (alias brand_name)
                         Identifier exposure_uv (alias exposure_uv)
                         Identifier click_uv (alias click_uv)
                        TablesInSelectQuery (children 1)
                         TablesInSelectQueryElement (children 1)
                          TableExpression (children 1)
                           TableIdentifier test2
                        Function equals (children 1)
                         ExpressionList (children 2)
                          Identifier pt
                          Literal \'20220626\'
                  TablesInSelectQueryElement (children 2)
                   TableExpression (children 1)
                    Subquery (alias m1) (children 1)
                     SelectWithUnionQuery (children 1)
                      ExpressionList (children 1)
                       SelectQuery (children 3)
                        ExpressionList (children 4)
                         Identifier pt (alias pt)
                         Identifier brand_name (alias brand_name)
                         Identifier total_indirect_order_cnt (alias total_indirect_order_cnt)
                         Identifier total_indirect_gmv (alias total_indirect_gmv)
                        TablesInSelectQuery (children 1)
                         TablesInSelectQueryElement (children 1)
                          TableExpression (children 1)
                           TableIdentifier test1
                        Function equals (children 1)
                         ExpressionList (children 2)
                          Identifier pt
                          Literal \'20220626\'
                   TableJoin (children 1)
                    Function and (children 1)
                     ExpressionList (children 2)
                      Function equals (children 1)
                       ExpressionList (children 2)
                        Identifier m0.brand_name
                        Identifier m1.brand_name
                      Function equals (children 1)
                       ExpressionList (children 2)
                        Identifier m0.pt
                        Identifier m1.pt
            TableJoin (children 1)
             Function and (children 1)
              ExpressionList (children 2)
               Function equals (children 1)
                ExpressionList (children 2)
                 Identifier m0.brand_name
                 Identifier m2.brand_name
               Function equals (children 1)
                ExpressionList (children 2)
                 Identifier m0.pt
                 Identifier m2.pt
   ExpressionList (children 2)
    OrderByElement (children 1)
     Identifier pt
    OrderByElement (children 1)
     Identifier uvctr
