Skip to content

[FEATURE] TablesNamesFinder does not support CREATE VIEW #2123

Closed
@cptnricard

Description

@cptnricard

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;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions