Class ExplicitRecognizer


  • class ExplicitRecognizer
    extends Recognizer
    This is the Recognizer for the aggregate table descriptions that appear in the catalog schema files; the user explicitly defines the aggregate.
    Author:
    Richard M. Emberson
    • Method Detail

      • getTableDef

        protected ExplicitRules.TableDef getTableDef()
        Get the ExplicitRules.TableDef associated with this instance.
      • checkMeasures

        protected int checkMeasures()
        Make the measures for this aggregate table.

        First, iterate through all of the columns in the table. For each column, iterate through all of the tableDef measures, the explicit definitions of a measure. If the table's column name matches the column name in the measure definition, then make a measure. Next, look through all of the fact table column usage measures. For each such measure usage that has a sibling foreign key usage see if the tableDef has a foreign key defined with the same name. If so, then, for free, we can make a measure for the aggregate using its foreign key.

        Specified by:
        checkMeasures in class Recognizer
        Returns:
        number of measures created.
      • matchForeignKey

        protected int matchForeignKey​(JdbcSchema.Table.Column.Usage factUsage)
        Creates a foreign key usage.

        First the column name of the fact usage which is a foreign key is used to search for a foreign key definition in the ExplicitRules.tableDef. If not found, thats ok, it is just a lost dimension. If found, look for a column in the aggregate table with that name and make a foreign key usage.

        Specified by:
        matchForeignKey in class Recognizer
      • matchLevels

        protected void matchLevels​(Hierarchy hierarchy,
                                   HierarchyUsage hierarchyUsage)
        Creates a level usage. A level usage is a column that is used in a collapsed dimension aggregate table.

        First, iterate through the ExplicitRules.TableDef's level definitions for one with a name equal to the RolapLevel unique name, i.e., [Time].[Quarter]. Now, using the level's column name, search through the aggregate table's columns for one with that name and make a level usage for the column.

        Specified by:
        matchLevels in class Recognizer