-
Notifications
You must be signed in to change notification settings - Fork 488
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
Preserve tags fields simple selector #425
Preserve tags fields simple selector #425
Conversation
484554f
to
4d57f99
Compare
This pull request and #422 are failing because of:
If I am not mistaken the "go tool vet" is baked in go and there is no need to "go get" it. |
4d57f99
to
68d34b8
Compare
@@ -125,7 +143,7 @@ func (e *{{.name}}PointEmitter) EmitPoint() (models.Point, error) { | |||
Time: t, | |||
Group: e.group, | |||
Dimensions: e.dimensions, | |||
Tags: e.tags, | |||
Tags: ap.Aux[0].(models.Tags), |
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 looks like the cause of the CI failure. ap.Aux[0] will only have the tags if isSimpleSelector is true.
@yosiat Other than those two small issues this looks good to go. Thanks! |
68d34b8
to
6871378
Compare
@nathanielc , I added a simple condition to fetch from the tags from the right place (aux/emitter's tags). I see that in floatPointBulkAggregator.AggregateBatch, I do put the tags in the aux fields, but on floatPointEmitter.EmitPoint the Aux is empty. Do you know why? |
@yosiat I took a look at the percentile case. Looks like a bug on the InfluxDB side https://github.com/influxdata/influxdb/blob/master/influxql/call_iterator.go#L991 The returned point does not preserve Aux fields or Tags. I'll ping them and see what they say. It should be an easy fix on their end of things. |
This is the PR for fixing percentile in InfluxDB influxdata/influxdb#6293 |
8947464
to
b3641be
Compare
@nathanielc I tried to run the tests after doing "git pull" in $GOPATH/github.com/influxdata/influxdb but I am getting those errors:
I did something wrong, or should I fix those errors? |
Nope, InfluxDB core changed again and broke things. I am working on setting up vendoring so that things like this don't keep breaking Kapacitor builds. |
@yosiat Vendoring complete, a rebase should fix the build. |
b3641be
to
cc3cc3e
Compare
@nathanielc for some reason I fail to run the tests:
do you have any idea why? |
@yosiat Not sure, what is |
@nathanielc I have no idea as well.. I will try to check why TopSelectorTests are not passing and will fix the TestStream_InfluxQL tests to contain the tags in their expectations tomorrow. |
@nathanielc Does those are simple selectors as well?
By the way, I found another way to run the tests that runs -
|
@nathanielc are we good to go? If so I will squash |
@@ -81,6 +91,10 @@ func (a *floatPointBulkAggregator) AggregateBatch(b *models.Batch) { | |||
// We need to populate the Aux fields | |||
floatPopulateAuxFieldsAndTags(&slice[i], a.topBottomInfo.FieldsAndTags, p.Fields, p.Tags) | |||
} | |||
|
|||
if a.isSimpleSelector { | |||
(&slice[i]).Aux = []interface{}{p.Tags} |
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.
There shouldn't be any need here to take the reference of the slice element.
@yosiat Just those minor changes and a squash and this should be good to go. Thanks! |
@yosiat Also can you add a CHANGELOG entry? And mark it as BREAKING? Since is possible that someone was relying on the previous incorrect behavior. |
5d7efb7
to
02f4e89
Compare
@nathanielc Done, can you make sure the changelog/indentation formatting is ok? |
@@ -12,6 +12,7 @@ type ReduceCreater struct { | |||
{{end}}{{end}}{{end}} | |||
|
|||
TopBottomCallInfo *TopBottomCallInfo | |||
IsSimpleSelector bool |
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.
Can you fix these spaces 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.
done
02f4e89
to
4cd6a37
Compare
@nathanielc the tests are passing and the formatting is ok 👍 |
Fixes #371