Record Class ExternalOptimizerContext
LocalPhysicalOptimizerContext.
Today it carries only the FormatReaderRegistry, which a small set of optimizer rules
consult to discover what an external source's underlying reader supports (filter pushdown,
aggregate pushdown, deferred column extraction). Encapsulating it here keeps the parent
context's signature stable as new external-source-only fields appear (e.g. capability sets,
per-source statistics caches): future additions land on this record, never on
LocalPhysicalOptimizerContext.
Instances are constructed once per local-plan invocation by
PlannerUtils.localPlan(... FormatReaderRegistry ...); rules read through
LocalPhysicalOptimizerContext.external(). Use NONE for callers (e.g.
coordinator-side optimization, lookup-service planning, tests) that have no external sources
in scope.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ExternalOptimizerContextSentinel for callers without any external-source state. -
Constructor Summary
ConstructorsConstructorDescriptionExternalOptimizerContext(FormatReaderRegistry formatReaderRegistry) Creates an instance of aExternalOptimizerContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theformatReaderRegistryrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
Sentinel for callers without any external-source state. Rules that consult external capabilities must treatformatReaderRegistry == nullas "no information" and bail out of the optimization, mirroring the previous behavior when the registry field was unset on the parent context.
-
-
Constructor Details
-
ExternalOptimizerContext
Creates an instance of aExternalOptimizerContextrecord class.- Parameters:
formatReaderRegistry- the value for theformatReaderRegistryrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
formatReaderRegistry
Returns the value of theformatReaderRegistryrecord component.- Returns:
- the value of the
formatReaderRegistryrecord component
-