QueryPlan
classin packageklyn.data.internal
public class QueryPlan<T, R> implements QueryPlanBase:
QueryPlan
All Implemented Interfaces: QueryPlanBase

Immutable provider-neutral executable subset of the internal KQL QIR.

Providers receive this typed descriptor; they never receive KQL or SQL source text. The compiler creates instances directly from query: blocks.

Example
plan = QueryPlan<Int, Int>(
lambda(value): value > 0,
lambda(value): value,
[], 0, -1, false, "positive values"
)
Properties
Modifier and Type Member Description
public readonly property description
description as String
Compact provider-neutral description used by diagnostics.
public readonly property distinct
distinct as Boolean
True when duplicate projected values must be removed.
public readonly property limit
limit as Long
Maximum row count, or -1 when unbounded.
public readonly property offset
offset as Long
Number of rows skipped after filtering and ordering.
public readonly property orders Stable ordered list of sort keys.
public readonly property predicate
predicate as QueryPredicate<T>
Filter operation.
public readonly property qir Immutable canonical provider representation.
public readonly property selector
selector as QuerySelector<T, R>
Result projection operation.
Constructors
Modifier and Type Member Description
public QueryPlan
QueryPlan( predicate as QueryPredicate<T>, selector as QuerySelector<T, R>, orders as IList<QueryOrderBase<T>>, offset as Long, limit as Long, distinct as Boolean, description as String, qir as QirQueryPlan = null ):
Creates an immutable query plan.
Methods
Modifier and Type Member Description
public addResult
addResult(results as Object, value as Object) as Void:
Adds a provider result after enforcing the plan's concrete result type.
public countMemory
countMemory(source as Object) as Long:
Returns the exact number of rows produced in memory.
public executeMemory
executeMemory(source as Object) as Object:
Executes this typed plan over a compatible memory source.
public existsMemory
existsMemory(source as Object) as Boolean:
Returns whether this plan produces at least one row in memory.
public newResultList
newResultList() as Object:
Creates the concrete specialized result list used by providers.
public openMemoryStream
openMemoryStream(source as Object) as Object:
Opens this memory execution as a sequential stream.
public openProviderStream
openProviderStream(cursor as ProviderResultCursor) as Object:
Wraps a live provider cursor without materializing its remaining rows.
public openResultStream
openResultStream(results as Object) as Object:
Opens a typed stream over an already materialized provider result.
public qirPlan
qirPlan() as QirQueryPlan:
Returns this plan's canonical provider representation.
public withWindow
withWindow(windowOffset as Long, windowLimit as Long) as QueryPlanBase:
Creates a relative immutable result window.
Inherited Methods
methodInherited Methods from QueryPlanBase: addResult, countMemory, executeMemory, existsMemory, newResultList, openMemoryStream, openProviderStream, openResultStream, qirPlan, withWindow