java.lang.Object
org.elasticsearch.compute.operator.AbstractPageMappingOperator
org.elasticsearch.compute.operator.EvalOperator
- All Implemented Interfaces:
Closeable,AutoCloseable,Operator,Releasable
Evaluates functions for every position in the block, resulting in a
new block which is appended to the page.
┌──────┬──────────┬────────────┐ ┌──────┬──────────┬────────────┬─────────────┐
│ ref │ class │ discovered │ │ ref │ class │ discovered │ day_of_week │
├──────┼──────────┼────────────┤ ├──────┼──────────┼────────────┼─────────────┤
│ 173 │ Euclid │ 1993-01-01 │ │ 173 │ Euclid │ 1993-01-01 │ Friday │
│ 2317 │ Keter │ 1922-01-01 │ │ 2317 │ Keter │ 1922-01-01 │ Sunday │
│ 2639 │ Euclid │ 2010-01-01 │ -> │ 2639 │ Euclid │ 2010-01-01 │ Friday │
│ 3000 │ Thaumiel │ 1971-01-01 │ │ 3000 │ Thaumiel │ 1971-01-01 │ Friday │
│ 3001 │ Euclid │ 2000-01-02 │ │ 3001 │ Euclid │ 2000-01-02 │ Sunday │
│ 5000 │ Safe │ 2020-12-04 │ │ 5000 │ Safe │ 2020-12-04 │ Friday │
└──────┴──────────┴────────────┘ └──────┴──────────┴────────────┴─────────────┘
ExpressionEvaluators are the things that actually evaluate the function.
They form a tree. ADD(LENGTH(class) + DATE_EXTRACT("year", discovered))
looks like:
┌─────┐
│ ADD │
└──┬──┘
┌───────────────┴───────────────┐
▼ ▼
┌────────┐ ┌──────────────┐
│ LENGTH │ │ DATE_EXTRACT │
└────┬───┘ └──────┬───────┘
│ ┌──────────┴──────────┐
▼ ▼ ▼
┌─────────────┐ ┌─────────────────┐ ┌──────────────────┐
│ LOAD(class) │ │ LITERAL("year") │ │ LOAD(discovered) │
└─────────────┘ └─────────────────┘ └──────────────────┘
And it evaluates like:
┌──────┬──────────┬────────────┐ ┌──────┬──────────┬────────────┬────────┐
│ ref │ class │ discovered │ │ ref │ class │ discovered │ result │
├──────┼──────────┼────────────┤ ├──────┼──────────┼────────────┼────────┤
│ 173 │ Euclid │ 1993-01-01 │ │ 173 │ Euclid │ 1993-01-01 │ 1999 │
│ 2317 │ Keter │ 1922-01-01 │ │ 2317 │ Keter │ 1922-01-01 │ 1927 │
│ 2639 │ Euclid │ 2010-01-01 │ -> │ 2639 │ Euclid │ 2010-01-01 │ 2016 │
│ 3000 │ Thaumiel │ 1971-01-01 │ │ 3000 │ Thaumiel │ 1971-01-01 │ 1979 │
│ 3001 │ Euclid │ 2000-01-02 │ │ 3001 │ Euclid │ 2000-01-02 │ 2006 │
│ 5000 │ Safe │ 2020-12-04 │ │ 5000 │ Safe │ 2020-12-04 │ 2024 │
└──────┴──────────┴────────────┘ └──────┴──────────┴────────────┴────────┘
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.elasticsearch.compute.operator.AbstractPageMappingOperator
AbstractPageMappingOperator.StatusNested classes/interfaces inherited from interface org.elasticsearch.compute.operator.Operator
Operator.OperatorFactory -
Field Summary
Fields inherited from interface org.elasticsearch.compute.operator.Operator
MIN_TARGET_PAGE_SIZE, NOT_BLOCKED, TARGET_PAGE_SIZE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.elasticsearch.compute.operator.AbstractPageMappingOperator
addInput, canProduceMoreDataWithoutExtraInput, finish, getOutput, isFinished, needsInput, status, statusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.compute.operator.Operator
isBlocked, tryPromote
-
Constructor Details
-
EvalOperator
-
-
Method Details
-
process
- Specified by:
processin classAbstractPageMappingOperator
-
toString
- Specified by:
toStringin classAbstractPageMappingOperator
-
close
public void close()Description copied from interface:Operatornotifies the operator that it won't be used anymore (i.e. none of the other methods called), and its resources can be cleaned up- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceOperator- Specified by:
closein interfaceReleasable- Overrides:
closein classAbstractPageMappingOperator
-