join

Join two build artifacts into a new build artifact.

Loads both builds, joins them with the given predicate and join method, and writes the result as a new build artifact. Execute it later with xorq run, or add it to a catalog with xorq catalog add.

Usage

xorq join LEFT_PATH RIGHT_PATH [OPTIONS]

Arguments

  • LEFT_PATH—Path to the left build directory.
  • RIGHT_PATH—Path to the right build directory.

Options

Option Default Description
--on none Comma-separated column(s) present in both tables to join on.
--left-on none Comma-separated left-table columns (paired with –right-on).
--right-on none Comma-separated right-table columns (paired with –left-on).
--how inner Join method.
--lname `| Rename format string for overlapping left columns. | |–rname|{name}_right| Rename format string for overlapping right columns. | |–builds-dir|builds| Directory for the generated build artifact. | |–cache-dir|$XORQ_CACHE_DIRor~/.cache/xorq| Directory for parquet cache files. | |–relocate-reads/–no-relocate-reads|–relocate-reads| Bundle local-file Read nodes into the build so it is self-contained and runnable from anywhere. Remote reads (s3://, gs://, ...) are already location-independent and left in place. Pass --no-relocate-reads for a lean, machine-local build; this only affects reads not already bundled -- relocation discards a read's original path, so it cannot be undone by a later --no-relocate-reads on an already-relocated input. | |–ignore-library-version-mismatch| off | Proceed even if the builds recorded different xorq library versions. | |–rebind-backends/–no-rebind-backends|–rebind-backends| In multi-root mode, rebind same-profile backend sources to one backend before execution. Never transfers table data. | |–emit-build-path-to` none

Examples

# Inner-join two builds on a shared column
xorq join builds/left builds/right --on id
# Left join on differently-named columns
xorq join builds/left builds/right --left-on user_id --right-on id --how left