Skip to content

Commit

Permalink
Fix sort on aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
pshi authored and zhiqiangqian committed Jul 22, 2014
1 parent fb358c7 commit d3ddb59
Showing 1 changed file with 7 additions and 9 deletions.
Expand Up @@ -171,8 +171,15 @@ public static void populateAggregationSort( CubeQueryExecutor executor,
measureName = OlapExpressionUtil.getMeasure( referBinding.getExpression( ) );
bindingName = referBinding.getBindingName( );
aggrOns = referBinding.getAggregatOns( );

if ( referBinding.getAggrFunction( ) == null
&& ( aggrOns == null || aggrOns.size( )==0 ) )
{
aggrOns = CubeQueryDefinitionUtil.populateMeasureAggrOns( queryDefn );
}
}
}

if ( aggrOns != null && aggrOns.size( ) > 0 )
{
aggrOnLevels = new DimLevel[aggrOns.size( )];
Expand All @@ -182,15 +189,6 @@ public static void populateAggregationSort( CubeQueryExecutor executor,
.toString( ) );
}
}
else if ( measureName != null )
{
List measureAggrOns = CubeQueryDefinitionUtil.populateMeasureAggrOns( queryDefn );
aggrOnLevels = new DimLevel[measureAggrOns.size( )];
for ( int k = 0; k < measureAggrOns.size( ); k++ )
{
aggrOnLevels[k] = (DimLevel) measureAggrOns.get( k );
}
}
}
else
{
Expand Down

0 comments on commit d3ddb59

Please sign in to comment.