SelectWithUnionQuery (children 1)
 ExpressionList (children 1)
  SelectQuery (children 3)
   ExpressionList (children 1)
    WithElement (children 1)
     Subquery (children 1)
      SelectWithUnionQuery (children 1)
       ExpressionList (children 1)
        SelectQuery (children 1)
         ExpressionList (children 3)
          Literal UInt64_1 (alias ID)
          Function toDate (alias dt) (children 1)
           ExpressionList (children 1)
            Literal \'2023-06-24\'
          Literal UInt64_0 (alias p)
   ExpressionList (children 1)
    Function multiIf (alias params) (children 1)
     ExpressionList (children 3)
      Function equals (children 1)
       ExpressionList (children 2)
        Identifier t.ID
        Literal UInt64_1
      Function formatRowNoNewline (children 1)
       ExpressionList (children 2)
        Literal \'JSONEachRow\'
        Identifier dd
      Literal \'\'
   TablesInSelectQuery (children 1)
    TablesInSelectQueryElement (children 1)
     TableExpression (children 1)
      Subquery (alias t) (children 1)
       SelectWithUnionQuery (children 1)
        ExpressionList (children 1)
         SelectQuery (children 2)
          ExpressionList (children 2)
           Identifier ID
           Function multiIf (alias dd) (children 1)
            ExpressionList (children 3)
             Function equals (children 1)
              ExpressionList (children 2)
               Identifier p
               Literal UInt64_0
             Function toString (children 1)
              ExpressionList (children 1)
               Function plus (children 1)
                ExpressionList (children 2)
                 Identifier dt
                 Function toIntervalHour (children 1)
                  ExpressionList (children 1)
                   Identifier p
             Literal \'2022-01-01\'
          TablesInSelectQuery (children 1)
           TablesInSelectQueryElement (children 1)
            TableExpression (children 1)
             TableIdentifier c
