| 275 | } |
| 276 | |
| 277 | func (p *PredicateWalk) evalForList(lhs, rhs vector.Any, offsets, index []uint32) vector.Any { |
| 278 | n := lhs.Len() |
| 279 | var nulls, trues roaring.Bitmap |
| 280 | var lhsIndex, rhsIndex []uint32 |
| 281 | for j := range n { |
| 282 | idx := j |
| 283 | if index != nil { |
| 284 | idx = index[j] |
| 285 | } |
| 286 | start, end := offsets[idx], offsets[idx+1] |
| 287 | if start == end { |
| 288 | continue |
| 289 | } |
| 290 | n := end - start |
| 291 | lhsIndex = slices.Grow(lhsIndex[:0], int(n))[:n] |
| 292 | rhsIndex = slices.Grow(rhsIndex[:0], int(n))[:n] |
| 293 | for k := range n { |
| 294 | lhsIndex[k] = j |
| 295 | rhsIndex[k] = k + start |
| 296 | } |
| 297 | lhsView := vector.Pick(lhs, lhsIndex) |
| 298 | rhsView := vector.Pick(rhs, rhsIndex) |
| 299 | vec := p.Eval(lhsView, rhsView) |
| 300 | if hasTrue(vec) { |
| 301 | trues.Add(j) |
| 302 | } else if hasNull(vec) { |
| 303 | nulls.Add(j) |
| 304 | } |
| 305 | } |
| 306 | truesVec := vector.NewFalse(n) |
| 307 | trues.WriteDenseTo(truesVec.GetBits()) |
| 308 | nullsVec := vector.NewNull(n) |
| 309 | return combine(truesVec, nullsVec, nulls.ToArray()) |
| 310 | } |
| 311 | |
| 312 | func hasNull(vec vector.Any) bool { |
| 313 | var hasNull bool |