##! experimental.join_types #1534
Replies: 1 comment
-
More on the underlying problem. We initially implemented only left joins because in a For example, if you had flights and you inner joined california airports, flights would be reduced to only California flights. In a query, you can expect and like this behavior, but in a source, simply grouping by For this reason, I'm not sure we should allow These joins in queries are important and powerful. We need a syntax that reflects this. |
Beta Was this translation helpful? Give feedback.
-
experimental.join_types
December 4, 2023 - lloydtabb
Currently Malloy only supports a left join. This experiment addes all the other join types (inner, full, right) as optional. To turn on this experiment the following code to the top of your file.
The current syntax to use this experiment
Considerations
Its not clear that this is correct. For the most part, you would like to use these joins in a
query:
block instead of asource:
block but we only allow adding joins to sources.In Malloy, joins are only included when a measure or dimension from that join is included. Inner joins operate as filters. When you include an inner join, you usually want that join to execute regardless if something is included or not.
Including an inner join in a source might be confusing as it would filter the source if something is referenced.
Perhaps these joins should only be allowed in queries and perhaps they should always execute.
Having
join_types
available will allow us to figure out what is right. I'm pretty sure this experimental implementation has problems as implemented.Beta Was this translation helpful? Give feedback.
All reactions