Join
Block Group: | Table Operations |
Icon: |
The Join block returns a new table that joins the rows of two input tables.
Note
Make sure to rename columns using the renameColumns property, if you don’t want the columns to be combined.
For information on using dataflow blocks, see Dataflow.
For answers to some common questions about working with tables, see Tables.
Input/Output Properties
The following properties of the Join block can take input and give output.
- input1 (table)
- input2 (table)
- column1 (string)
- column2 (string)
- join (enum)
- renameColumns (string)
input1 specifies the left table for the join operation.
input2 specifies the right table for the join operation.
column1 specifies the name of the key column from the input1 table.
column2 specifies the name of the key column from the input2 table.
join determines the method of joining. The value of the join property can be one of the following:
- Left: All rows from input1 are included. Rows from input2 are included and merged when the column2 value matches a column1 value.
- Right: All rows from input2 are included. Rows from input1 are included and merged when the column1 value matches a column2 value.
- Inner: Rows are included and merged only when the values in column1 and column2 are the same.
- Full: All rows from both tables are included, and the rows are merged if the values of column1 and column2 are the same.
- Union: All rows from both tables are included in a new table. Rows are not merged.
renameColumns determines the names in the output table for columns that come from input2. Use this syntax:
column1:newName column2:newName
To edit text in a popup window, click the Edit in Window icon. To create line breaks between columns, press Alt + Enter in the block properties panel, or press Enter in the popup window.
Output Property
The following property of the Join block can give output but cannot take input.
- output (table)
output returns the joined table.
Order of Priority for Duplicate Column Names
If column names are the same and are not renamed using the renameColumns property, the type of join determines the order of priority, as follows:
- In a left, inner, or full join, the value in the input1 table overrides the value in the input2 table.
- In a right join, the value in the input2 table overrides the value in the input1 table.
- In a union join, all values are included.
Example
The following image shows an example of the Join block. In this example, a left join operation is performed.