-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat(cache): cache metadata location in signer #334
Conversation
dc7413a
to
5700923
Compare
c60b3c0
to
ff05602
Compare
ff05602
to
161a98e
Compare
35d0521
to
96ff1c4
Compare
96ff1c4
to
2d67ea4
Compare
@@ -2,6 +2,7 @@ | |||
use anyhow::anyhow; | |||
use std::collections::HashSet; | |||
use std::convert::Infallible; | |||
use std::num::NonZeroUsize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fancy!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's somewhat of a pain to work with.. there's no const constructor which would be infallible that I found
.r#type("CreateTableLocationRequired".to_string()) | ||
.build() | ||
})? | ||
.trim_end_matches('/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be part of the Postgres impl, but fixed in catalog.rs so that its fixed for all backends.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also adding it to determine_tabular_location, it's also here since most tests do not create tables via the catalog but instead directly on postgres impl level
@@ -334,79 +337,84 @@ pub(crate) async fn get_table_metadata_by_id( | |||
}) | |||
} | |||
|
|||
pub(crate) async fn get_table_metadata_by_s3_location( | |||
pub(crate) async fn get_table_id_by_s3_location( | |||
warehouse_id: WarehouseIdent, | |||
location: &str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we change the type to configs::Location (basically URL?).
I think just by splitting location at :// it is not guaranteed to be a valid URL. Location type is a bit more typesafe and allows easier access to protocol and (sub)-paths by path_segemnts
.
We might need to expose more attributes of Location.
Maybe having sublocation part of configs.Location makes sense? Then we could share it across impls again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to use location instead
Adds a cache for get_table_metadata by location, we're only caching the table_id since that's not going to change.
partially addresses #6