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

Amareshwari Sriramadasu commented on LENS-33:
---------------------------------------------

Comments :

 Changes required in the following code :
{noformat}
+        for(String timePartCol: cubeql.getCube().getTimedDimensions()) {
+          sb.append(timePartCol).append(" != latest").append(" AND ");
+        }
{noformat}

* Part column name corresponding to timedDimension can be different. You need 
to use cube level method to get part column corresponding to timed dimension. 
Utility methods are available in CubeQueryContext 
* Also skipping latest filter should happen only when 
CubeQueryContext.shouldReplaceTimeDimWithPart() is true
* The constant latest is defined StorageConstants

Also include a unit test

> Latest partitions from fact tables should be skipped on the final query
> -----------------------------------------------------------------------
>
>                 Key: LENS-33
>                 URL: https://issues.apache.org/jira/browse/LENS-33
>             Project: Apache Lens
>          Issue Type: Bug
>          Components: cube
>    Affects Versions: 2.0
>            Reporter: Amareshwari Sriramadasu
>            Assignee: Rajat Khandelwal
>            Priority: Critical
>             Fix For: 2.0
>
>         Attachments: LENS-33.0.patch
>
>
> Right now, latest partitions from fact would get included in the final query 
> when the storage tables are partitioned by more than one time dimension 
> column. This would make fact partition to be queried twice making the data 
> read twice and leading to wrong results.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to