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

Evaluate a true boolean literal when calculating tag sets #9491

Merged
merged 1 commit into from
Feb 28, 2018

Conversation

jsternberg
Copy link
Contributor

Fixes #9290.

@ghost ghost assigned jsternberg Feb 27, 2018
@ghost ghost added the review label Feb 27, 2018
@jsternberg
Copy link
Contributor Author

This should fix #9290 in 1.5. It does not backport cleanly to 1.4 since this specific area of the code was modified for TSI. The fix for 1.4 is pretty similar though and is partially shared with this change.

This PR does not require, but is helped out by influxdata/influxql#11. While that PR makes this one unnecessary, I think that this functionality is still useful to reduce confusion when coding.

Copy link
Contributor

@e-dard e-dard left a comment

Choose a reason for hiding this comment

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

LGTM 👍 aside from the couple of style nits.

tsdb/index.go Outdated
case *influxql.BooleanLiteral:
if expr.Val {
return is.measurementSeriesIDIterator(name)
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can drop the else and just return nil, nil

case *influxql.BooleanLiteral:
if n.Val {
return m.SeriesIDs(), nil, nil
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, else can be removed.

@jsternberg jsternberg force-pushed the js-9290-index-boolean-literals branch from a00ad2e to 4b58218 Compare February 28, 2018 14:07
@jsternberg jsternberg force-pushed the js-9290-index-boolean-literals branch from 4b58218 to 6baf354 Compare February 28, 2018 14:08
@jsternberg jsternberg merged commit 87ac8ad into master Feb 28, 2018
@jsternberg jsternberg deleted the js-9290-index-boolean-literals branch February 28, 2018 15:14
@ghost ghost removed the review label Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants