This is an automated email from the ASF dual-hosted git repository. hanahmily pushed a commit to branch vectorized-query in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
commit 84cdf6b8b49bcf9d9e5a864e77d6ff0d599b4e08 Author: Hongtao Gao <[email protected]> AuthorDate: Wed May 13 13:45:22 2026 +0000 feat(query/vectorized/measure): expose NewIteratorFromPipeline The G8 vec executor at pkg/query/vectorized/measure/plan composes plan nodes into a *vectorized.Pipeline and needs to wrap that pipeline as an executor.MIterator for the gRPC handler. NewMIterator already does the wrapping, but its body also does leaf-substitution work (builds the source from a MeasureQueryResult, wires it into a one-shot pipeline) that the vec executor performs itself via plan.Build. NewIteratorFromPipeline is the lower-level public constructor: take an already-composed Pipeline and an egress BatchPool, return the public VectorizedMIterator facade. The internal newVectorizedMIterator stays unexported. No behavior change. --- pkg/query/vectorized/measure/integration.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/query/vectorized/measure/integration.go b/pkg/query/vectorized/measure/integration.go index f0805ae2e..ee46610ea 100644 --- a/pkg/query/vectorized/measure/integration.go +++ b/pkg/query/vectorized/measure/integration.go @@ -204,6 +204,17 @@ func NewMIterator(ctx context.Context, qr model.MeasureQueryResult, return &VectorizedMIterator{inner: newVectorizedMIterator(ctx, pipeline, pool)}, nil } +// NewIteratorFromPipeline wraps an already-built *vectorized.Pipeline (with +// its source/operators already attached and Pipeline.Init called) as a +// VectorizedMIterator. Used by the G8 vec executor at +// pkg/query/vectorized/measure/plan to compose plan trees into the public +// MIterator contract without going through NewMIterator's leaf-substitution +// path. pool is the egress BatchPool the adapter recycles consumed batches +// into; it must match the pipeline's terminal output schema. +func NewIteratorFromPipeline(ctx context.Context, pipeline *vectorized.Pipeline, pool *vectorized.BatchPool) *VectorizedMIterator { + return &VectorizedMIterator{inner: newVectorizedMIterator(ctx, pipeline, pool)} +} + // VectorizedMIterator is the public adapter exposed to other packages. It is // a thin facade over the unexported vectorizedMIterator so the executor // interface is satisfied without leaking the package-private type.
