expand subquery column lists first before macro expansion
Closed this issue · 1 comments
riastradh-probcomp commented
Currently we expand subquery column lists -- SELECT t.(SELECT ...)
-- at the same time we format the SQL output. The ad hoc macro expansion for SIMULATE <compound expression> FROM MODELS OF p
that I added last week happens before that, but for SIMULATE t.(<subquery>) FROM MODELS OF p
to work, we need the macro expander to know the list of variables produced by first. So the easiest way to accomplish that will be to do things in three stages:
- Expand subquery column lists.
- Expand compound expression
SIMULATE
intoSELECT
of primitive expressionSIMULATE
. - Generate SQL.
riastradh-probcomp commented
Done in f764732.