SelectWithUnionQuery (children 1)
 ExpressionList (children 1)
  SelectQuery (children 4)
   ExpressionList (children 3)
    Literal \'(forward, head, A->B)\'
    Identifier id
    Function sequenceNextNodeDistinct (alias next_node) (children 2)
     ExpressionList (children 4)
      Identifier dt
      Identifier action
      Function equals (children 1)
       ExpressionList (children 2)
        Identifier action
        Literal \'A\'
      Function and (children 1)
       ExpressionList (children 2)
        Function toNullable (children 1)
         ExpressionList (children 1)
          Function isNotNull (children 1)
           ExpressionList (children 1)
            Literal UInt64_1
        Function not (children 1)
         ExpressionList (children 1)
          Function toNullable (children 1)
           ExpressionList (children 1)
            Function isNullable (children 1)
             ExpressionList (children 1)
              Literal UInt64_1
     ExpressionList (children 3)
      Literal \'forward\'
      Literal \'head\'
      Literal UInt64_4
   TablesInSelectQuery (children 1)
    TablesInSelectQueryElement (children 1)
     TableExpression (children 1)
      TableIdentifier events_demo
   ExpressionList (children 1)
    Asterisk
   ExpressionList (children 1)
    OrderByElement (children 1)
     Identifier ALL
