public abstract class HashJoinOperator extends TableStreamOperator<RowData> implements TwoInputStreamOperator<RowData,RowData,RowData>, BoundedMultiInput, InputSelectable
The join operator implements the logic of a join operator at runtime. It uses a
hybrid-hash-join internally to match the records with equal key. The build side of the hash is
the first input of the match. It support all join type in HashJoinType
.
chainingStrategy, config, latencyStats, metrics, output, processingTimeService
Modifier and Type | Method and Description |
---|---|
void |
close()
This method is called after all records have been added to the operators via the methods
Input.processElement(StreamRecord) , or TwoInputStreamOperator.processElement1(StreamRecord) and TwoInputStreamOperator.processElement2(StreamRecord) . |
void |
endInput(int inputId)
It is notified that no more data will arrive on the input identified by the
inputId . |
abstract void |
join(RowIterator<BinaryRowData> buildIter,
RowData probeRow) |
static HashJoinOperator |
newHashJoinOperator(HashJoinType type,
GeneratedJoinCondition condFuncCode,
boolean reverseJoinFunction,
boolean[] filterNullKeys,
GeneratedProjection buildProjectionCode,
GeneratedProjection probeProjectionCode,
boolean tryDistinctBuildRow,
int buildRowSize,
long buildRowCount,
long probeRowCount,
RowType keyType) |
InputSelection |
nextSelection()
Returns the next
InputSelection that wants to get the record. |
void |
open()
This method is called immediately before any elements are processed, it should contain the
operator's initialization logic, e.g.
|
void |
processElement1(StreamRecord<RowData> element)
Processes one element that arrived on the first input of this two-input operator.
|
void |
processElement2(StreamRecord<RowData> element)
Processes one element that arrived on the second input of this two-input operator.
|
computeMemorySize, dispose
getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, initializeState, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark, processWatermark1, processWatermark2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, setup, snapshotState, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processLatencyMarker1, processLatencyMarker2, processWatermark1, processWatermark2
dispose, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
notifyCheckpointAborted, notifyCheckpointComplete
getCurrentKey, setCurrentKey
public void open() throws Exception
AbstractStreamOperator
The default implementation does nothing.
open
in interface StreamOperator<RowData>
open
in class AbstractStreamOperator<RowData>
Exception
- An exception in this method causes the operator to fail.public void processElement1(StreamRecord<RowData> element) throws Exception
TwoInputStreamOperator
processElement1
in interface TwoInputStreamOperator<RowData,RowData,RowData>
Exception
public void processElement2(StreamRecord<RowData> element) throws Exception
TwoInputStreamOperator
processElement2
in interface TwoInputStreamOperator<RowData,RowData,RowData>
Exception
public InputSelection nextSelection()
InputSelectable
InputSelection
that wants to get the record. This method is
guaranteed to not be called concurrently with other methods of the operator.nextSelection
in interface InputSelectable
public void endInput(int inputId) throws Exception
BoundedMultiInput
inputId
.
The inputId
is numbered starting from 1, and `1` indicates the first input.endInput
in interface BoundedMultiInput
Exception
public abstract void join(RowIterator<BinaryRowData> buildIter, RowData probeRow) throws Exception
Exception
public void close() throws Exception
AbstractStreamOperator
Input.processElement(StreamRecord)
, or TwoInputStreamOperator.processElement1(StreamRecord)
and TwoInputStreamOperator.processElement2(StreamRecord)
.
The method is expected to flush all remaining buffered data. Exceptions during this flushing of buffered should be propagated, in order to cause the operation to be recognized asa failed, because the last data items are not processed properly.
close
in interface StreamOperator<RowData>
close
in class TableStreamOperator<RowData>
Exception
- An exception in this method causes the operator to fail.public static HashJoinOperator newHashJoinOperator(HashJoinType type, GeneratedJoinCondition condFuncCode, boolean reverseJoinFunction, boolean[] filterNullKeys, GeneratedProjection buildProjectionCode, GeneratedProjection probeProjectionCode, boolean tryDistinctBuildRow, int buildRowSize, long buildRowCount, long probeRowCount, RowType keyType)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.