clintropolis opened a new pull request, #12564:
URL: https://github.com/apache/druid/pull/12564

   Adds a default implementation of `getQueryContext`, which was added to the 
`Query` interface in #12396. `Query` is marked with `@ExtensionPoint`, and 
lately we have been trying to be less volatile on these interfaces by providing 
default implementations to be more chill for extension writers. 
   
   The way this default implementation is done in this PR is a bit strange due 
to the way that `getQueryContext` is used (mutated with system default and 
system generated keys); the default implementation has a specific object that 
it returns, and I added another temporary default method `isLegacyContext` that 
checks if the `getQueryContext` returns that object or not. If not, callers 
fall back to using `getContext` and `withOverriddenContext` to set these 
default and system values.
   
    I am open to other ideas as well, but this way should work at least without 
exploding, and added some tests to ensure that it is wired up correctly for 
`QueryLifecycle`, including the context authorization stuff.
   
   The added test shows the strange behavior if query context authorization is 
enabled, mainly that the system default and system generated query context keys 
also need to be granted as permissions for things to function correctly. This 
is not great, so I mentioned it in the javadocs as well. Not sure if it needs 
to be called out anywhere else.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to