EungsopYoo commented on PR #14890:
URL: https://github.com/apache/druid/pull/14890#issuecomment-1767428627

   > Thanks for the PR. I have added a review regarding the testing methodology 
and code practices we follow. Though I haven't looked at the changes, why do 
you think JOIN queries should be exempted from a __time filter if the 
subqueries have the filter? 
   
   Actually join queries **inherit** __time filters from their sub queries, not 
**exempt** the __time filtering.
   
   > If that's the case, then say something like UNION should also be exempt 
from the restriction.
   
   I think UNION ALL works basically well when requireTimeCondition=true.
   ```SQL
   SELECT __time, SUM(cnt) cnt
   FROM druid.foo
   WHERE __time >= TIMESTAMP '2000-01-01 00:00:00' AND __time < TIMESTAMP 
'2000-01-02 00:00:00'
   GROUP BY __time
   UNION ALL
   SELECT __time, SUM(cnt) cnt
   FROM druid.foo
   WHERE __time >= TIMESTAMP '2000-01-01 00:00:00' AND __time < TIMESTAMP 
'2000-01-02 00:00:00'
   GROUP BY __time
   
   // OK
   ```
   
   ```SQL
   SELECT __time, SUM(cnt) cnt
   FROM druid.foo
   GROUP BY __time
   UNION ALL
   SELECT __time, SUM(cnt) cnt
   FROM druid.foo
   WHERE __time >= TIMESTAMP '2000-01-01 00:00:00' AND __time < TIMESTAMP 
'2000-01-02 00:00:00'
   GROUP BY __time
   
   // Error: Unknown exception
   // requireTimeCondition is enabled, all queries must include a filter 
condition on the __time column
   // org.apache.druid.sql.calcite.rel.CannotBuildQueryException
   ```
   
   But, its error message is little weird in this condition.
   ```SQL
   SELECT __time, SUM(cnt) cnt
   FROM druid.foo
   WHERE __time >= TIMESTAMP '2000-01-01 00:00:00' AND __time < TIMESTAMP 
'2000-01-02 00:00:00'
   GROUP BY __time
   UNION ALL
   SELECT __time, SUM(cnt) cnt
   FROM druid.foo
   GROUP BY __time
   
   // Query results were truncated midstream! This may indicate a server-side 
error or a client-side issue. Try re-running your query, or using a lower limit 
or a longer timeout.
   ```
   
   


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