Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cqlsh.py: Send DESCRIBE statement to server before parsing #101

Merged
merged 4 commits into from
Sep 2, 2024

Conversation

dawmd
Copy link
Contributor

@dawmd dawmd commented Aug 29, 2024

Attempting to parse a DESCRIBE statement before performing
it forces us to update cqlsh whenever a new element of
the schema that could be described is introduced. We should
try to rely on the server and only in the case of a failure
(when the version of the server is old and it doesn't
recognize the query) should we try to parse it and perform
locally.

Trying to parse it first may lead to rejecting DESCRIBE
statements that would otherwise be valid -- if the grammar
used by cqlsh hasn't caught up with Scylla yet.

Fixes #100

@dawmd dawmd requested review from fruch and piodul August 29, 2024 12:35
@fruch fruch requested a review from sylwiaszunejko August 29, 2024 12:41
dawmd added 3 commits August 29, 2024 15:59
Attempting to parse a DESCRIBE statement before performing
it forces us to update cqlsh whenever a new element of
the schema that could be described is introduced. We should
try to rely on the server and only in the case of a failure
(when the version of the server is old and it doesn't
recognize the query) should we try to parse it and perform
locally.

Trying to parse it first may lead to rejecting DESCRIBE
statements that would otherwise be valid -- if the grammar
used by cqlsh hasn't caught up with Scylla yet.
The latter method is not declared, so use the former.
We add two small tests to verify that splitting
DESCRIBE statements work correctly. We do it
by hand now and we need to make sure nothing
has broken.
@dawmd
Copy link
Contributor Author

dawmd commented Aug 29, 2024

Version 2:

  • Fixed splitting the statement.
  • Changed the assert in one place to the right identifier.
  • Added a short test.

@fruch fruch merged commit d6a4725 into scylladb:master Sep 2, 2024
8 checks passed
@fruch
Copy link
Collaborator

fruch commented Sep 2, 2024

@dawmd

Now we need A PR to pull this into Scylla core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DESCRIBE statements are rejected when not reflected in cqlsh's grammar
3 participants