From 5960e45b28771b2448a26e8fe8ceea652750e017 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Tue, 10 Sep 2024 15:27:24 +0100 Subject: [PATCH 1/3] Update sl-jdbc.md adding multi-hop syntax [per internal slack thread](https://dbt-labs.slack.com/archives/C03KHQRQUBX/p1725626988152529) --- website/docs/docs/dbt-cloud-apis/sl-jdbc.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/website/docs/docs/dbt-cloud-apis/sl-jdbc.md b/website/docs/docs/dbt-cloud-apis/sl-jdbc.md index ea0afbcfbad..88840ec8e61 100644 --- a/website/docs/docs/dbt-cloud-apis/sl-jdbc.md +++ b/website/docs/docs/dbt-cloud-apis/sl-jdbc.md @@ -542,6 +542,19 @@ select * from {{ semantic_layer.query(saved_query="new_customer_orders", limit=5 The JDBC API will use the saved query (`new_customer_orders`) as defined and apply a limit of 5 records. +### Multi-hop joins + +In cases where you need to query across multiple related tables (multi-hop joins), you can use the `entity_path` argument to specify the path between related entities. The following are examples of how you can define these joins: + +- In this example, you're querying the `location_name` dimension but specifying that it should be joined using the `order_id` field. + ```sql + {{Dimension('location__location_name', entity_path=['order_id'])}} + ``` +- In this example, the `salesforce_account_owner` dimension is joined to the `region` field, with the path going through `salesforce_account`. + ```sql + {{ Dimension('salesforce_account_owner__region',['salesforce_account']) }} + ``` + ## FAQs From c989e9f44b6d6aecc77bf3db7dff662abd183ae7 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:19:04 +0100 Subject: [PATCH 2/3] Update website/docs/docs/dbt-cloud-apis/sl-jdbc.md --- website/docs/docs/dbt-cloud-apis/sl-jdbc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/dbt-cloud-apis/sl-jdbc.md b/website/docs/docs/dbt-cloud-apis/sl-jdbc.md index 88840ec8e61..3a9832dd706 100644 --- a/website/docs/docs/dbt-cloud-apis/sl-jdbc.md +++ b/website/docs/docs/dbt-cloud-apis/sl-jdbc.md @@ -544,7 +544,7 @@ The JDBC API will use the saved query (`new_customer_orders`) as defined and app ### Multi-hop joins -In cases where you need to query across multiple related tables (multi-hop joins), you can use the `entity_path` argument to specify the path between related entities. The following are examples of how you can define these joins: +In cases where you need to query across multiple related tables (multi-hop joins), use the `entity_path` argument to specify the path between related entities. The following are examples of how you can define these joins: - In this example, you're querying the `location_name` dimension but specifying that it should be joined using the `order_id` field. ```sql From 56a9e392cfbac5d458a1696344acff7b049dc509 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:50:23 +0100 Subject: [PATCH 3/3] Update sl-graphql.md --- website/docs/docs/dbt-cloud-apis/sl-graphql.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/website/docs/docs/dbt-cloud-apis/sl-graphql.md b/website/docs/docs/dbt-cloud-apis/sl-graphql.md index 2898b6e5c0a..13149ca4953 100644 --- a/website/docs/docs/dbt-cloud-apis/sl-graphql.md +++ b/website/docs/docs/dbt-cloud-apis/sl-graphql.md @@ -627,3 +627,16 @@ mutation { } } ``` + +### Multi-hop joins + +In cases where you need to query across multiple related tables (multi-hop joins), use the `entity_path` argument to specify the path between related entities. The following are examples of how you can define these joins: + +- In this example, you're querying the `location_name` dimension but specifying that it should be joined using the `order_id` field. + ```sql + {{Dimension('location__location_name', entity_path=['order_id'])}} + ``` +- In this example, the `salesforce_account_owner` dimension is joined to the `region` field, with the path going through `salesforce_account`. + ```sql + {{ Dimension('salesforce_account_owner__region',['salesforce_account']) }} + ```