| 170 | } |
| 171 | |
| 172 | func (n *nestedLoopJoin) makeHitsResult(vec vector.Any, hits *roaring.Bitmap) (vector.Any, bool) { |
| 173 | vecLen := uint64(vec.Len()) |
| 174 | if hits.GetCardinality() == vecLen { |
| 175 | // No misses. |
| 176 | return nil, false |
| 177 | } |
| 178 | hits.Flip(0, vecLen) |
| 179 | missVec := vector.Pick(vec, hits.ToArray()) |
| 180 | fieldName := n.leftAlias |
| 181 | if n.style == "right" { |
| 182 | fieldName = n.rightAlias |
| 183 | } |
| 184 | return vector.Apply(false, func(vecs ...vector.Any) vector.Any { |
| 185 | typ := n.rctx.Sctx.MustLookupTypeRecord([]super.Field{ |
| 186 | super.NewField(fieldName, vecs[0].Type()), |
| 187 | }) |
| 188 | return vector.NewRecord(typ, vecs, vecs[0].Len()) |
| 189 | }, missVec), true |
| 190 | } |