Replies: 5 comments 2 replies
|
To your point, maybe this should be even extended by custom joining criteria? Currently there is from_column and to_column. In some joins you need to add custom logic (like join on pk + date (either current or between other dates). |
|
+1 from the ThoughtSpot converter work (#285), with a data point: this isn't hypothetical loss. Every shipped converter is already working around it. The Databricks converter derives cardinality from from/to orientation, and ThoughtSpot has four cardinality values and five join types that orientation alone cannot encode, so we stash both in custom_extensions. No other tool can see them. An optional type/cardinality on Relationship (defaulting to today's inferred behavior for backward compatibility) would let converters stop hiding semantics that affect generated SQL. |
|
Field evidence in favor of making cardinality explicit and first-class: One request from the closed-world side of the house: keep the declaration cheap for sources that always know their cardinality (SAP and ERP-class models never guess it), so emitters can declare rather than infer. Open for discussion |
|
According to the Core Metadata Specification (https://github.com/apache/ossie/blob/main/core-spec/spec.md#L177-L189), from is described as the “many side” and to as the “one side.” However, the YAML specification This wording seems inconsistent because a one-to-one relationship has no “many side.” Would it be more accurate to define from as the referencing side and to as the referenced side, while modeling cardinality separately with |
|
Looking through the comments, advanced relationship functionality is a good topic for the language working group. Let me synthesize (please correct me where I have read this wrong). Many BI tools can write SQL that safely computes measures against dimensions from other tables at different grains even without cardinality. Using the layering framing in this document, the SQL generation logic encoded by the Layer 3 (dimensional) document should be able to safely orchestrate this de-duplication while the Layer 2 (metrics) document proposes adding this functionality to SQL itself. Perhaps one output of Ossie is to make sure these techniques for avoiding chasm/fan traps are well published. Given this framing, there are a few ways that relationship cardinality can be valuable: SQL Generation (@djwaldo): You should be able to significantly simplify multi-table queries if you have cardinality (or referential integrity) metadata. I’d also be interested in more details on @djwaldo’s join types. This could be related to language support for cross-table measures. For example, a metric which left joins is different from one that inner joins. The former captures all row values (e.g. count of open tickets) while the latter is a filtered measure (e.g. count of tickets that have an assignee) |
Uh oh!
There was an error while loading. Please reload this page.
OSI models relationships primarily through join keys (entities) and inferred join behavior. This works well for many star-schema cases, but it leaves key relationship semantics implicit, which can make SQL generation and portability across semantic layers (e.g., Coginiti, Cube, AtScale, BI tools) either lossy or error-prone.
Suggested enhancement
Introduce an optional relationship block (or relationship annotations) that can be attached to an entity pair / join key mapping, such as: cardinality: one_to_one | one_to_many | many_to_one | many_to_many
All reactions