Skip to content

Better error messages about joins#11076

Merged
akuzm merged 3 commits intomasterfrom
aku/join-error-messages
May 26, 2020
Merged

Better error messages about joins#11076
akuzm merged 3 commits intomasterfrom
aku/join-error-messages

Conversation

@akuzm
Copy link
Copy Markdown
Contributor

@akuzm akuzm commented May 20, 2020

Imagine having a multi-statement query of a couple hundred lines, and then getting an error:

Code: 48, e.displayText() = DB::Exception: Multiple CROSS/COMMA JOIN do not support USING (version 20.5.1.1)

or

Code: 206, e.displayText() = DB::Exception: No alias for subquery or table function in JOIN (set joined_subquery_requires_alias=0 to disable restriction). (version 20.5.1.1)

That's it, no more info, good luck with re-reading your entire query line by line.
This PR adds the offending subselect or the list of tables joined with USING to the error message, making it easier to locate the error.

Changelog category (leave one):

  • Non-significant (changelog entry is not required)

@akuzm
Copy link
Copy Markdown
Contributor Author

akuzm commented May 20, 2020

This is more of a quick fix, and in the long run we need to have structured error messages (like error/context/hint in postgres), and scoped error hints.

@akuzm akuzm requested a review from 4ertus2 May 20, 2020 19:09
@blinkov blinkov added the pr-not-for-changelog This PR should not be mentioned in the changelog label May 20, 2020
@akuzm akuzm requested a review from a team as a code owner May 25, 2020 03:17
@akuzm akuzm force-pushed the aku/join-error-messages branch from 3a60637 to 09129a6 Compare May 25, 2020 03:20
@akuzm akuzm removed the request for review from a team May 25, 2020 03:23
@akuzm akuzm merged commit 4b1bb43 into master May 26, 2020
@akuzm akuzm deleted the aku/join-error-messages branch May 26, 2020 06:10
akuzm added a commit that referenced this pull request Jul 10, 2020
Better error messages about joins

(cherry picked from commit 4b1bb43)
akuzm added a commit that referenced this pull request Jul 14, 2020
* [wip] add fmtlib to 20.3

* Merge pull request #11446 from ClickHouse/aku/better-error-messages

Improve error messages

(cherry picked from commit 7db8edf)

* fixup

* Merge pull request #11076 from ClickHouse/aku/join-error-messages

Better error messages about joins

(cherry picked from commit 4b1bb43)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants