summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlzhang2012-02-17 01:01:44 (EST)
committer mwu2012-02-17 01:01:44 (EST)
commit0707af42f1e718a86a8b44bccda0c4a4ea4cec8e (patch)
treebf26c5b749b2277efe6d0a7ebb4f9c89a4ce523c
parent123f89f6d4aeb91dfc721e9ad8ad2abf1bf57352 (diff)
downloadorg.eclipse.birt-0707af42f1e718a86a8b44bccda0c4a4ea4cec8e.zip
org.eclipse.birt-0707af42f1e718a86a8b44bccda0c4a4ea4cec8e.tar.gz
org.eclipse.birt-0707af42f1e718a86a8b44bccda0c4a4ea4cec8e.tar.bz2
Exception is thrown out when adding a relative time filter if Recalcuate
Totals is not selected.[47626]
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/CubeQueryExecutor.java37
1 files changed, 35 insertions, 2 deletions
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/CubeQueryExecutor.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/CubeQueryExecutor.java
index 2121f69..8c0fd60 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/CubeQueryExecutor.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/impl/query/CubeQueryExecutor.java
@@ -281,7 +281,30 @@ public class CubeQueryExecutor
return referedScriptable != null;
}
-
+ private boolean adjustCubeFilterUpdateAggregationFlag(IFilterDefinition filter,Set dimLevelSet)
+ {
+ if( filter instanceof CubeFilterDefinition && ((CubeFilterDefinition) filter).getTargetLevel() != null )
+ {
+ IHierarchyDefinition hierarchy = ((CubeFilterDefinition) filter).getTargetLevel().getHierarchy();
+ DimLevel[] dims = (DimLevel[])dimLevelSet.toArray(new DimLevel[0]);
+
+ for( int j = 0 ; j <dims.length;j++)
+ {
+ boolean existDimLevel = false;
+ for (int p=0;p<hierarchy.getLevels().size();p++)
+ {
+ if(dims[j].getDimensionName().equals(hierarchy.getDimension().getName()) && dims[j].getLevelName().equals(hierarchy.getLevels().get(p).getName()))
+ existDimLevel = true;
+ }
+ if( !existDimLevel )
+ {
+ filter.setUpdateAggregation( true );
+ break;
+ }
+ }
+ }
+ return filter.updateAggregation();
+ }
private void populateFilterHelpers( ) throws DataException
{
@@ -293,8 +316,18 @@ public class CubeQueryExecutor
IFilterDefinition filter = (IFilterDefinition) filters.get( i );
if ( !filter.updateAggregation( ) )
{
- //For the filter that not requires updating aggregation, we would not populate them here.
+ Set dimLevelSet = OlapExpressionCompiler.getReferencedDimLevel(filter.getExpression(), defn.getBindings( ));
+ if ( dimLevelSet.size() <= 1)
+ {
+ //For the filter that not requires updating aggregation, we would not populate them here.
continue;
+ }
+ else
+ {
+ if( !adjustCubeFilterUpdateAggregationFlag(filter,dimLevelSet) )
+ continue;
+ }
+
}
switch ( this.getFilterType( filter, dimLevelInCubeQuery ))
{