Open ezequielp opened 1 year ago
@ezequielp This is correct behavior. Please see https://cube.dev/docs/schema/fundamentals/joins#directions-of-joins-transitive-join-pitfalls. You might want to introduce joins on both sides of a relationship and use views to provide explicit direction of joins.
@paveltiunov but, cName is defined on B, and B is joined to E, so the join could be correctly determined from the query, right? It is not as I was explicitly requesting C.Name and E.Name, I'm requesting B.cName and E.Name...
Also, what about the second part of the problem?
Describe the bug Wrong SQL query generated or can't find path between two cubes.
To Reproduce Steps to reproduce the behavior:
sql: `${C.name}`,
withsql: `${CUBE.C.name}`,
This comes from an incorrect SQL statement that is joining tables in the wrong order:
Expected behavior For the first schema, cube should be able to find the path to join B to E (which is through A). Alternatively, for the second version of the schema, cube should be able to generate the right SQL query.
Minimally reproducible Cube Schema
Version: [e.g. 0.32.16]
Additional context This problem wasn't happening on v0.30