Skip to content

[FEATURE] TablesNamesFinder does not support CREATE VIEW #2123

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

Closed
cptnricard opened this issue Dec 12, 2024 · 2 comments
Closed

[FEATURE] TablesNamesFinder does not support CREATE VIEW #2123

cptnricard opened this issue Dec 12, 2024 · 2 comments

Comments

@cptnricard
Copy link
Contributor

Is there a reason why TablesNamesFinder supports a CREATE TABLE but throws an exception for a CREATE VIEW?
Wouldn't the implementation be almost identical?

The current implementation is

    @Override
    public <S> Void visit(CreateView createView, S context) {
        throwUnsupported(createView);
        return null;
    }

It seems that it could easily be replaced with

    @Override
    public <S> Void visit(CreateView create, S context) {
        visit(create.getView(), null);
        if (create.getSelect() != null) {
            create.getSelect().accept((SelectVisitor<?>) this, context);
        }
        return null;
    }

Which is almost a copy&paste of the CREATE TABLE implementation

    @Override
    public <S> Void visit(CreateTable create, S context) {
        visit(create.getTable(), null);
        if (create.getSelect() != null) {
            create.getSelect().accept((SelectVisitor<?>) this, context);
        }
        return null;
    }
@manticore-projects
Copy link
Contributor

Greetings!
You are right of course and your PR was very welcome.

@manticore-projects
Copy link
Contributor

fixed via #2124

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