-
Notifications
You must be signed in to change notification settings - Fork 315
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 #1454
Merged
waynexia
merged 15 commits into
GreptimeTeam:develop
from
v0y4g3r:refactor/remove-catalog
Apr 26, 2023
Merged
refactor: catalog #1454
waynexia
merged 15 commits into
GreptimeTeam:develop
from
v0y4g3r:refactor/remove-catalog
Apr 26, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…catalog # Conflicts: # src/datanode/src/instance/grpc.rs # src/query/src/sql.rs
v0y4g3r
force-pushed
the
refactor/remove-catalog
branch
from
April 25, 2023 08:36
bf63afd
to
dab786b
Compare
v0y4g3r
force-pushed
the
refactor/remove-catalog
branch
from
April 25, 2023 11:42
dab786b
to
e26434f
Compare
…catalog # Conflicts: # src/common/substrait/src/df_substrait.rs # src/datanode/src/sql/alter.rs # src/datanode/src/sql/create.rs # src/table-procedure/src/alter.rs # tests/cases/distributed/alter/rename_table.result
v0y4g3r
force-pushed
the
refactor/remove-catalog
branch
from
April 25, 2023 16:02
ee69c18
to
26abb32
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1454 +/- ##
===========================================
- Coverage 86.19% 85.49% -0.71%
===========================================
Files 547 546 -1
Lines 81948 81851 -97
===========================================
- Hits 70639 69978 -661
- Misses 11309 11873 +564 |
WenyXu
reviewed
Apr 25, 2023
v0y4g3r
force-pushed
the
refactor/remove-catalog
branch
from
April 26, 2023 03:47
0a0b01b
to
393f484
Compare
v0y4g3r
force-pushed
the
refactor/remove-catalog
branch
from
April 26, 2023 05:03
393f484
to
2d0f6ba
Compare
v0y4g3r
force-pushed
the
refactor/remove-catalog
branch
from
April 26, 2023 06:31
bbb15b0
to
c92bc01
Compare
MichaelScofield
approved these changes
Apr 26, 2023
WenyXu
approved these changes
Apr 26, 2023
waynexia
reviewed
Apr 26, 2023
paomian
pushed a commit
to paomian/greptimedb
that referenced
this pull request
Oct 19, 2023
* wip * add schema_async * remove CatalogList * remove catalog provider and schema provider * fix * fix: rename table * fix: sqlness * fix: ignore tonic error metadata * fix: table engine name * feat: rename catalog_async to catalog * respect engine name in table regional value when deregistering tables * fix: CR
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
An epic refactor that completely removes the vicious
CatalogList
and corresponding adaptors from GreptimeDB.CatalogList
is used for query engine to get table entity by the triplet: catalog name/schema name/table name. But as we've discussed, all these traits are sync, which means we cannot rely on any async operation to retrieve the table entities from remote catalog implementation, for example, metasrv in distributed mode.As an workaround, we've managed to bridge sync traits with async implementation, which works but brings too much overhead in that each catalog operation requires a new thread.
In this PR, instead fetching table entity from underlying storage during planning, we resolves tables from statements in advance and put these tables in a memory based catalog list.
To make "resolving tables in advance" possibile, we examines all the code paths where a catalog list is required.
greptimedb/src/query/src/planner.rs
Lines 53 to 62 in b5e5f8e
greptimedb/src/datanode/src/instance/grpc.rs
Line 63 in ee69c18
As result, this PR is able to remove the implementation of trait
datafusion::catalog::catalog::CatalogList
/datafusion::catalog::catalog::CatalogProvider
since we have our own async version alternatives.This PR also removes the catalog/schema adaptors.
Also, please note that, since multiple table engines is supported now, table regional values need also a
engine_name
field to locate a table inRemoteSchemaProvider
. This does not breaks compatibility since when this field is not present we use the defaultMITO_ENGINE
as table engine name when getting tables fromSchemaProvider
.greptimedb/src/catalog/src/remote/manager.rs
Lines 761 to 796 in ee69c18
This PR also supports renaming tables in catalog, however, tables routes are not renamed in metasrv, which will leads to
renamed_table does not exist
.Checklist
Refer to a related PR or issue link (optional)
closes #1335
#816
#723