2022-38: Iteration 22 report

Original link: https://xuanwo.io/reports/2022-38/

Iteration 22 starts on 9/12 and ends on 9/25 for two weeks. My main work in this cycle is to delete code:

After several iterations, Databend has completed the refactoring of New Executor, New Planner, and is currently working on New Expression. With the addition of new features such as official support for JOIN, Databend’s code base has also experienced serious corruption: outdated codes are scattered in every corner of the project, and many new function implementations still rely on deprecated ones. logic. I started by cleaning up the Old Planner to try to alleviate this problem: the initial plan was just to fight for three days to remove the dependency on sqlparser-rs , but in the end I found that Databend’s dependency on it was so deep that it became spanning several Large jobs with iteration cycles.

A long time ago, I added See you again : refactor: Dedicate See you again to the old planner in DfStatement . By introducing a Dummy Statement SeeYouAgain in the old DfStatement, most of the operations were directly forwarded to the New Planner. Now I started a new project: refactor: Old Planner Never See Again (Part 1) . This project aims to completely remove Old Planner and completely clean up outdated code. When I implemented Part 2, I found that things were not simple. Many complex issues were intertwined. In the past, complex dependencies that were not exposed in the same crate were exposed at once. In order to delete the old code smoothly, I was forced to do a lot of foreshadowing:

After doing all of the above, I’m only halfway done removing sqlparser-rs , and next I need:

  • Adjust the Table API so that it no longer depends on any Plan, so that the catalog crate does not need to depend on the planner (because the planner depends on the catalog)
  • When adjusting Fuse Table, build Expression based on Scalar instead of Binder
  • Adjust TableScan PhysicalPlan so that it no longer depends on ReadDataSourcePlan
  • Adjust ReadDataSourcePlan so that it no longer depends on Expression

I hope to complete these tasks in the next cycle, and officially say goodbye to Old Planner~

This article is reproduced from: https://xuanwo.io/reports/2022-38/
This site is for inclusion only, and the copyright belongs to the original author.