Documentation
¶
Overview ¶
Package stream implements execution operations for querying stream data.
Index ¶
- Variables
- func Analyze(criteria *streamv1.QueryRequest, metadata []*commonv1.Metadata, ...) (logical.Plan, error)
- func BuildSchema(sm *databasev1.Stream, indexRules []*databasev1.IndexRule) (logical.Schema, error)
- func DistributedAnalyze(criteria *streamv1.QueryRequest, ss []logical.Schema) (logical.Plan, error)
- func VecDeclineReason(plan logical.Plan) string
- func VecExecutable(plan logical.Plan) executor.StreamVecExecutable
- func VecOffsetLimit(plan logical.Plan) (offsetNum, limitNum uint32, ok bool)
- type Parent
- type VecCriteriaFilter
- type VecMerge
- type VecMergeGroup
Constants ¶
This section is empty.
Variables ¶
var ( // ENode is an empty node. ENode = new(emptyNode) )
Functions ¶
func Analyze ¶ added in v0.3.0
func Analyze(criteria *streamv1.QueryRequest, metadata []*commonv1.Metadata, ss []logical.Schema, ecc []executor.StreamExecutionContext) (logical.Plan, error)
Analyze converts logical expressions to executable operation tree represented by Plan.
func BuildSchema ¶ added in v0.3.0
func BuildSchema(sm *databasev1.Stream, indexRules []*databasev1.IndexRule) (logical.Schema, error)
BuildSchema returns Schema loaded from the metadata repository.
func DistributedAnalyze ¶ added in v0.5.0
DistributedAnalyze converts logical expressions to executable operation tree represented by Plan.
func VecDeclineReason ¶ added in v0.12.0
VecDeclineReason explains why VecExecutable rejected a plan, for the error the caller returns to the client. It is empty when the plan is vec-eligible.
func VecExecutable ¶ added in v0.11.0
func VecExecutable(plan logical.Plan) executor.StreamVecExecutable
VecExecutable returns the vec-eligible StreamVecExecutable at the scan position of the analyzed plan, or nil when the plan cannot be vectorized.
Eligibility: the plan top is the *limit node (stream_analyzer.go:86); its Input must resolve to a *localIndexScan — either directly (no criteria) or wrapped in a *tagFilterPlan (criteria query, stream_plan_tag_filter.go). For the tag-filter case the inner scan already projects the criteria + hidden tags and pushes the INDEXED criteria into its sqo (invertedFilter/skippingFilter); the caller then applies the criteria and the hidden-tag removal to the BATCH COLUMNS before it picks a response format (via VecTagFilter and the processor's shared batch stage). Results match the filter-first contract for duplicate ElementIDs — see BuildStreamMergePipeline. A multi-group merger or any other shape does not resolve to a *localIndexScan, so we decline and the caller fails the query.
An index-order query need not project its ordered tag: vecTagProjection adds it to the scan's request and keeps it out of ProjectionTags().
func VecOffsetLimit ¶ added in v0.11.0
VecOffsetLimit returns the client offset/limit the *limit plan node carries, so the standalone vec egress can apply the same offset:offset+limit slice the row *limit.Execute would apply. Returns ok=false when plan is not the *limit shape.
Types ¶
type Parent ¶ added in v0.3.0
type Parent struct {
UnresolvedInput logical.UnresolvedPlan
Input logical.Plan
}
Parent refers to a parent node in the execution tree(plan).
type VecCriteriaFilter ¶ added in v0.12.0
type VecCriteriaFilter struct {
// TagFilter is the SAME logical.TagFilter the row tagFilterPlan.Execute ran.
TagFilter logical.TagFilter
// HiddenTags are the criteria-only tags the analyzer appended to the projection.
// Both egresses must remove them: the proto egress per element, the frame egress
// by dropping the whole column.
HiddenTags logical.HiddenTagSet
// Schema is the projected schema the filter indexes its cells against.
Schema logical.Schema
// PreMerged reports that the scan runs TagFilter on the columns ahead of the
// merge, for every order type. The egress then owes only
// the hidden-tag removal, because every row it receives already matched;
// re-matching per element is waste. apache/skywalking#14067 R1.
PreMerged bool
}
VecCriteriaFilter is the criteria stage a *tagFilterPlan carries, in the form the vec egress consumes. It replaced a five-value return: the group fields travel together everywhere, so one struct reads better and VecMergeGroup embeds it.
func VecTagFilter ¶ added in v0.11.0
func VecTagFilter(plan logical.Plan) (VecCriteriaFilter, bool)
VecTagFilter returns the criteria tag filter, the hidden-tag set, and the schema carried by the *limit plan's *tagFilterPlan input, so the vec egress can apply the SAME logical.TagFilter and the same hidden-tag removal the row path's tagFilterPlan.Execute applied. Both now run on the batch columns, for every response format. Returns ok=false when the plan is not the *limit → *tagFilterPlan shape (a criteria-less query needs no post-filter).
type VecMerge ¶ added in v0.11.0
type VecMerge struct {
Groups []VecMergeGroup
Offset uint32
Limit uint32
SortByTime bool
Desc bool
}
VecMerge is the vec-eligible form of a multi-group query (*limit → *mergePlan). It carries each group's resolved vec node plus the merge params (SortByTime, Desc), so the dispatch merges the groups' batches and slices with Offset/Limit.
func VecMergeExecutable ¶ added in v0.11.0
VecMergeExecutable returns the vec-eligible multi-group form when the plan is *limit → *mergePlan and EVERY subPlan resolves to a vec-eligible *localIndexScan (via scanFromInput, incl. orderTagProjected). If ANY subPlan is not vec-eligible, it returns ok=false so the whole query runs the row path — vec and row are never mixed across groups. The merge params (sortByTime/desc) are taken verbatim from the mergePlan so the cross-group order matches the group scans.
type VecMergeGroup ¶ added in v0.11.0
type VecMergeGroup struct {
Scan executor.StreamVecExecutable
Criteria VecCriteriaFilter
HasFilter bool
}
VecMergeGroup is one group's resolved vec scan plus its optional criteria stage, for the multi-group dispatch. The processor runs Scan.ExecuteVectorized, then the shared batch stage (criteria filter behind the cap, then the hidden-tag column drop); the caller then merges the groups' staged batches in one pipeline.