(tsVec vector.Any, bin nano.Duration)
| 53 | } |
| 54 | |
| 55 | func (b *Bucket) constBin(tsVec vector.Any, bin nano.Duration) vector.Any { |
| 56 | if bin == 0 { |
| 57 | return cast.To(b.sctx, tsVec, b.resultType(tsVec)) |
| 58 | } |
| 59 | switch tsVec := tsVec.(type) { |
| 60 | case *vector.Const: |
| 61 | typ := b.resultType(tsVec) |
| 62 | ts := vector.IntValue(tsVec, 0) |
| 63 | return vector.NewConstInt(typ, ts, tsVec.Len()) |
| 64 | case *vector.View: |
| 65 | return vector.NewView(b.constBinFlat(tsVec.Any, bin), tsVec.Index) |
| 66 | case *vector.Dict: |
| 67 | return vector.NewDict(b.constBinFlat(tsVec.Any, bin), tsVec.Index, tsVec.Counts) |
| 68 | default: |
| 69 | return b.constBinFlat(tsVec, bin) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | func (b *Bucket) constBinFlat(tsVecFlat vector.Any, bin nano.Duration) *vector.Int { |
| 74 | tsVec := tsVecFlat.(*vector.Int) |
no test coverage detected