Skip to content

Implemented OUTER JOIN support #4911

@clockwork-labs-bot

Description

@clockwork-labs-bot

This issue tracks reimplementing the work from stale PR #2892, which has been closed because it is too far out of date to merge directly.

## Original pull request
- PR #2892: [Implemented `OUTER JOIN` support](https://github.com/clockworklabs/SpacetimeDB/pull/2892)
- Original author: @egormanga

## What the original PR was trying to do
# Description of Changes

Previously, only INNER and CROSS joins were possible.
This adds support for LEFT OUTER joins with certain limitations (basically, same as for INNER).

Doesn't play so well with RLS currently, though (I assume it's something to do with query optimization for similar joins, or that RLS discards already right-matched rows without substituting them with null-matched instead).

API and ABI breaking changes

Non-present column values come in as () units (for null) instead of the expected type, so it's like everything suddenly became Optional. This might require some additional handling on the clients.

Probably won't work with the PG wire protocol for the same reason, although the fix for that will be server-side, as the protocol itself is fine with nulls.

Expected complexity level and risk

3.

Testing

  • Manual testing

  • Needs unit tests

    Closure context

    • Closed from the close-stale-pr-create-issue stale-PR sweep.

    Reimplementation notes

    • Reimplement this work on top of current master in a new PR.
    • Keep the original PR linked as historical context and as a source of useful implementation ideas where still relevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions