You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by "Amareshwari Sriramadasu (JIRA)" <ji...@apache.org> on 2015/07/21 06:37:04 UTC

[jira] [Commented] (LENS-675) Time range merging for queries in lens

    [ https://issues.apache.org/jira/browse/LENS-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14634520#comment-14634520 ] 

Amareshwari Sriramadasu commented on LENS-675:
----------------------------------------------

bq. 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')
bq. 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' ))))
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.

bq. In the time ranges, one range is provided at hourly granularity and another at daily granularity, then partitions can not be picked.
I see this is a issue. Why cannot partitions be picked with current code?

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