tspurway / hustle

A column oriented, embarrassingly distributed relational event database.
Other
240 stars 36 forks source link

Nested selects() result in poorly named Tables #4

Closed tspurway closed 10 years ago

tspurway commented 10 years ago

Currently, a nested select() will return a Table named 'sub-tablename' where tablename is the table the select() was performed on.

If we try to join two nested tables that were from the same table, they will both have the same name, and that will cause a number of issues in identifying which table is which.

For nested queries, select a unique name for the returned Table.

For example:

a = select(t.c1, t.c2, where=t.c3 > 5, nest=True)
b = select(t.c1, t.c2, where=t.c4 == 'bizness', nest=True)
c = select(a.c1, b.c2, where=(a, b), join=(a.c5, b.c5))

will complain:

Table sub-t occurs twice in the where clause.
ncloudioj commented 10 years ago

Fixed this issue in commit f4a4ccf585c25bdde9183f94dd2f323efedcc624