Package org.rumbledb.runtime.misc
Class ComparisonIterator
java.lang.Object
org.rumbledb.runtime.plan.RuntimePlan<Item>
org.rumbledb.runtime.plan.ItemRuntimePlan
org.rumbledb.runtime.AbstractAtMostOneItemRuntimePlan
org.rumbledb.runtime.misc.ComparisonIterator
- All Implemented Interfaces:
Serializable,AtMostOneLocalRuntimePlan<Item>,LocalRuntimePlan<Item>,NativeQueryRuntimePlan
public class ComparisonIterator
extends AbstractAtMostOneItemRuntimePlan
implements NativeQueryRuntimePlan
This class performs value or general comparison of two items.
The difference lies in the way untyped values are cast.
The existential quantification logic for general comparison is not handled in this iterator, but in the
ComparisonVisitor.
- See Also:
-
Field Summary
Fields inherited from class org.rumbledb.runtime.plan.RuntimePlan
staticContext -
Constructor Summary
ConstructorsConstructorDescriptionComparisonIterator(ItemRuntimePlan leftIterator, ItemRuntimePlan rightIterator, ComparisonExpression.ComparisonOperator comparisonOperator, RuntimeStaticContext staticContext) -
Method Summary
Modifier and TypeMethodDescriptionstatic longcompareItems(Item left, Item right, ComparisonExpression.ComparisonOperator comparisonOperator, ExceptionMetadata ignoredMetadata) evaluateAtMostOne(DynamicContext dynamicContext) Evaluates the plan without allocating a cursor.generateNativeQuery(NativeClauseContext nativeClauseContext) booleanMethods inherited from class org.rumbledb.runtime.AbstractAtMostOneItemRuntimePlan
createNativeCursorMethods inherited from class org.rumbledb.runtime.plan.ItemRuntimePlan
getChild, getChildren, getStaticType, getVariableDependencies, isSparkJobNeeded, printMethods inherited from class org.rumbledb.runtime.plan.RuntimePlan
getConfiguration, getCursor, getDataFrame, getMetadata, getRDD, getRuntimeStaticContext, materialize, materializeAtMost, materializeAtMostOne, materializeExactlyOne, materializeFirstOrNull
-
Constructor Details
-
ComparisonIterator
public ComparisonIterator(ItemRuntimePlan leftIterator, ItemRuntimePlan rightIterator, ComparisonExpression.ComparisonOperator comparisonOperator, RuntimeStaticContext staticContext)
-
-
Method Details
-
getComparisonOperator
-
isValueEquality
public boolean isValueEquality() -
getLeftIterator
-
getRightIterator
-
evaluateAtMostOne
Description copied from interface:AtMostOneLocalRuntimePlanEvaluates the plan without allocating a cursor.- Specified by:
evaluateAtMostOnein interfaceAtMostOneLocalRuntimePlan<Item>- Specified by:
evaluateAtMostOnein classAbstractAtMostOneItemRuntimePlan- Parameters:
dynamicContext- the dynamic context for the evaluation- Returns:
- the value, or
nullfor the empty sequence
-
compareItems
public static long compareItems(Item left, Item right, ComparisonExpression.ComparisonOperator comparisonOperator, ExceptionMetadata ignoredMetadata) -
generateNativeQuery
- Specified by:
generateNativeQueryin interfaceNativeQueryRuntimePlan
-