Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make `COLUMNS OF <generator>' a first-class table in BQL #46

Open
riastradh-probcomp opened this issue Jun 9, 2015 · 2 comments
Open

Comments

@riastradh-probcomp
Copy link
Contributor

No description provided.

@riastradh-probcomp riastradh-probcomp changed the title make COLUMNS OF <generator> a first-class table in BQL make `COLUMNS OF <generator>' a first-class table in BQL Jun 9, 2015
@raxraxraxraxrax
Copy link

Can you provide a possible use case for this, please?

@riastradh-probcomp
Copy link
Contributor Author

Currently we have the two ad-hoc constructions

ESTIMATE ... FROM COLUMNS OF <generator>

and

ESTIMATE ... FROM PAIRWISE COLUMNS OF <generator>

Suppose we had three-way or n-way column functions, e.g. conditional mutual information. Then we'd have to add

ESTIMATE ... FROM TREBLEWISE COLUMNS OF <generator>

and so on -- but that's silly. All of these are naturally just selects on joins of the table of variables in the generator in question.

Not everything involves BQL functions. E.g., the function describe_generator_columns in bdbcontrib falls back to SQL and does a complex join on bayesdb_generator, bayesdb_column, and bayesdb_generator_column, which would be much better expressed via BQL using a select on COLUMNS OF <generator>.

You don't always want to join the columns of a generator with itself -- you might want to look up metadata about a column in some model by doing a join of COLUMNS OF <generator> and, say, bayesdb_crosscat_column or something. Or you might want to do it with multiple different tables, using qualified names:

ESTIMATE ... FROM COLUMNS OF <generator0> AS c0, COLUMNS OF <generator1> AS c1 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants