Specifying Primary Key - Foreign Key Constraints

When modeling a star join in Arcadia Enterprise, we specify referential integrity by declaring that the join relationship is made up by a primary key - foreign key constraint.

Here, we demonstrate eager aggregation on the following dashboard, Coupon Usage, that shows coupons redeemed by demographic band.

Dashboard that uses eager aggregation

Follow these steps to specify the primary key - foreign key constraint on the dataset used by this dashboard, Eager Aggregation:

  1. In the Dataset interface, select the Data Model option.

  2. Click Edit Data Model.

    Edit data model
  3. Click the (join) icon to edit the join between the tables tpcds_parquet.store_sales and tpcds_parquet.customer.

    Edit the table join
  4. In the Join Detail menu, click Edit Join Details.

    Edit the details of the table join
  5. In the Edit Join modal, each table of the join has a Foreign Key selector.

    Because tpcds_parquet.store_sales is the fact table, we select its ss_customer_sk column as the foreign key. Subsequently, the column c_customer_sk in the tpcds_parquet.customer table becomes the primary key.

    Click Apply to save the primary key - foreign key constraint of the join.

    Edit the details of the table join
  6. Repeat the previous two steps for the other join in the dataset, between tpcds_parquet.store_sales and tpcds_parquet.household_demographics.

  7. Save the changes to the Data Model.

    Edit the details of the table join