abhishekagarwal87 commented on code in PR #13071:
URL: https://github.com/apache/druid/pull/13071#discussion_r992243426


##########
processing/src/main/java/org/apache/druid/query/Query.java:
##########
@@ -96,64 +97,60 @@
   DateTimeZone getTimezone();
 
   /**
-   * Use {@link #getQueryContext()} instead.
+   * Returns the context as an (immutable) map.
    */
-  @Deprecated
   Map<String, Object> getContext();
 
   /**
-   * Returns QueryContext for this query. This type distinguishes between user 
provided, system default, and system
-   * generated query context keys so that authorization may be employed 
directly against the user supplied context
-   * values.
-   *
-   * This method is marked @Nullable, but is only so for backwards 
compatibility with Druid versions older than 0.23.
-   * Callers should check if the result of this method is null, and if so, 
they are dealing with a legacy query
-   * implementation, and should fall back to using {@link #getContext()} and 
{@link #withOverriddenContext(Map)} to
-   * manipulate the query context.
-   *
-   * Note for query context serialization and deserialization.
-   * Currently, once a query is serialized, its queryContext can be different 
from the original queryContext
-   * after the query is deserialized back. If the queryContext has any {@link 
QueryContext#defaultParams} or
-   * {@link QueryContext#systemParams} in it, those will be found in {@link 
QueryContext#userParams}
-   * after it is deserialized. This is because {@link BaseQuery#getContext()} 
uses
-   * {@link QueryContext#getMergedParams()} for serialization, and queries 
accept a map for deserialization.
+   * Returns the query context as a {@link QueryContext}, which provides
+   * convenience methods for accessing typed context values. The returned
+   * instance is a view on top of the context provided by {@link 
#getContext()}.
    */
-  @Nullable
-  default QueryContext getQueryContext()

Review Comment:
   I think it's fine. I am just going to tag the PR "Backward incompatible" 



##########
processing/src/main/java/org/apache/druid/query/Query.java:
##########
@@ -96,64 +97,60 @@
   DateTimeZone getTimezone();
 
   /**
-   * Use {@link #getQueryContext()} instead.
+   * Returns the context as an (immutable) map.
    */
-  @Deprecated
   Map<String, Object> getContext();
 
   /**
-   * Returns QueryContext for this query. This type distinguishes between user 
provided, system default, and system
-   * generated query context keys so that authorization may be employed 
directly against the user supplied context
-   * values.
-   *
-   * This method is marked @Nullable, but is only so for backwards 
compatibility with Druid versions older than 0.23.
-   * Callers should check if the result of this method is null, and if so, 
they are dealing with a legacy query
-   * implementation, and should fall back to using {@link #getContext()} and 
{@link #withOverriddenContext(Map)} to
-   * manipulate the query context.
-   *
-   * Note for query context serialization and deserialization.
-   * Currently, once a query is serialized, its queryContext can be different 
from the original queryContext
-   * after the query is deserialized back. If the queryContext has any {@link 
QueryContext#defaultParams} or
-   * {@link QueryContext#systemParams} in it, those will be found in {@link 
QueryContext#userParams}
-   * after it is deserialized. This is because {@link BaseQuery#getContext()} 
uses
-   * {@link QueryContext#getMergedParams()} for serialization, and queries 
accept a map for deserialization.
+   * Returns the query context as a {@link QueryContext}, which provides
+   * convenience methods for accessing typed context values. The returned
+   * instance is a view on top of the context provided by {@link 
#getContext()}.
    */
-  @Nullable
-  default QueryContext getQueryContext()

Review Comment:
   Please add a note in your PR that can be used in release notes later. 



-- 
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