Skip to main content

DB_Table.zip

ziprightkeep_unmatchedright_prefixon_problems

Group: Calculations
Aliases: join by row position

Documentation

Joins two tables by zipping rows from both tables table together - the first row of the left table is correlated with the first one of the right one etc.

  • If the tables have different number of rows and keep_unmatched is set to Report_Unmatched, the join will report Row_Count_Mismatch.

Arguments

  • right: The table to join with.
  • keep_unmatched: If set to True, the result will include as many rows as the larger of the two tables - the last rows of the larger table will have nulls for columns of the smaller one. If set to False, the result will have as many rows as the smaller of the two tables - the additional rows of the larger table will be discarded. The default value is Report_Unmatched which means that the user expects that two tables should have the same amount of rows; if they do not, the behaviour is the same as if it was set to True - i.e. the unmatched rows are kept with Nothing values for the other table, but a Row_Count_Mismatch problem is also reported.
  • right_prefix: The prefix added to right table column names in case of name conflict. See "Column Renaming" below for more information.
  • on_problems: Specifies how to handle problems if they occur, reporting them as warnings by default.

Remarks

Column Renaming

If columns from the two tables have colliding names, a prefix (by default Right_) is added to the name of the column from the right table. The left column remains unchanged. It is possible that the new name will be in use, in this case it will be resolved using the normal renaming strategy - adding subsequent _1, _2 etc.

Row Ordering

This operation requires a well-defined order of rows in the input tables. In-memory tables rely on the ordering stemming directly from their layout in memory. Database tables may not impose a deterministic ordering. If the table defines a primary key, it is used to by default to ensure deterministic ordering. That can be overridden by specifying a different ordering using Table.sort. If no primary key was defined nor any ordering was specified explicitly by the user, the order of columns is undefined and the operation will fail, reporting a Undefined_Column_Order problem and returning an empty table.