-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #2555: add backreference in CQs #3876
Conversation
ff6640a
to
056e013
Compare
Looks like Circle blew up due to memory pressure. I've seen this before, and it can happen if the code allocates huge buffers by mistake, perhaps in a loop. |
@@ -699,6 +702,8 @@ func (p *Parser) parsePrivilege() (Privilege, error) { | |||
// parseSelectStatement parses a select string and returns a Statement AST object. | |||
// This function assumes the SELECT token has already been consumed. | |||
func (p *Parser) parseSelectStatement(tr targetRequirement) (*SelectStatement, error) { | |||
fmt.Println("parseSelectStatement: start") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot to take this out :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bah!! good catch.
Can you add a test to ensure that |
@dgnorton -- did you work out what caused Circle to fail due to memory pressure? |
@@ -346,7 +351,11 @@ func (s *Service) runContinuousQueryAndWriteResult(cq *ContinuousQuery) error { | |||
} | |||
|
|||
if s.loggingEnabled { | |||
s.Logger.Printf("wrote %d point(s) to %s.%s.%s", len(points), cq.intoDB(), cq.intoRP(), cq.Info.Name) | |||
db := cq.intoDB() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is purely a logging thing? This looks like logic that should be in the cq
object, no?
@otoolep I added a |
5b550d7
to
a3a38ad
Compare
Add new query syntax to allow the following in CQs: INTO "1hPolicy".:MEASUREMENT
a3a38ad
to
2739f5e
Compare
exp: `{"results":[{"series":[{"name":"cpu","columns":["time","count","host","region","value"],"values":[["` + interval2.UTC().Format(time.RFC3339Nano) + `",3,null,null,null]]},{"name":"gpu","columns":["time","count","host","region","value"],"values":[["` + interval1.UTC().Format(time.RFC3339Nano) + `",2,null,null,null],["` + interval0.UTC().Format(time.RFC3339Nano) + `",1,null,null,null]]}]}]}`, | ||
params: url.Values{"db": []string{"db0"}}, | ||
}, | ||
// TODO: restore this test once this is fixed: https://github.com/influxdb/influxdb/issues/3968 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything unique about this test other than duplicate tags? Also, the idiom I like to use is put a skip
in my test struct, then the code isn't commented out, and if you do a verbose log, you can t.Logf
out any skipped table tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It checks the results of a CQ with group by *
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that's what I figured, just wanted to check.
This might be beyond the scope of this PR, but how do we handle:
Looks good. +1 |
I mocked enough of the interfaces in the CQ service tests that it should be relatively easy to add tests for those things but I don't think they're currently tested. |
fix #2555: add backreference in CQs
I want to add suffix for measurement names ,may by like that |
Add new query syntax to allow the following in CQs:
In this example, the regular expression in the
FROM
clause would expand to all measurements and the points selected from each of those measurements would be written into the"1hPolicy"
retention policy with the same measurement names.