java.lang.Object
com.pervasive.datarush.operators.AbstractLogicalOperator
com.pervasive.datarush.operators.CompositeOperator
com.pervasive.datarush.operators.join.AbstractRelationalJoin
- All Implemented Interfaces:
LogicalOperator
- Direct Known Subclasses:
FilterExistingRows,Join,SemiJoin
Common base class for the various types of join that we support.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCompose the body of this operator.protected abstract RecordPortcomposeJoin(CompositionContext ctx, RecordPort left, RecordPort right, JoinKey[] keys) final ScalarValuedFunctionIf non-null, the condition is evaluated for every possible matching row.final JoinKey[]Returns the join keys to use when performing the join.getLeft()Returns the left input port.Returns the output port.getRight()Returns the right input port.final booleanReturns whether to perform the join as a hash join.protected final intfinal voidsetJoinCondition(ScalarValuedFunction joinCondition) Sets the join condition.final voidsetJoinCondition(String joinCondition) Sets the join condition.final voidsetJoinKeys(JoinKey[] joinKeys) Sets the join keys to use when performing the join.final voidsetJoinKeys(String[] keyFieldNames) Sets the join keys to use when performing the join.final voidsetJoinKeys(String[] leftKeyFieldNames, String[] rightKeyFieldNames) Sets the join keys to use when performing the join.final voidsetJoinKeys(List<JoinKey> joinKeys) Sets the join keys to use when performing the join.final voidsetUseHashJoinHint(boolean useHashJoinHint) Sets whether to perform the join as a hash join.Methods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
Constructor Details
-
AbstractRelationalJoin
protected AbstractRelationalJoin()
-
-
Method Details
-
getLeft
Returns the left input port.- Returns:
- the left input port.
-
getRight
Returns the right input port.- Returns:
- the right input port
-
getOutput
Returns the output port. This will output the joined data.- Returns:
- the output port.
-
getJoinCondition
If non-null, the condition is evaluated for every possible matching row. Only those rows for which the keys match and the condition returns true will be output as an inner join. When determining the set of rows to output for an outer join, we output the set for which the join condition never evaluated to true. Note that, if specified, the left fields and right fields must be distinct from each other. This is because the function will be evaluated in a namespace containing all fields from the left and right.- Returns:
- the join condition
-
setJoinCondition
Sets the join condition. If non-null, the condition is evaluated for every possible matching row. Only those rows for which the keys match and the condition returns true will be output as an inner join. When determining the set of rows to output for an outer join, we output the set for which the join condition never evaluated to true. Note that, if specified, the left fields and right fields must be distinct from each other. This is because the function will be evaluated in a namespace containing all fields from the left and right.- Parameters:
joinCondition- the join condition
-
setJoinCondition
Sets the join condition. If non-null, the condition is evaluated for every possible matching row. Only those rows for which the keys match and the condition returns true will be output as an inner join. When determining the set of rows to output for an outer join, we output the set for which the join condition never evaluated to true. Note that, if specified, the left fields and right fields must be distinct from each other. This is because the function will be evaluated in a namespace containing all fields from the left and right.- Parameters:
joinCondition- a predicate expression in SQL-like syntax parsed into the join condition
-
getUseHashJoinHint
public final boolean getUseHashJoinHint()Returns whether to perform the join as a hash join. If so, all rows on the right side will be loaded into into memory and joined with the left. This is an optimization for the case where the right side is small enough to fit into memory since it implies that the left side need not be sorted or repartitioned.- Returns:
- whether to perform the join as a hash join
-
setUseHashJoinHint
public final void setUseHashJoinHint(boolean useHashJoinHint) Sets whether to perform the join as a hash join. If so, all rows on the right side will be loaded into into memory and joined with the left. This is an optimization for the case where the right side is small enough to fit into memory since it implies that the left side need not be sorted or repartitioned.- Parameters:
useHashJoinHint- whether to perform the join as a hash join
-
getJoinKeys
Returns the join keys to use when performing the join.- Returns:
- the join keys to use when performing the join.
-
setJoinKeys
Sets the join keys to use when performing the join.- Parameters:
joinKeys- the join keys to use when performing the join.
-
setJoinKeys
Sets the join keys to use when performing the join.- Parameters:
keyFieldNames- the join keys to use when performing the join.
-
setJoinKeys
Sets the join keys to use when performing the join.- Parameters:
joinKeys- the join keys to use when performing the join.
-
setJoinKeys
Sets the join keys to use when performing the join.- Parameters:
leftKeyFieldNames- the left join keys to use when performing the join.rightKeyFieldNames- the right join keys to use when performing the join.
-
newJoinID
protected final int newJoinID() -
composeJoin
protected abstract RecordPort composeJoin(CompositionContext ctx, RecordPort left, RecordPort right, JoinKey[] keys) -
compose
Description copied from class:CompositeOperatorCompose the body of this operator. Implementations should do the following:- Perform any validation of configuration, input types, etc
- Instantiate and configure sub-operators, adding them to the provided context via
the method
OperatorComposable.add(O) - Create necessary connections via the method
OperatorComposable.connect(P, P). This includes connections from the composite's input ports to sub-operators, connections between sub-operators, and connections from sub-operators output ports to the composite's output ports
- Specified by:
composein classCompositeOperator- Parameters:
ctx- the context
-