andreacyc commented on a change in pull request #11738:
URL: https://github.com/apache/druid/pull/11738#discussion_r715668846



##########
File path: web-console/src/views/query-view/query-view.tsx
##########
@@ -205,14 +209,23 @@ export class QueryView extends 
React.PureComponent<QueryViewProps, QueryViewStat
 
         const query = QueryView.isJsonLike(queryString) ? 
Hjson.parse(queryString) : queryString;
 
+        const queryId = generateQueryId();
+
+        const isSql = !QueryView.isJsonLike(queryString);
+
         let context: Record<string, any> | undefined;
         if (!isEmptyContext(queryContext) || wrapQueryLimit || 
mandatoryQueryContext) {
           context = { ...queryContext, ...(mandatoryQueryContext || {}) };
+          context.sqlQueryId = queryId;
           if (typeof wrapQueryLimit !== 'undefined') {
             context.sqlOuterLimit = wrapQueryLimit + 1;
           }
         }
 
+        void cancelToken.promise.then(() => {
+          void Api.instance.delete(`/druid/v2/${isSql ? '/sql' : 
''}/${queryId}`);

Review comment:
       yes, you are right, void would not be enough to handle the promise 
reject. i added catch and throw new DruidError(e). But i did not handle the 
cancel api response yet.




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