Bug 131011 Support running query based on report document data
Data Engine should support running a query based on data set and expression data stored in a report document. This bugzilla entry serves as a repository for design docs and notes related to this feature.
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/transform/group/GroupCalculationUtil.java
{
			int index = groupDefs[i].getColumnIndex( );
			if ( index >= 0 )
			{
				sortKeyIndexes[i] = groupDefs[i].getColumnIndex( );
				sortKeyColumns[i] = groupDefs[i].getColumnName( );
				sortAscending[i] = groupDefs[i].getGroupSpec( )
						.getSortDirection( ) != IQuery.GroupSpec.SORT_DESC;
			}
		}
		for ( int i = 0; i < sortCount; i++ )
		{
			int keyIndex = query.getOrdering( )[i].getIndex( );
			String keyName = query.getOrdering( )[i].getField( );
			
			
			if ( keyName != null )
				keyIndex = rsMeta.getFieldIndex( keyName );
			sortKeyIndexes[groupCount + i] = keyIndex;
			sortKeyColumns[groupCount + i] = keyName;
			sortAscending[groupCount + i] = query.getOrdering( )[i].isAscendingOrder( );
		}
		return new SortSpec( sortKeyIndexes, sortKeyColumns, sortAscending );
	}
}
/**
 * Structure to hold information about a group instance at a particular grouping
 * level.
 */
final class GroupInfo