graceguo-supercat opened a new pull request #12404:
URL: https://github.com/apache/superset/pull/12404


   ### SUMMARY
   In Explore view, right now we have chart section and data table. Chart and 
results table are from different API response, but they actually have same 
query and same data frame.
   In airbnb Presto queries are limited. If query engine detects same user 
running the same query in the multiple requests, query engine will drop the 
duplicated query. This will impact the explore view user: when chart is 
loading, if user open data table, it will send another request to query engine, 
but this request is actually the same query. As the result, one of query will 
be dropped and error returned.
   
   This PR will try to fix this issue by delay the results table request:
   - When chart is still loading, if user clicks on data, Explore will show a 
spinner, but won't trigger new request
   - When chart is done loading and results panel is open, Explore will trigger 
2nd request (with `results=true` parameter). At this moment, query's results 
data is cached, so the 2nd request won't reach query engine, and return cached 
results data to frontend. it should only take ~1 second.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before: when user open results table while chart loading, Explore view sends 
2 queries at the same time:
   
![7Jek16ZC1K](https://user-images.githubusercontent.com/27990562/104144720-447b1f80-5379-11eb-845a-30ad6621b762.gif)
   
   After: when user open results table while chart loading, Explore view will 
show spinner but not sending another request:
   
![h0qL7PXaXm](https://user-images.githubusercontent.com/27990562/104144758-6d9bb000-5379-11eb-9f7b-bb30bd74f5e9.gif)
   
   
   ### TEST PLAN
   1. open explore view with a slow query
   2. when chart is loading, open data table, just see results tab
   3. check browser console, check how many requests running at the same time
   
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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



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

Reply via email to