Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Columns named "desc" cause troulbe in our parser #4781

Open
sebastian opened this issue Oct 23, 2020 · 5 comments
Open

Columns named "desc" cause troulbe in our parser #4781

sebastian opened this issue Oct 23, 2020 · 5 comments
Labels
bug not blocking release Priority to work on, but is not a necessiry in order to make a release

Comments

@sebastian
Copy link
Member

Take the following query against the LendingClub data source on demo:

SELECT desc FROM loans

It's rejected with the error:

Expected column definition.

The following version does work:

SELECT "desc" FROM loans

It seems in the first version we parse it as the token descending. The same happens with asc (not that such a column exists...) and all other words which are also part of the general sql syntax...

@sebastian sebastian added the bug label Oct 23, 2020
@sebastian sebastian added this to the Release 20.3 milestone Oct 23, 2020
@cristianberneanu
Copy link
Member

I don't think there is anything we should do here. All keywords have this problem.
Postgres behaves similarly:

cloak=> select desc from (select 1 as desc) t;
ERROR:  syntax error at or near "desc"
LINE 1: select desc from (select 1 as desc) t;

@gampleman
Copy link
Contributor

Seems like an improvement would be a better error message.

Expected column definition.

doesn't really tell you what is wrong or how to fix it.

@gampleman gampleman self-assigned this Oct 27, 2020
@gampleman
Copy link
Contributor

Screenshot 2020-10-28 at 12 13 17

Would something like this do the trick?

@sebastian
Copy link
Member Author

I think that would be useful!

@sebastian sebastian added the not blocking release Priority to work on, but is not a necessiry in order to make a release label Oct 29, 2020
@sebastian
Copy link
Member Author

Since the fix isn't straightforward (a good fix would require parser changes) I'm moving this out of the current milestone.

@sebastian sebastian modified the milestones: Release 20.3, Release 20.4 Oct 29, 2020
@gampleman gampleman removed their assignment Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug not blocking release Priority to work on, but is not a necessiry in order to make a release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants