From 365072013d5dbe589759a1e2e5c71490d57f4d37 Mon Sep 17 00:00:00 2001 From: kun Date: Fri, 8 May 2020 15:57:25 +0800 Subject: [PATCH] feat: add CleanGroupByIntervalCache API After called GroupByInterval function, if we update the `time` in Dimensions, we still got the cached interval. --- ast.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ast.go b/ast.go index 140a42c..403c131 100644 --- a/ast.go +++ b/ast.go @@ -1859,6 +1859,11 @@ func (s *SelectStatement) HasDimensionWildcard() bool { return false } +// CleanGroupByIntervalCache cleans the cached time interval. +func (s *SelectStatement) CleanGroupByIntervalCache() { + s.groupByInterval = 0 +} + // GroupByInterval extracts the time interval, if specified. func (s *SelectStatement) GroupByInterval() (time.Duration, error) { // return if we've already pulled it out