Package mondrian.olap

Class IdBatchResolver

java.lang.Object
mondrian.olap.IdBatchResolver

public final class IdBatchResolver extends Object
Used to collect and resolve identifiers in groups of children where possible. For example, if an enumerated set within an MDX query includes references to 10 stores under the parent [USA].[CA].[San Francisco] the class will attempt to identify those 10 identifiers and issue a single lookup, resulting in fewer and more efficient SQL queries. The resulting collection of resolved identifiers is returned in a map of <QueryPart, QueryPart>, where the unresolved Exp object acts as the key. This class makes no assurances that all identifiers will be resolved. The map returned by .resolve() will include only those identifiers successfully resolved.
  • Constructor Details

    • IdBatchResolver

      public IdBatchResolver(Query query)
  • Method Details

    • resolve

      public Map<QueryPart,QueryPart> resolve()
      Attempts to resolve the identifiers contained in the query in batches based on the parent, e.g. looking up and resolving the states in the set: { [Store].[USA].[CA], [Store].[USA].[OR] } together rather than individually. Note that there is no guarantee that all identifiers will be resolved. Calculated members, for example, are explicitly not handled here. The purpose of this class is to improve efficiency of resolution of non-calculated members, but must be followed by more thorough expression resolution.
      Returns:
      a Map of the expressions Id elements mapped to their respective resolved Exp.