-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 querying measurement and fields with spaces #3435
Conversation
switch f.Expr.(type) { | ||
case *VarRef: | ||
// Escape any quotes in the field | ||
if strings.Contains(str, `"`) { |
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.
do we need to handle single quotes too?
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.
Good call. I'll add a test and fix.
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.
Updated.
+1, cherry pick into 0.9.2 |
Fix querying measurement and fields with spaces
@jwilder does this PR do anything to fix the corrupted indexes for people who upgraded to 0.9.1, or is the only solution destroy the data and try again with 0.9.2? |
It should. The indexes are in-memory so they were being indexed differently. The data should still be in the shards unless it was manually dropped or deleted on disk by the user. I tested this by creating measurement and fields with spaces in 0.9.0, upgraded to 0.9.1 and verified the reported error. I then tested this fix with those existing shards by upgrading from both 0.9.0 and 0.9.1 to 0.9.2. Both upgrade paths returned the existing data and was query-able. |
That's awesome! Thanks for verifying. |
In 0.9.1, measurement and field names were getting added to the shard index with and without escaped characters differently from 0.9.0. This prevented queries against the measurements because the parser would look for an unescaped measurement, but the index would have the escaped version causing the measurement to not be queryable. This fix ensures that the index versions are unescaped and also fixes some query bugs where fields and measurements with spaces would not be parseable.
Fixes #3319