[ https://issues.apache.org/jira/browse/LENS-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14634666#comment-14634666 ]
Rajat Khandelwal commented on LENS-675: --------------------------------------- bq. I feel range resolution is fine wrt query passed. User might have to pass timerange_in classes separated by OR if the intention is OR. But the intention is not OR. I understand that the use case I've provided is a pretty stupid one, but logical equivalences in time range clauses should be taken care. Also, in case of OR, There's a risk of double counting. I give three time ranges: one from day 1 00 hour to day2 00 hour, one from day1 00 hour to 12 hour, another from 12 hour to day2 00 hour. In that case, The result of the query will be double of the correct result. > Time range merging for queries in lens > -------------------------------------- > > Key: LENS-675 > URL: https://issues.apache.org/jira/browse/LENS-675 > Project: Apache Lens > Issue Type: Improvement > Components: cube > Reporter: Rajat Khandelwal > > Assume I have two time dimensions: time_dim1 and time_dim2. With part cols: > td1 and td2 > And facts are available for each granularity between hourly, daily and > monthly. > Now I issue a query like "cube select fields from cube where > time_range_in(time_dim1, '2015-07-01', '2015-07-10') and > time_range_in(time_dim1, '2015-07-01', '2015-07-02') and > time_range_in(time_dim1, '2015-07-01-00', '2015-07-01-01') > Then the picked partitions in hql come out to be: > {noformat} > WHERE ((((( cube.td1 ) in ( '2015-07-01' , '2015-07-02' , '2015-07-03' , > '2015-07-04' , '2015-07-05' , '2015-07-06' , '2015-07-07' , > '2015-07-08' , '2015-07-09' ) and ( cube.td1 ) in ( '2015-07-01' )) and ( > cube.td1 ) in ( '2015-07-01-00' )))) > {noformat} > Now this query returns NULL result since no actual partitions are picked > through this condition. > Another issue with two time dimensions: > In the time ranges, one range is provided at hourly granularity and another > at daily granularity, then partitions can not be picked. > {noformat} > where time_range_in(time_dim1, '2015-07-01-00', '2015-07-01-01') and > time_range_in(time_dim2, '2015-07-01', '2015-07-02') > {noformat} > For multiple time ranges, it should be checked which granularities for time > dims coexist. -- This message was sent by Atlassian JIRA (v6.3.4#6332)