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

Use empty parsing context to build view's select in CREATE VIEW statement (#2049) #2595

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

jepett0
Copy link
Collaborator

@jepett0 jepett0 commented Mar 11, 2024

Based on: #2049

KIKIMR-20891

CREATE VIEW statement parses (and validates) the select statement saved in the view. It should be parsed in a context isolated from the statements executed before the CREATE VIEW statement (we haven't decided yet on the exact scope of the context of the view's select statement, see KIKIMR-20656). It is pretty obvious that one should be able to execute the following statement in one go ("one go" = one press of a "run" button in YDB UI):

-- create view NecessaryInnerView with (security_invoker = true) as select 1;
-- create view ContextTestingView with (security_invoker = true) as select * from `/local/NecessaryInnerView`; -- where `/local/...` is your cluster name

drop view ContextTestingView;
create view ContextTestingView with (security_invoker = true) as select * from `/local/NecessaryInnerView`;

However, executing both drop view and create view in one go currently produces and error:

DropObject is not yet implemented for intent determination transformer

which indicates that the context of the inner query:

select * from `/local/NecessaryInnerView`

is polluted by the previous:

drop view ContextTestingView;

statement.

This problem is fixed by using an empty parsing context for parsing view's inner select statement during handling of CREATE VIEW statement.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

Copy link

github-actions bot commented Mar 12, 2024

2024-03-12 17:50:13 UTC Pre-commit check for f4e2945 has started.
2024-03-12 17:50:15 UTC Build linux-x86_64-release-asan is running...
🟢 2024-03-12 17:51:23 UTC Build successful.
2024-03-12 17:51:32 UTC Tests are running...
🔴 2024-03-12 17:54:46 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16055 15946 0 18 58 33

Copy link

github-actions bot commented Mar 12, 2024

2024-03-12 17:51:55 UTC Pre-commit check for f4e2945 has started.
2024-03-12 17:51:57 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-03-12 17:53:39 UTC Build successful.
2024-03-12 17:53:55 UTC Tests are running...
🟢 2024-03-12 19:07:44 UTC Tests successful.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
60274 50876 0 0 9340 58

@jepett0 jepett0 marked this pull request as ready for review March 13, 2024 07:23
@jepett0 jepett0 requested a review from a team as a code owner March 13, 2024 07:23
@jepett0 jepett0 requested a review from ijon March 13, 2024 07:42
@jepett0 jepett0 merged commit c205eed into ydb-platform:stable-24-1 Mar 13, 2024
3 of 4 checks passed
@mregrock mregrock mentioned this pull request May 15, 2024
This was referenced Jun 7, 2024
@CyberROFL CyberROFL mentioned this pull request Jun 19, 2024
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.

2 participants