fx19880617 opened a new pull request #12536:
URL: https://github.com/apache/superset/pull/12536


   ### SUMMARY
   Fixing the bug that time granularity doesn't work for 
WEEKS/MONTHS/QUARTERS/YEARS.
   Pinot internally has two time converter functions: timeConverter and 
dateTrunc.
   Pinot `timeConverter` has better performance comparing to `dateTrunc` 
function when querying for granularity `DAYS`/`MINUTES`/`SECONDS`/... as it 
uses arithmetic ops for it, however, this function doesn't support conversion 
to `WEEKS`/`MONTHS`/`QUARTERS`/`YEARS`.
   
   So we need to use `dateTrunc` for querying with those granularities.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Before: error when send queries using granularity: week/month/quarter/year
   
![image](https://user-images.githubusercontent.com/1202120/104679105-c6cd5180-56a1-11eb-986b-eca4d3a5d17a.png)
   
   
   After, query with month:
   
![image](https://user-images.githubusercontent.com/1202120/104678996-853ca680-56a1-11eb-9644-16980fb661d2.png)
   
   ### TEST PLAN
   Unit test and integration tests with Pinot quickstart
   
   ### 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