-
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
Allow wildcards with fields! Fixes #3978 #4063
Conversation
92f0afe
to
59ef75a
Compare
@@ -1473,13 +1473,6 @@ func (p *Parser) parseDropContinuousQueryStatement() (*DropContinuousQueryStatem | |||
func (p *Parser) parseFields() (Fields, error) { | |||
var fields Fields | |||
|
|||
// Check for "*" (i.e., "all fields") | |||
if tok, _, _ := p.scanIgnoreWhitespace(); tok == MUL { |
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.
I don't follow why this was removed. Can you explain?
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 previously assumed a single wildcard, and they returned. so something like select *, foo
would fail, but select foo, *
would pass. In general, it's code bloat now and the code below handles a wildcard fine.
I think this needs a single query as a test in |
Change generally makes sense, but I'd like slightly improved test coverage before I'd feel 100%. |
@otoolep I had them in my buffer and forgot to save them gah! Here they are. Thanks! |
+1 |
@corylanou if possible can you check the queries from #3327 against the new code? Those are all the queries in our docs, as of a month ago. Given a major change like this I want to make sure they all still work. |
@beckettsean I think what you are asking me to do is complete #3327 :-). That is beyond the scope of this issue, but I agree, they should all work. We are missing all the data to go with those queries and their results. I do agree we should have that code coverage, but it is going to take some effort to complete that task. In general, this PR puts us further ahead than behind from a functionality standpoint, and we have a lot of test coverage in general around the query language right now. If any bugs do arise from this, they will likely be around the new functionality, not existing functionality. |
@corylanou mostly I was hoping that with some toy data you can replicate the Pulling them out, here's a generic list:
|
Well since you asked so nice how can I say no? 😄 |
+1 |
@beckettsean I added some more tests, but not all of them. Due to the way the parser works, the majority of the test cases don't even touch the branches of code I changed. I know this may look like a sweeping change, but due to the way the parser works, this is actually a somewhat minor change. |
Allow wildcards with fields! Fixes #3978
Thanks very much, @corylanou, getting some of those queries anywhere into the unit tests is fantastic! I was really thinking just manual testing on your branch before merging, so you did more than I expected! |
We previously had checks to disallow mixing fields and wildcards as the functionality was not wired up. We now have the ability to expand wildcard properly even while mixing them with fields/tags. This PR removes the restriction previously added.