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

refactor(catalog): remove delete #8662

Merged
merged 1 commit into from
Nov 6, 2022

Conversation

BohuTANG
Copy link
Member

@BohuTANG BohuTANG commented Nov 6, 2022

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Remove the DeletePlan from catalog, and decouple the catalog from the plan:

    async fn delete(
        &self,
        ctx: Arc<dyn TableContext>,
        projection: &Projection,
        selection: &Option<String>,
    ) -> Result<()> {

Closes #issue

@vercel
Copy link

vercel bot commented Nov 6, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) Nov 6, 2022 at 2:36PM (UTC)

@BohuTANG BohuTANG requested a review from Xuanwo November 6, 2022 14:36
@mergify mergify bot added the pr-refactor this PR changes the code base without new features or bugfix label Nov 6, 2022
@BohuTANG
Copy link
Member Author

BohuTANG commented Nov 6, 2022

/// # TODO
///
/// From @xuanwo
///
/// Ideally, we need to use `Scalar` in DeletePlan.selection. But we met a
/// cycle deps here. So we have to change `selection` in String first, and
/// change into `Scalar` when our `Planner` has been moved out.
///
/// At this stage, DeletePlan's selection expr will be parsed twice:
///
/// - Parsed during `bind` to get column index and projection index.
/// - Parsed during `execution` to get the correct columns
///
/// It's an ugly but necessary price to pay. Without this, we would sink in
/// hell forever.

I think this TODO can TO-DO after this PR is merged, cc @Xuanwo

@BohuTANG BohuTANG merged commit 83be7f4 into databendlabs:main Nov 6, 2022
@BohuTANG
Copy link
Member Author

BohuTANG commented Nov 7, 2022

@Xuanwo ,
I finally know the situation on the DeletePlan.selection, it's one step from the old-expression to the new-expression, now it's hard to do it, so lets the query&planner team do it :)

cc @leiysky @sundy-li

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-refactor this PR changes the code base without new features or bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant