SelectWithUnionQuery (children 2)
 ExpressionList (children 1)
  SelectQuery (children 4)
   ExpressionList (children 4)
    Function multiIf (alias interval_start) (children 1)
     ExpressionList (children 7)
      Function equals (children 1)
       ExpressionList (children 2)
        Literal \'-1\'
        Literal \'-1\'
      Literal UInt64_10080
      Function equals (children 1)
       ExpressionList (children 2)
        Literal \'-1\'
        Literal \'7\'
      Literal UInt64_60
      Function equals (children 1)
       ExpressionList (children 2)
        Literal \'-1\'
        Literal \'1\'
      Literal UInt64_5
      Literal UInt64_1440
    Function multiIf (alias days_run) (children 1)
     ExpressionList (children 7)
      Function equals (children 1)
       ExpressionList (children 2)
        Literal \'-1\'
        Literal \'-1\'
      Function CAST (children 1)
       ExpressionList (children 2)
        Function CEIL (children 1)
         ExpressionList (children 1)
          Function divide (children 1)
           ExpressionList (children 2)
            Function minus (children 1)
             ExpressionList (children 2)
              Function today (children 1)
               ExpressionList
              Function toDate (children 1)
               ExpressionList (children 1)
                Literal \'2017-06-22\'
            Literal UInt64_7
        Literal \'UInt16\'
      Function equals (children 1)
       ExpressionList (children 2)
        Literal \'-1\'
        Literal \'7\'
      Literal UInt64_168
      Function equals (children 1)
       ExpressionList (children 2)
        Literal \'-1\'
        Literal \'1\'
      Literal UInt64_288
      Literal UInt64_90
    WithElement (children 1)
     Subquery (children 1)
      SelectWithUnionQuery (children 1)
       ExpressionList (children 1)
        SelectQuery (children 1)
         ExpressionList (children 1)
          Function arrayJoin (children 1)
           ExpressionList (children 1)
            Function arrayMap (children 1)
             ExpressionList (children 2)
              Function lambda (children 1)
               ExpressionList (children 2)
                Function tuple (children 1)
                 ExpressionList (children 1)
                  Identifier i
                Function toDateTime (children 1)
                 ExpressionList (children 2)
                  Function minus (children 1)
                   ExpressionList (children 2)
                    Function toStartOfInterval (children 1)
                     ExpressionList (children 2)
                      Function now (children 1)
                       ExpressionList
                      Function toIntervalMinute (children 1)
                       ExpressionList (children 1)
                        Identifier interval_start
                    Function multiply (children 1)
                     ExpressionList (children 2)
                      Function multiply (children 1)
                       ExpressionList (children 2)
                        Identifier interval_start
                        Literal UInt64_60
                      Identifier i
                  Literal \'UTC\'
              Function range (children 1)
               ExpressionList (children 1)
                Identifier days_run
    WithElement (children 1)
     Subquery (children 1)
      SelectWithUnionQuery (children 1)
       ExpressionList (children 1)
        SelectQuery (children 4)
         ExpressionList (children 1)
          Function toDateTime (alias block_time) (children 1)
           ExpressionList (children 2)
            Function toStartOfInterval (children 1)
             ExpressionList (children 2)
              Function now (children 1)
               ExpressionList
              Function toIntervalMinute (children 1)
               ExpressionList (children 1)
                Identifier interval_start
            Literal \'UTC\'
         TablesInSelectQuery (children 1)
          TablesInSelectQueryElement (children 1)
           TableExpression (children 1)
            Function numbers (children 1)
             ExpressionList (children 1)
              Literal UInt64_1
         ExpressionList (children 1)
          Identifier block_time
         ExpressionList (children 1)
          OrderByElement (children 1)
           Identifier block_time
   ExpressionList (children 1)
    Identifier block_time
   TablesInSelectQuery (children 1)
    TablesInSelectQueryElement (children 1)
     TableExpression (children 1)
      TableIdentifier sales
   Function greaterOrEquals (children 1)
    ExpressionList (children 2)
     Identifier block_time
     Subquery (children 1)
      SelectWithUnionQuery (children 1)
       ExpressionList (children 1)
        SelectQuery (children 2)
         ExpressionList (children 1)
          Function MIN (children 1)
           ExpressionList (children 1)
            Identifier block_time
         TablesInSelectQuery (children 1)
          TablesInSelectQueryElement (children 1)
           TableExpression (children 1)
            TableIdentifier sales
 Identifier Null
