I should you produce a test case that represents the specific concern you
have as opposed to proposing a snippet of code. I'm not sure what you
propose is necessary. I think their is implicit expected logic that a
revise should only influence an exception outcome, not a value outcome.
Only value outcomes are cached so I don't see where there would be a
problem.

If you're revising value outcomes based on revise call (not just exception
outcomes), I think you're probably breaking the expected contract. (I say
think here because I don't think docs make this clear and wasn't the person
that wrote the original code.)

On Sat, Jan 15, 2022, 3:23 AM guangyuan wang <[email protected]>
wrote:

> Dear community
>
> Why should invalidate all of the caches of HANDLERS when adding a new
> RelNode class in JaninoRelMetadataProvider.revise() method?
>
> The Codes are below:
>
> package org.apache.calcite.rel.metadata
>
> public class JaninoRelMetadataProvider implements RelMetadataProvider {
>
> synchronized <M extends Metadata, H extends MetadataHandler<M>> H revise(
>
>     Class<? extends RelNode> rClass, MetadataDef<M> def) {
>   if (ALL_RELS.add(rClass)) {
>     HANDLERS.invalidateAll();
>   }
>   //noinspection unchecked
>   return (H) create(def);
> }
>
> }
>

Reply via email to