bayeslite icon indicating copy to clipboard operation
bayeslite copied to clipboard

SIMULATE * gives syntax error

Open marcoct opened this issue 10 years ago • 4 comments

q('''create temp table simulated as simulate * from satellites_cc limit 10000''') BQLParseError: Parse error: syntax error near *

I was expecting * to work for colnames, and other users might as well. Drawing a ton of samples from the model's full joint distribution and creating a table with this data, and then selecting and visualizing this simulated data might be a common desired entry point, even if it is inefficient compared to performing conditional simulations and storing only the variables of specific interest.

marcoct avatar Oct 07 '15 15:10 marcoct

Shouldn't be too hard to fix this, I think: one grammar rule, one new and one tweaked parser rule, and a little code in compile_simulate in compiler.py.

riastradh-probcomp avatar Oct 08 '15 15:10 riastradh-probcomp

One reason I might have thought this was not obviously the right thing is that we can simulate only modelled columns, not all columns of the table.

riastradh-probcomp avatar Oct 09 '15 18:10 riastradh-probcomp

Presumably the semantics of * in this case would be "all modelled columns", equivalently "all columns of the generator".

axch avatar Oct 09 '15 19:10 axch

Yes. I didn't say it was a good reason.

riastradh-probcomp avatar Oct 09 '15 19:10 riastradh-probcomp