Package org.rumbledb.runtime.misc
Class RangeOperationIterator
java.lang.Object
org.rumbledb.runtime.RuntimeIterator
org.rumbledb.runtime.HybridRuntimeIterator
org.rumbledb.runtime.misc.RangeOperationIterator
- All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable
,Serializable
,RuntimeIteratorInterface
- See Also:
-
Field Summary
FieldsFields inherited from class org.rumbledb.runtime.HybridRuntimeIterator
result
Fields inherited from class org.rumbledb.runtime.RuntimeIterator
children, currentDynamicContextForLocalExecution, FLOW_EXCEPTION_MESSAGE, hasNext, isOpen, isSequential, isUpdating, staticContext, staticURI
-
Constructor Summary
ConstructorsConstructorDescriptionRangeOperationIterator
(RuntimeIterator leftIterator, RuntimeIterator rightiterator, RuntimeStaticContext staticContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
static JSoundDataFrame
createLongInterval
(long left, long right) Creates a dataframe with a sequence of increasing numbers, of type long.generateNativeQuery
(NativeClauseContext nativeClauseContext) This function generate (if possible) a native spark-sql query that maps the inner working of the iteratorgetDataFrame
(DynamicContext context) protected org.apache.spark.api.java.JavaRDD<Item>
getRDDAux
(DynamicContext context) boolean
protected boolean
init
(DynamicContext context) Initializes the boundaries of the range.void
protected void
Methods inherited from class org.rumbledb.runtime.HybridRuntimeIterator
close, dataFrameToRDDOfItems, fallbackToRDDIfDFNotImplemented, getRDD, hasNext, implementsLocal, implementsRDD, materialize, materializeAtMostOneItemOrNull, materializeExactlyOneItem, materializeFirstItemOrNull, materializeNFirstItems, next, open, reset
Methods inherited from class org.rumbledb.runtime.RuntimeIterator
bindToVariableInDynamicContext, canProduceDataFrame, deepCopy, getConfiguration, getEffectiveBooleanValue, getEffectiveBooleanValueOrCheckPosition, getHighestExecutionMode, getMetadata, getOrCreateDataFrame, getPendingUpdateList, getStaticType, getVariableDependencies, isDataFrame, isLocal, isOpen, isRDD, isRDDOrDataFrame, isSequential, isSparkJobNeeded, isUpdating, materialize, materializeAtMostOneItemOrDefault, print, printToStandardError, read, setStaticContext, write
-
Field Details
-
PARTITION_SIZE
public static final int PARTITION_SIZE- See Also:
-
-
Constructor Details
-
RangeOperationIterator
public RangeOperationIterator(RuntimeIterator leftIterator, RuntimeIterator rightiterator, RuntimeStaticContext staticContext)
-
-
Method Details
-
hasNextLocal
public boolean hasNextLocal()- Specified by:
hasNextLocal
in classHybridRuntimeIterator
-
nextLocal
- Specified by:
nextLocal
in classHybridRuntimeIterator
-
init
Initializes the boundaries of the range.- Parameters:
context
- the dynamic context.- Returns:
- true if the two bounds are defined, false if one of them is the empty sequence.
-
openLocal
public void openLocal()- Specified by:
openLocal
in classHybridRuntimeIterator
-
getRDDAux
- Specified by:
getRDDAux
in classHybridRuntimeIterator
-
implementsDataFrames
protected boolean implementsDataFrames()- Overrides:
implementsDataFrames
in classHybridRuntimeIterator
-
getDataFrame
- Overrides:
getDataFrame
in classRuntimeIterator
-
createLongInterval
Creates a dataframe with a sequence of increasing numbers, of type long.- Parameters:
left
- the left bound(inclusive).right
- the right bound (inclusive).- Returns:
-
closeLocal
protected void closeLocal()- Specified by:
closeLocal
in classHybridRuntimeIterator
-
resetLocal
protected void resetLocal()- Specified by:
resetLocal
in classHybridRuntimeIterator
-
generateNativeQuery
Description copied from class:RuntimeIterator
This function generate (if possible) a native spark-sql query that maps the inner working of the iterator- Overrides:
generateNativeQuery
in classRuntimeIterator
- Parameters:
nativeClauseContext
- context information to generate the native query- Returns:
- a native clause context with the spark-sql native query to get an equivalent result of the iterator, or [NativeClauseContext.NoNativeQuery] if it is not possible
-