Uploaded image for project: 'Apache Lens (Retired)'
  1. Apache Lens (Retired)
  2. LENS-752

Support flattening of columns selected through bridge-tables(many-to-many relationships)

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4
    • cube
    • None

    Description

      Data warehousing concepts suggests to use bridge-tables to implement many-to-many relationships between cube & dimension or between two dimensions.

      Here are few links explaining the bridge-tables
      http://www.pythian.com/blog/implementing-many-to-many-relationships-in-data-warehousing/
      http://www.kimballgroup.com/2012/02/design-tip-142-building-bridges/
      http://stackoverflow.com/questions/2785158/star-schema-fact-1n-dimension-how
      http://www.askjohnobiee.com/2013/08/how-to-bridge-tables-and-many-to-many.html

      If we look at the following schema :
      User :

      ID Name Gender
      1 A M
      2 B M
      3 C F

      User interests :

      UserID Sports ID
      1 1
      1 2
      2 1
      2 2
      2 3

      Sports :

      SportsID Description
      1 Football
      2 Cricket
      3 Basketball

      User Interests is the bridge table which is capturing the many-to-many relationship between Users and Sports.

      If we have a fact as follows :

      UserId Revenue
      1 100
      2 50

      If analyst is interested in analyzing with respect to user's interest, then the report would the following :

      User Interest Revenue
      Football 150
      Cricket 150
      BasketBall 50

      Though the individual rows are correct and the overall revenue is actually 150, looking at above report makes people assume that overall revenue is 350.

      The feature ask here is to optionally flatten the selected fields, if fields involved are coming from bridge tables in join path. If flattening is enabled, the report would be the following :

      User Interest Revenue
      Football, Cricket 100
      Football, Cricket, BasketBall 50

      Attachments

        1. LENS-752.3.patch
          67 kB
          Amareshwari Sriramadasu

        Issue Links

          Activity

            People

              amareshwari Amareshwari Sriramadasu
              amareshwari Amareshwari Sriramadasu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: