Skip to content

Add truncate statement support #10

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

Open
wants to merge 1 commit into
base: release-42.0.0
Choose a base branch
from

Conversation

oleggator
Copy link

@oleggator oleggator commented Jul 3, 2025

This PR adds TRUNCATE operation to LogicalPLan enum.

@oleggator oleggator force-pushed the release-42.0.0-truncate branch 3 times, most recently from 7ea6796 to ca47b51 Compare July 7, 2025 12:45
@oleggator oleggator force-pushed the release-42.0.0-truncate branch from ca47b51 to 177048f Compare July 7, 2025 12:52
@github-actions github-actions bot added the proto label Jul 7, 2025
@oleggator oleggator force-pushed the release-42.0.0-truncate branch from 177048f to 4fb5e19 Compare July 7, 2025 13:38
@oleggator oleggator force-pushed the release-42.0.0-truncate branch from 4fb5e19 to a31a6e1 Compare July 7, 2025 13:58
@0x501D 0x501D requested a review from askalt July 9, 2025 12:56
@@ -1228,6 +1228,10 @@ impl DefaultPhysicalPlanner {
"Unsupported logical plan: Analyze must be root of the plan"
)
}
LogicalPlan::Truncate(_) => {
Copy link

@askalt askalt Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it required to extend LogicalPlan enum? Isn't LogicalPlan::Extension not enough for our purposes?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't considered this option. It might suit this case better. That way, we can move all the additional logic inside TCS.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, here an example of such approach:

https://gitlab.corp.mail.ru/tarantool/tcs/tcs/-/blob/tcs/1.x/aggregator/aggregator/src/db/plan/unit.rs?ref_type=heads#L83-118

Own extensions for prepare, execute, and deallocate (prepared statements stuff).

And physical planning for extensions in the custom planner:

https://gitlab.corp.mail.ru/tarantool/tcs/tcs/-/blob/tcs/1.x/aggregator/aggregator/src/db/plan/query_planner.rs?ref_type=heads#L140

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

Successfully merging this pull request may close these issues.

2 participants