Intersection of two tables
This topic describes how to use the Intersection of Two Tables operator.
Purpose
The Intersection of Two Tables operator finds the intersection of two data tables based on the specified intersection conditions.
Scenarios
Compute pipeline | Compute engine | Supported |
Offline | MaxCompute | Yes |
Hive | Yes | |
HiveStorage | Yes | |
RDS/MySQL | Yes | |
Spark | Yes |
Instructions
Source nodes
The Intersection of Two Tables operator requires two source nodes, also known as input nodes, to find the intersection. Each source node is treated as a table.
Intersection conditions
You can specify one or more fields from each source node for the intersection condition and set the mapping between them. The data from the raw data of the two source nodes that satisfies this mapping forms the intersection, as shown in the following diagram.

For example, assume that the two input nodes are A and B, and the intersection condition is set to A.ID=B.USER_ID. The result of the intersection is shown on the right in the following figure.

Output fields
You can configure the list of fields that the current node outputs to descendant nodes. By default, this list includes all fields from both source nodes. You can remove fields as needed.
If two source nodes have the same field code, and both are selected as output fields, the system automatically renames the second field code.