Skip to content

SQL: Cross join support #6006

@philrz

Description

@philrz

tl;dr

Cross joins are not yet possible in SuperSQL.

$ super -c "SELECT * FROM test t1, test t2;"
cross joins are not yet supported at line 1, column 15:
SELECT * FROM test t1, test t2;
              ~~~~~~~~~~~~~~~~

Details

Repro is with super commit 44adab7. The repro query shown above was taken from a sqllogictest.

Here's the same query with test data running successfully in Postgres.

$ psql postgres
psql (17.5 (Homebrew))
Type "help" for help.

postgres=# CREATE TABLE test (a INTEGER, b INTEGER);
CREATE TABLE

postgres=# INSERT INTO test VALUES (11, 1), (12, 2);
INSERT 0 2

postgres=# SELECT * FROM test t1, test t2;
 a  | b | a  | b 
----+---+----+---
 11 | 1 | 11 | 1
 11 | 1 | 12 | 2
 12 | 2 | 11 | 1
 12 | 2 | 12 | 2
(4 rows)

And here's the repro with test data in SuperDB.

$ super -version
Version: 44adab703

$ super -s test
{a:11::int32,b:1::int32}
{a:12::int32,b:2::int32}

$ super -c "SELECT * FROM test t1, test t2;"
cross joins are not yet supported at line 1, column 15:
SELECT * FROM test t1, test t2;
              ~~~~~~~~~~~~~~~~

I've come across many other sqllogictests that lean heavily on cross joins, so I'll add some of them to this issue as comments, since some of them rely on particular syntax. I can move those into separate issues if necessary.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions