You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lint GV003: a NATURAL JOIN is reported as a cartesian product (error), so preflight and run block a normal query #150
NATURAL JOIN joins on the columns both tables share, so it has a join key. Gulliver reads it as a join without a condition and reports GV003 as an error. Because lint errors close the gate, preflight and run refuse the query:
gulliver lint "select a from t natural join u limit 5"# error GV003 cartesian-join: Join with u has no join condition: a cartesian product.# fix: Add ON <key> = <key> (or USING). If you really want every combination, write CROSS JOIN.
gulliver lint "select a from t natural left join u limit 5"# error GV003 cartesian-join: Join with u has no join condition: a cartesian product.
gulliver demo --events 20000
gulliver --dsn gulliver_demo.duckdb run "select count(*) from events e natural join users u"# **run** on `default` (duckdb) - **BLOCKED**# - Blocked: scale lint errors: GV003 cartesian-join# **Next step:** Do not run this. Fix: scale lint errors: GV003 cartesian-join.
events and users share user_id, so this is an ordinary key join; DuckDB, Postgres and Snowflake all run it as one. The message is also wrong advice: the query has a key, it is just not written with ON.
Checked on current main (2bdae73). Why: _join_condition(join) in src/gulliver/lint.py only looks at on and using; sqlglot stores a natural join as method: 'NATURAL' with neither, so the code falls into the "no condition" branch.
What should happen
A join whose method is NATURAL (also NATURAL LEFT/RIGHT/FULL JOIN) gets no GV003 finding, and preflight / run are no longer blocked by it
Everything else stays the same: select * from t, u is still the GV003 error, CROSS JOIN the warning, a comma join keyed in WHERE the info
Where to start
src/gulliver/lint.py: _join_condition(...) (line 93) and the GV003 block in lint(...) (around lines 247-278). join.args.get("method") is "NATURAL" for these joins; skipping them next to the Unnest / Lateral skip at the top of the loop is enough
_fan_trap(...) (line 404) also calls _join_condition; check that it still behaves for a natural join (it should simply not match)
Tests: tests/test_lint.py, next to test_unnest_join_is_not_cartesian (line 84) and the cross join assertion at line 81
How to test
gulliver lint "select a from t natural join u limit 5"# now: No scale problems found.
gulliver lint "select a from t, u limit 5"# still: error GV003
pytest tests/test_lint.py
Done when
NATURAL JOIN, NATURAL LEFT JOIN and NATURAL FULL JOIN produce no GV003 finding
A comma join without a key and a plain JOIN u without ON are still the GV003 error
Tests for both in tests/test_lint.py
A line under Unreleased in CHANGELOG.md
pytest and ruff check . pass
New here? CONTRIBUTING.md has the setup. Comment here to claim it and you'll be assigned.
Hi! I would like to claim this issue. I will update _join_condition and the join lint loop in src/gulliver/lint.py so joins with method: 'NATURAL' (including NATURAL LEFT/RIGHT/FULL JOIN) are recognised as keyed joins and not reported as GV003 cartesian errors, while keeping unkeyed comma joins and plain unconditioned joins flagged as errors. Tests and changelog entry will be included.
Thanks @dianatofficial for the claim and the PR #173. We keep a limit of 3 open issues per person, and you already hold #119 (PR #121), #112 (PR #115) and #152, which you claimed first today. So I can't assign #150 to you right now. As soon as one of those is merged you can claim another, and #150 stays free until then.
Update on #150: @AzalHoseinian opened PR #163 for this on Nov 14, before the later claims here, so #163 is the PR I am reviewing and merging for it (it is approved, waiting for the CI checks). GitHub would not let me assign the issue to you, @AzalHoseinian, because you have not commented here; the assignment follows as soon as you do, if you like.
@dianatofficial, thank you for your PR #173 and for working on the same bug. Since #163 was first, could you please close #173? You will not lose anything: #131 and #158 stay free for you as soon as one of your open PRs is merged.
Activity
dianatofficial commentedon Nov 15, 2026
Hi! I would like to claim this issue. I will update
_join_conditionand the join lint loop insrc/gulliver/lint.pyso joins withmethod: 'NATURAL'(includingNATURAL LEFT/RIGHT/FULL JOIN) are recognised as keyed joins and not reported as GV003 cartesian errors, while keeping unkeyed comma joins and plain unconditioned joins flagged as errors. Tests and changelog entry will be included.laaielichter commentedon Nov 15, 2026
Thanks @dianatofficial for the claim and the PR #173. We keep a limit of 3 open issues per person, and you already hold #119 (PR #121), #112 (PR #115) and #152, which you claimed first today. So I can't assign #150 to you right now. As soon as one of those is merged you can claim another, and #150 stays free until then.
Generated by Claude Code
laaielichter commentedon Nov 15, 2026
Update on #150: @AzalHoseinian opened PR #163 for this on Nov 14, before the later claims here, so #163 is the PR I am reviewing and merging for it (it is approved, waiting for the CI checks). GitHub would not let me assign the issue to you, @AzalHoseinian, because you have not commented here; the assignment follows as soon as you do, if you like.
@dianatofficial, thank you for your PR #173 and for working on the same bug. Since #163 was first, could you please close #173? You will not lose anything: #131 and #158 stay free for you as soon as one of your open PRs is merged.
Generated by Claude Code
fix(lint): do not flag NATURAL JOIN as a cartesian product (GV003)