-
Notifications
You must be signed in to change notification settings - Fork 125
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: enable cache for external tables using a cache control on metrics views #6265
base: main
Are you sure you want to change the base?
Conversation
runtime/resolvers/metrics.go
Outdated
return nil, false, nil | ||
} | ||
|
||
hasher := md5.New() |
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 is already being hashed in runtime/resolver.go
so could we return the full pointer here?
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.
The values were already being hashed in the older implementation :
rill/runtime/resolvers/metrics.go
Line 94 in 9061a24
func (r *metricsResolver) Key() string { |
Since the key is now composed of two things (cache_key
and query
) I thought of just using a md5 hasher.
Do you mean we create a new struct and just return any from CacheKey
instead of bytes ?
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 just meant if one way or another it could use the same hasher – e.g. it might return a combined []byte
or a *drivers.Result
, or accept a io.Writer
, or something like that.
It's not an important comment, certainly you shouldn't do anything weird to achieve this (like returning a struct would probably be weird). Just wondered if there was a clean way to have just one hasher.
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.
Okay. Added another way to compute key without hasher.
Co-authored-by: Benjamin Egelund-Müller <[email protected]>
Co-authored-by: Benjamin Egelund-Müller <[email protected]>
No description provided.