SelectWithUnionQuery (children 1)
 ExpressionList (children 1)
  SelectQuery (children 2)
   ExpressionList (children 2)
    Function avgForEach (children 1)
     ExpressionList (children 1)
      Identifier values
    Function countForEach (alias avg_values) (children 1)
     ExpressionList (children 1)
      Identifier values
   TablesInSelectQuery (children 1)
    TablesInSelectQueryElement (children 1)
     TableExpression (children 1)
      Subquery (children 1)
       SelectWithUnionQuery (children 1)
        ExpressionList (children 1)
         SelectQuery (children 3)
          ExpressionList (children 2)
           Function multiply (alias fake_key) (children 1)
            ExpressionList (children 2)
             Function intDiv (children 1)
              ExpressionList (children 2)
               Function toUnixTimestamp (children 1)
                ExpressionList (children 1)
                 Identifier timestamp
               Literal UInt64_130
             Literal UInt64_130
           Function timeSeriesResampleToGridWithStaleness (alias values) (children 2)
            ExpressionList (children 2)
             Identifier timestamp
             Identifier value
            ExpressionList (children 4)
             Literal UInt64_100
             Literal UInt64_200
             Literal UInt64_10
             Literal UInt64_15
          TablesInSelectQuery (children 1)
           TablesInSelectQueryElement (children 1)
            TableExpression (children 1)
             TableIdentifier ts_data
          ExpressionList (children 1)
           Identifier fake_key
