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

Fix bug where aggregate operations could not change type #1318

Merged
merged 1 commit into from
Apr 12, 2017

Conversation

nathanielc
Copy link
Contributor

@nathanielc nathanielc commented Apr 12, 2017

Fixes #1271

  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated

Values: [][]interface{}{
{
time.Date(1971, 1, 1, 0, 0, 20, 0, time.UTC),
1.0,
Copy link
Contributor

Choose a reason for hiding this comment

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

What would have happened previously? It would have been a int?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or does it have to do with the type of value changing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or is it something else entirely. I think I might be confused about what this fixes.

Copy link
Contributor

Choose a reason for hiding this comment

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

This being this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously it would have errored and returned no value.

Copy link
Contributor Author

@nathanielc nathanielc Apr 12, 2017

Choose a reason for hiding this comment

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

To be more clear, the result here will always be an int since count returns an int. That isn't the type that is changing. Rather the type of the aggregate function used to perform the count (yes it is typed) wasn't changing. So in this test the first window is empty and so we choose a default type of float, but on the second window when there are actual values that are ints, we needed to change the aggregator function to be the int type function. Previous to this fix it would have logged an error about the types and returned no data for the count operation.

Copy link
Contributor

Choose a reason for hiding this comment

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

got it

Copy link
Contributor

Choose a reason for hiding this comment

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

that makes sense

@nathanielc nathanielc merged commit 7dfb18d into master Apr 12, 2017
nathanielc added a commit that referenced this pull request Apr 12, 2017
Fix bug where aggregate operations could not change type
@nathanielc nathanielc deleted the nc-issue#1271 branch April 12, 2017 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants