SelectWithUnionQuery (children 1)
 ExpressionList (children 1)
  SelectQuery (children 3)
   ExpressionList (children 2)
    Identifier table1.id1 (alias id1)
    Identifier table1.date1 (alias date1)
   TablesInSelectQuery (children 2)
    TablesInSelectQueryElement (children 1)
     TableExpression (children 1)
      Subquery (alias table1) (children 1)
       SelectWithUnionQuery (children 1)
        ExpressionList (children 1)
         SelectQuery (children 1)
          ExpressionList (children 2)
           Literal UInt64_1 (alias id1)
           Function toDateTime (alias date1) (children 1)
            ExpressionList (children 1)
             Literal \'2025-01-01 01:00:00\'
    TablesInSelectQueryElement (children 2)
     TableExpression (children 1)
      Subquery (alias p) (children 1)
       SelectWithUnionQuery (children 1)
        ExpressionList (children 1)
         SelectQuery (children 1)
          ExpressionList (children 2)
           Literal UInt64_1 (alias id2)
           Function toDate (alias date2) (children 1)
            ExpressionList (children 1)
             Literal \'2025-01-01\'
     TableJoin (children 1)
      Function equals (children 1)
       ExpressionList (children 2)
        Identifier table1.id1
        Identifier p.id2
   Function equals (children 1)
    ExpressionList (children 2)
     Function toDate (children 1)
      ExpressionList (children 1)
       Identifier table1.date1
     Identifier p.date2
