You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/04/25 15:18:52 UTC

[GitHub] [druid] suneet-s commented on pull request #12472: Convert simple min/max SQL queries on __time to timeBoundary queries

suneet-s commented on PR #12472:
URL: https://github.com/apache/druid/pull/12472#issuecomment-1108712702

   Here's a set of tests I ran on top of this PR after ingesting the sample wikipedia data with hour granularity.
   
   Thanks for this enhancement @rohangarg !
   
   ```
   --Time buckets
   -- SELECT
   --   TIME_FLOOR(__time, 'PT1H') AS "Time",
   --   COUNT(*) AS "Count"
   -- FROM "wiki-hour"
   -- GROUP BY 1
   -- ORDER BY 1 ASC
   
   -- Time filters (TESTS - aggregation, filter, results) 
   -- MAX  t > 2016-06-27 22:00:00                          | <no data>
   -- MAX  t < 2016-06-27 00:00:00                          | <no data>
   -- MAX  2016-06-27 02:12:00 < t < 2016-06-27 02:30:00    | 2016-06-27T02:29:59.744Z
   -- MAX  2016-06-27 20:30:00 < t < 2016-06-27 21:10:00    | 2016-06-27T21:09:59.379Z
   -- MAX  2016-06-27 21:30:00 < t < 2016-06-28 00:10:00    | 2016-06-27T21:31:02.498Z
   -- MAX                                                   | 2016-06-27T21:31:02.498Z
   
   SELECT MAX(__time) from "wiki-hour" WHERE __time >  TIMESTAMP '
   ```
   
   My last concern with this is that the results are now different from what they used to be if the query interval doesn't match. Returning no results sounds like a better response than returning -ve and +ve infinity when the query interval doesn't match. But I will mark this PR as `Incompatible` and `Release Notes` so the release manager can decide if they disagree with this assessment. Query users will need to handle both -ve/+ve infinity as well as null as expected results from this query which isn't a great experience, but is a step in the right direction.
   
   <img width="1418" alt="Screen Shot 2022-04-25 at 8 14 29 AM" src="https://user-images.githubusercontent.com/44787917/165119122-8a182da5-a618-43a2-9c8b-610c8f8ca380.png">
   2016-06-27 22:00:00'


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org