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
Maintain the tags of points selected by top() or bottom() when writing the results #8398
Conversation
78095e1
to
d96d74a
Compare
I wanted to get this up to allow discussion about it and methods (along with letting those who are interested build the PR themselves), but this explicitly needs tests before it is merged. The existing tests ensure that it doesn't change current behavior for queries, but the new behavior is strange enough that the lack of tests is a blocker to merging. |
d466587
to
10aae0b
Compare
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.
One small nit, LGTM.
influxql/call_iterator.go
Outdated
@@ -781,39 +781,47 @@ func IntegerSpreadReduceSlice(a []IntegerPoint) []IntegerPoint { | |||
return []IntegerPoint{{Time: ZeroTime, Value: max - min}} | |||
} | |||
|
|||
func newTopIterator(input Iterator, opt IteratorOptions, n int) (Iterator, error) { | |||
func newTopIterator(input Iterator, opt IteratorOptions, n int, writeMode bool) (Iterator, error) { |
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.
Should writeMode
be named keepTags
? Seems like that is what it indicates as opposed to having multiple values.
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.
That sounds fine to me. The name of the variable was rather arbitrary to begin with. I couldn't think of something good.
10aae0b
to
a5bb16e
Compare
…g the results When a `SELECT ... INTO ...` is used with `top()` or `bottom()` used with tags, the points will be written with the tags still intact instead of converted to fields.
a5bb16e
to
9edf236
Compare
When a
SELECT ... INTO ...
is used withtop()
orbottom()
used withtags, the points will be written with the tags still intact instead of
converted to fields.
Fixes #7129.