vogievetsky commented on a change in pull request #8919: fix bug with 
sqlOuterLimit, use sqlOuterLimit in web console
URL: https://github.com/apache/incubator-druid/pull/8919#discussion_r349126443
 
 

 ##########
 File path: web-console/src/views/query-view/query-view.tsx
 ##########
 @@ -320,14 +312,15 @@ export class QueryView extends 
React.PureComponent<QueryViewProps, QueryViewStat
       processQuery: async (queryWithContext: QueryWithContext) => {
         const { queryString, queryContext, wrapQueryLimit } = queryWithContext;
 
-        const actualQuery = QueryView.wrapInLimitIfNeeded(queryString, 
wrapQueryLimit);
-
         const explainPayload: Record<string, any> = {
-          query: QueryView.wrapInExplainIfNeeded(actualQuery),
+          query: QueryView.wrapInExplainIfNeeded(queryString),
           resultFormat: 'object',
         };
 
-        if (!isEmptyContext(queryContext)) explainPayload.context = 
queryContext;
+        if (!isEmptyContext(queryContext) || wrapQueryLimit) {
+          explainPayload.context = queryContext || {};
 
 Review comment:
   ```suggestion
             explainPayload.context = Object.assign({}, queryContext || {});
   ```
   
   Otherwise you are changing the queryContext state variable in place if it is 
set. Maybe not but still cleaner to avoid even the possibility of that.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to