Class TopNExec
java.lang.Object
org.elasticsearch.xpack.esql.core.tree.Node<PhysicalPlan>
org.elasticsearch.xpack.esql.plan.QueryPlan<PhysicalPlan>
org.elasticsearch.xpack.esql.plan.physical.PhysicalPlan
org.elasticsearch.xpack.esql.plan.physical.UnaryExec
org.elasticsearch.xpack.esql.plan.physical.TopNExec
- All Implemented Interfaces:
NamedWriteable,Writeable,EstimatesRowSize
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.tree.Node
Node.NodeStringFormatNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.plan.physical.EstimatesRowSize
EstimatesRowSize.StateNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_LINES, TO_STRING_MAX_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionTopNExec(Source source, PhysicalPlan child, List<Order> order, Expression limit, Integer estimatedRowSize) -
Method Summary
Modifier and TypeMethodDescriptionstatic TopNEncoderencoder(DataType type, IndexedByShardId<? extends org.elasticsearch.core.RefCounted> shardContexts) The encoder to use when a field is included in the sort.booleanEstimate of the number of bytes that'll be loaded per position before the stream of pages is consumed.Estimate the number of bytes that'll be loaded per position before the stream of pages is consumed.inthashCode()info()Normally, you want to use one of the staticcreatemethods to implement this.limit()order()replaceChild(PhysicalPlan newChild) withDocValuesAttributes(Set<Attribute> docValuesAttributes) withMinCompetitive(SharedMinCompetitive.Supplier minCompetitive) voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.plan.physical.UnaryExec
child, inputSet, output, outputSet, replaceChildrenMethods inherited from class org.elasticsearch.xpack.esql.plan.QueryPlan
computeExpressions, computeReferences, expressions, forEachExpression, forEachExpression, forEachExpressionDown, forEachExpressionUp, references, transformExpressionsDown, transformExpressionsDown, transformExpressionsOnly, transformExpressionsOnly, transformExpressionsOnlyUp, transformExpressionsUp, transformExpressionsUpMethods inherited from class org.elasticsearch.xpack.esql.core.tree.Node
allMatch, anyMatch, children, collect, collect, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachDownMayReturnEarly, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, nodeString, nodeString, propertiesToString, replaceChildrenSameSize, source, sourceLocation, sourceText, toString, toString, transformChildren, transformChildren, transformDown, transformDown, transformDown, transformDown, transformDownSkipBranch, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp, transformUp
-
Field Details
-
ENTRY
-
-
Constructor Details
-
TopNExec
public TopNExec(Source source, PhysicalPlan child, List<Order> order, Expression limit, Integer estimatedRowSize)
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
info
Description copied from class:NodeNormally, you want to use one of the staticcreatemethods to implement this.For
QueryPlans, it is very important that the properties contain all of the expressions and references relevant to this node, and that all the properties are used in the provided constructor; otherwise query plan transformations likeQueryPlan#transformExpressionsOnly(Function)will not have an effect.- Specified by:
infoin classNode<PhysicalPlan>
-
replaceChild
- Specified by:
replaceChildin classUnaryExec
-
withDocValuesAttributes
-
withSortedInput
-
withNonSortedInput
-
minCompetitive
-
minCompetitiveKeyConfig
-
limit
-
order
-
docValuesAttributes
-
estimatedRowSize
Estimate of the number of bytes that'll be loaded per position before the stream of pages is consumed. -
estimateRowSize
Description copied from interface:EstimatesRowSizeEstimate the number of bytes that'll be loaded per position before the stream of pages is consumed.- Specified by:
estimateRowSizein interfaceEstimatesRowSize
-
hashCode
public int hashCode() -
equals
-
inputOrdering
-
encoder
public static TopNEncoder encoder(DataType type, IndexedByShardId<? extends org.elasticsearch.core.RefCounted> shardContexts) The encoder to use when a field is included in the sort.This is essentially one big
switchstatement ontype. It intentionally doesn't have adefaultand shouldn't add one. We want to make sure that folks who add a new type think about sorting.While a type is
underConstructionits fine if theswitchthrows anIllegalStateException. But before the type is released we need to support the type.
-