Skip to content
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 #2944: don't require WHERE time on create CQ #2985

Merged
merged 5 commits into from
Jun 22, 2015
Merged

Conversation

dgnorton
Copy link
Contributor

No description provided.

@dgnorton dgnorton changed the title fix #2944: don't require WHERE time on create CQ (WIP) fix #2944: don't require WHERE time on create CQ Jun 15, 2015
@dgnorton dgnorton changed the title (WIP) fix #2944: don't require WHERE time on create CQ fix #2944: don't require WHERE time on create CQ Jun 15, 2015
@corylanou
Copy link
Contributor

+1

@dgnorton dgnorton force-pushed the cq-nowhere-2944 branch 2 times, most recently from 1cc5344 to 89e9716 Compare June 22, 2015 17:47
@@ -153,6 +153,7 @@ func (s *Service) backgroundLoop() {
return
case <-s.RunCh:
if s.MetaStore.IsLeader() {
s.Logger.Print("running continuous queries by request")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want this logging message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since CQs are usually run by the service, I thought it would be good to log a message if they were triggered by an external request instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed -- that does make sense, and I wanted to be sure that's what it was. +1

@otoolep
Copy link
Contributor

otoolep commented Jun 22, 2015

How does this actually fix the issue? It's not clear to me.

@otoolep
Copy link
Contributor

otoolep commented Jun 22, 2015

Closed in error.

@dgnorton
Copy link
Contributor Author

@otoolep it fixes it by storing the CreateContinuousQuery statement instead of just the SelectStatement inside the create. Then, when the CQ service invokes the parser, it sees the CreateContinuousQuery and goes down that parser path instead of the path for a SelectStatement. The CQ path through the parser doesn't required a WHERE time... clause because the CQ service has to calculate and inject the time range each time it runs the query.

@otoolep
Copy link
Contributor

otoolep commented Jun 22, 2015

OK, makes sense -- thanks @dgnorton.

+1

@@ -244,13 +244,16 @@ func NewTestService(t *testing.T) *Service {

// Set Logger to write to dev/null so stdout isn't polluted.
//null, _ := os.Open(os.DevNull)
s.Logger = log.New(os.Stdout, "", 0)
//s.Logger = log.New(os.Stdout, "", 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want this commented out?

dgnorton added a commit that referenced this pull request Jun 22, 2015
fix #2944: don't require WHERE time on create CQ
@dgnorton dgnorton merged commit eb20558 into master Jun 22, 2015
@dgnorton dgnorton deleted the cq-nowhere-2944 branch June 22, 2015 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants