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

Resolve wildcard for view on creation #6161

Open
xxchan opened this issue Nov 1, 2022 · 4 comments
Open

Resolve wildcard for view on creation #6161

xxchan opened this issue Nov 1, 2022 · 4 comments
Assignees

Comments

@xxchan
Copy link
Member

xxchan commented Nov 1, 2022

Original posted at #6023

How to handle * in case of ddl (specifically adding column) is not yet considered

example: create table t(x int); create view v as select * from t; alter table t add column y int; In PG, v only outputs x without y. This means * is resolved before the view is stored. This behavior is expected also because we can specify column names when creating views. It only makes sense if the view outputs fixed number of columns.

The difficulty is that * is resolved in binder, but after binding, we can't restore the BoundQuery to AST and unparse it. One solution is to serializing plan instead of sql, but as discussed earlier we don't want to persist plan because it may be subject to change. Another solution is to rewriting AST while binding, but it may be a little bit hacky.

@lmatz

This comment was marked as resolved.

@xxchan

This comment was marked as resolved.

@BugenZhao
Copy link
Member

Note: we should also consider this when doing scheme change. #6903 #8352

@xxchan
Copy link
Member Author

xxchan commented Mar 6, 2023

Yeah, I'm aware of that 🥹

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

No branches or pull requests

4 participants