Skip to main content

DB_Table.cross_join

cross_joinrightright_row_limitright_prefixon_problems

Group: Calculations
Aliases: append, cartesian join

Documentation

Joins tables by pairing every row of the left table with every row of the right table.

  • If the right table has more rows than the right_row_limit allows, a Cross_Join_Row_Limit_Exceeded is reported. In warning/ignore mode, the join is still executed.

Arguments

  • right: The table to join with.
  • right_row_limit: If the number of rows in the right table exceeds this, then a Cross_Join_Row_Limit_Exceeded problem is raised. The check exists to avoid exploding the size of the table by accident. This check can be disabled by setting this parameter to Nothing.
  • 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 For In-Memory Tables

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.

Result Ordering For Database Tables

The ordering of rows in the resulting table is not specified.