Conversation
|
I also changed sam any() to ignore input nulls as is done by the vam any(). |
| } | ||
| } | ||
| vector.Apply(true, s.consume, vals...) | ||
| vector.Apply(false, s.consume, vals...) |
There was a problem hiding this comment.
The main call to apply for vectors is in runtime/vam/op/aggregate/aggregate.go line 84. This one is kind of tricky because you probably want to deunion the key values while keeping aggregate values unioned. We don't really have a way of doing this.
| } | ||
|
|
||
| func (u *union) Consume(vec vector.Any) { | ||
| vector.Apply(true, u.consume, vec) |
There was a problem hiding this comment.
This is going to need to be done the agg functions as well:
- avg
- min/max (math reducer)
- collect
- collectmap
- distinct
- and / or
I'm going to guess that the fuse operator doesn't want this.
This commit changes the calling convention for agg functions so that values are not deunioned though the behavior depends on the sam vs vam. In sam, the deunion is pushed into the agg funcs. In the vam, an agg func will specify whether or not it wants ripped args, but for now, we just have an expedient hack to check for the agg func name "fuse" as this is the only such agg func presently.
|
Ok, I've changed the approach and rather than have vam agg not do a rip, it instead wraps vectors for fuse that shouldn't be ripped in vector.NoRip{}. We can generalize this to a parameter on the agg func down the road but I want to get this fusion stuff working so let's hack this in for now. |
| func (a *count) Consume(vec vector.Any) { | ||
| func (c *count) Consume(vec vector.Any) { | ||
| vector.Apply(true, c.consume, vec) | ||
| } | ||
|
|
||
| func (a *count) consume(vecs ...vector.Any) vector.Any { | ||
| vec := vecs[0] | ||
| if vec.Kind() == vector.KindNull { | ||
| return | ||
| return vec | ||
| } | ||
| a.count += int64(vec.Len()) | ||
| return vec |
There was a problem hiding this comment.
I don't think we need these changes now that we just do NoRip for fuse, no?
There was a problem hiding this comment.
Meant to take that out!
| vector.Apply(true, a.consume, vec) | ||
| } | ||
|
|
||
| func (a *Any) consume(vecs ...vector.Any) vector.Any { | ||
| vec := vecs[0] | ||
| if !a.val.IsNull() || vec.Kind() == vector.KindNull { | ||
| return | ||
| return vec | ||
| } | ||
| var b scode.Builder | ||
| vec.Serialize(&b, 0) | ||
| a.val = super.NewValue(vec.Type(), b.Bytes().Body()) | ||
| return vec |
There was a problem hiding this comment.
Also don't think we need these changes now that we have NoRip for fuse only
Uh oh!
There was an error while loading. Please reload this page.