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
[query] refactor: Table::read_plan does not need DatabendQueryContext anymore. #2088
Conversation
… anymore. Why: `Table` is a low level concept in databend code base and should be a dependency of some other crate such as common/planner. This commit is one of the steps to remove the `Table` dependency on `query`. Trait `Table` references `DatabendQueryContext` as an argument type. In this commit it is replaced with another smaller type `TableIOContext` so that in future `Table` can be moved out of crate `query`. `TableIOContext` provides data-access support, exposes the runtime used by `query` itself and provides two resource value: max thread number and node list. - Add `TableIOContext` to provide everything a Table need to build a plan or else. - `Table::read_plan()` use `TableIOContext` as argument to replace `DatabendQueryContext`. - When calling `read_plan()`, a temporary `TableIOContext` is built out of DatabendQueryContext. - `DatabendQueryContext` provides two additional supporting methods: `get_single_node_table_io_context()` and `get_cluster_table_io_context()`. - fix: datafuselabs#2072
Thanks for the contribution! Please review the labels and make any necessary changes. |
Thanks for the contribution! Please review the labels and make any necessary changes. |
Looking good. |
/lgtm |
Approved! Thank you for the PR @drmingdrmer |
CI Passed |
CI Passed |
10 similar comments
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
6 similar comments
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
21 similar comments
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
CI Passed |
I hereby agree to the terms of the CLA available at: https://databend.rs/policies/cla/
Summary
[query] refactor: Table::read_plan does not need DatabendQueryContext anymore.
Why:
Table
is a low level concept in databend code base and should be adependency of some other crate such as common/planner.
This commit is one of the steps to remove the
Table
dependency onquery
.Trait
Table
referencesDatabendQueryContext
as an argument type.In this commit it is replaced with another smaller type
TableIOContext
so that in future
Table
can be moved out of cratequery
.TableIOContext
provides data-access support, exposes the runtime usedby
query
itself and provides two resource value: max thread number andnode list.
Add
TableIOContext
to provide everything a Table need to build aplan or else.
Table::read_plan()
useTableIOContext
as argument to replaceDatabendQueryContext
.When calling
read_plan()
, a temporaryTableIOContext
is built outof DatabendQueryContext.
DatabendQueryContext
provides two additional supporting methods:get_single_node_table_io_context()
andget_cluster_table_io_context()
.fix: Introduce struct
TableIOContext
, to provide io handlers to let a table buildReadDataSourcePlan
. This way thetrait Table
does not need to depend onDatabendQueryContext
. #2072Changelog
Related Issues
TableInfo
andReadDataSourcePlan
#2046