public abstract class CommonExecLookupJoin extends ExecNodeBase<org.apache.flink.table.data.RowData> implements SingleTransformationTranslator<org.apache.flink.table.data.RowData>
ExecNode for temporal table join which shares most methods.
For a lookup join query:
SELECT T.id, T.content, D.age FROM T JOIN userTable FOR SYSTEM_TIME AS OF T.proctime AS D ON T.content = concat(D.name, '!') AND D.age = 11 AND T.id = D.id WHERE D.name LIKE 'Jack%'
The LookupJoin physical node encapsulates the following RelNode tree:
Join (l.name = r.name)
/ \
RelNode Calc (concat(name, "!") as name, name LIKE 'Jack%')
|
DimTable (lookup-keys: age=11, id=l.id)
(age, id, name)
The workflow of lookup join:
1) lookup records dimension table using the lookup-keys
2) project & filter on the lookup-ed records
3) join left input record and lookup-ed records
4) only outputs the rows which match to the condition
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
FIELD_NAME_FILTER_ON_TEMPORAL_TABLE |
static String |
FIELD_NAME_JOIN_CONDITION |
static String |
FIELD_NAME_JOIN_TYPE |
static String |
FIELD_NAME_LOOKUP_KEYS |
static String |
FIELD_NAME_PROJECTION_ON_TEMPORAL_TABLE |
static String |
FIELD_NAME_TEMPORAL_TABLE |
static String |
LOOKUP_JOIN_TRANSFORMATION |
FIELD_NAME_CONFIGURATION, FIELD_NAME_DESCRIPTION, FIELD_NAME_ID, FIELD_NAME_INPUT_PROPERTIES, FIELD_NAME_OUTPUT_TYPE, FIELD_NAME_TYPE| 限定符 | 构造器和说明 |
|---|---|
protected |
CommonExecLookupJoin(int id,
ExecNodeContext context,
org.apache.flink.configuration.ReadableConfig persistedConfig,
org.apache.flink.table.runtime.operators.join.FlinkJoinType joinType,
org.apache.calcite.rex.RexNode joinCondition,
TemporalTableSourceSpec temporalTableSourceSpec,
Map<Integer,LookupJoinUtil.LookupKey> lookupKeys,
List<org.apache.calcite.rex.RexNode> projectionOnTemporalTable,
org.apache.calcite.rex.RexNode filterOnTemporalTable,
List<InputProperty> inputProperties,
org.apache.flink.table.types.logical.RowType outputType,
String description) |
| 限定符和类型 | 方法和说明 |
|---|---|
TemporalTableSourceSpec |
getTemporalTableSourceSpec() |
org.apache.flink.api.dag.Transformation<org.apache.flink.table.data.RowData> |
translateToPlanInternal(org.apache.flink.table.planner.delegation.PlannerBase planner,
ExecNodeConfig config)
Internal method, translates this node into a Flink operator.
|
protected void |
validateLookupKeyType(Map<Integer,LookupJoinUtil.LookupKey> lookupKeys,
org.apache.flink.table.types.logical.RowType inputRowType,
org.apache.flink.table.types.logical.RowType tableSourceRowType) |
accept, createFormattedTransformationDescription, createFormattedTransformationName, createTransformationDescription, createTransformationMeta, createTransformationMeta, createTransformationName, createTransformationUid, getContextFromAnnotation, getDescription, getId, getInputEdges, getInputProperties, getOutputType, getPersistedConfig, getSimplifiedName, inputsContainSingleton, replaceInputEdge, setInputEdges, translateToPlanclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittranslateToPlanpublic static final String FIELD_NAME_PROJECTION_ON_TEMPORAL_TABLE
protected CommonExecLookupJoin(int id,
ExecNodeContext context,
org.apache.flink.configuration.ReadableConfig persistedConfig,
org.apache.flink.table.runtime.operators.join.FlinkJoinType joinType,
@Nullable
org.apache.calcite.rex.RexNode joinCondition,
TemporalTableSourceSpec temporalTableSourceSpec,
Map<Integer,LookupJoinUtil.LookupKey> lookupKeys,
@Nullable
List<org.apache.calcite.rex.RexNode> projectionOnTemporalTable,
@Nullable
org.apache.calcite.rex.RexNode filterOnTemporalTable,
List<InputProperty> inputProperties,
org.apache.flink.table.types.logical.RowType outputType,
String description)
public TemporalTableSourceSpec getTemporalTableSourceSpec()
public org.apache.flink.api.dag.Transformation<org.apache.flink.table.data.RowData> translateToPlanInternal(org.apache.flink.table.planner.delegation.PlannerBase planner,
ExecNodeConfig config)
ExecNodeBasetranslateToPlanInternal 在类中 ExecNodeBase<org.apache.flink.table.data.RowData>planner - The planner.config - per-ExecNode configuration that contains the merged configuration from
various layers which all the nodes implementing this method should use, instead of
retrieving configuration from the planner. For more details check ExecNodeConfig.protected void validateLookupKeyType(Map<Integer,LookupJoinUtil.LookupKey> lookupKeys, org.apache.flink.table.types.logical.RowType inputRowType, org.apache.flink.table.types.logical.RowType tableSourceRowType)
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.