Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Expands into an autoJoinTables operator.
Syntax
...
LQL
Code Block |
---|
@autoJoinTables(parent: TableReference, children: TableReferenceList, [result: TableResultList]) |
If result
is omitted, the value parent +: children
is used.
Examples
...
LQL
Code Block |
---|
@autoJoinTables(P, [C1, C2, C3]) # equivalent to @autoJoinTables(P, [C1, C2, C3], [P, C1, C2, C3]) |
...
Code Block |
---|
@autoJoinTables(P, [C1, C2, C3], [P, C2]) |
Semantic
...
The macro expands to autoJoinTables(joinTables, result)
, where joinTables
is the distinct concatenation of reverseDfsOrder(parent, child)
for every child
table in children
, and reverseDfsOrder(p, c)
is the reverse of the DFS ordering obtained by traversing the inverted subdag between p
and c
starting from c
.
In other words, joinTables
is the set of all nodes on every path between a child
and the parent
node, ordered in a specific way to make autoJoinTables
work.
Use case
...
Suppose you have tables similar to
...