Skip to content

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

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

Closed
wants to merge 2 commits into from

Conversation

jepett0
Copy link
Collaborator

@jepett0 jepett0 commented Mar 6, 2024

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.

@jepett0 jepett0 reopened this Mar 6, 2024
@jepett0 jepett0 requested review from ijon and vitstn March 6, 2024 14:28
Copy link

github-actions bot commented Mar 6, 2024

2024-03-07 06:52:34 UTC Pre-commit check for 7905596 has started.
2024-03-07 06:52:36 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-03-07 06:53:54 UTC Build successful.
2024-03-07 06:54:07 UTC Tests are running...
🔴 2024-03-07 08:03:22 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
60373 50965 0 1 9348 59

Copy link

github-actions bot commented Mar 6, 2024

2024-03-07 06:51:54 UTC Pre-commit check for 7905596 has started.
2024-03-07 06:51:56 UTC Build linux-x86_64-release-asan is running...
🟢 2024-03-07 06:53:05 UTC Build successful.
2024-03-07 06:53:18 UTC Tests are running...
🔴 2024-03-07 06:56:26 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16051 15947 0 13 62 29

Copy link

github-actions bot commented Mar 7, 2024

2024-03-07 13:26:14 UTC Pre-commit check for 87c0970 has started.
2024-03-07 13:26:15 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-03-07 13:27:23 UTC Build successful.
2024-03-07 13:27:35 UTC Tests are running...

Copy link

github-actions bot commented Mar 7, 2024

2024-03-07 13:36:46 UTC Pre-commit check for 87c0970 has started.
2024-03-07 13:36:49 UTC Build linux-x86_64-release-asan is running...
🟢 2024-03-07 13:38:34 UTC Build successful.
2024-03-07 13:38:49 UTC Tests are running...
🔴 2024-03-07 15:15:08 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
16050 15946 0 26 52 26

@jepett0 jepett0 closed this Mar 11, 2024
@jepett0
Copy link
Collaborator Author

jepett0 commented Mar 11, 2024

Couldn't get proper links to the test results of the linux-x86_64-relwithdebinfo build in testmo, so I decided to drop this pull request and open a new one.

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.

1 participant