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

Minor refactor for view statement #34290

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ public ASTNode visitAlterView(final AlterViewContext ctx) {
@Override
public ASTNode visitDropView(final DropViewContext ctx) {
DorisDropViewStatement result = new DorisDropViewStatement();
result.setIfExists(null != ctx.ifExists());
result.getViews().addAll(((CollectionValue<SimpleTableSegment>) visit(ctx.viewNames())).getValue());
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ public ASTNode visitDropFunction(final DropFunctionContext ctx) {
@Override
public ASTNode visitDropView(final DropViewContext ctx) {
OpenGaussDropViewStatement result = new OpenGaussDropViewStatement();
result.setIfExists(null != ctx.ifExists());
result.getViews().addAll(((CollectionValue<SimpleTableSegment>) visit(ctx.qualifiedNameList())).getValue());
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,7 @@ public ASTNode visitDropGroup(final DropGroupContext ctx) {
@Override
public ASTNode visitDropView(final DropViewContext ctx) {
PostgreSQLDropViewStatement result = new PostgreSQLDropViewStatement();
result.setIfExists(null != ctx.ifExists());
result.getViews().addAll(((CollectionValue<SimpleTableSegment>) visit(ctx.qualifiedNameList())).getValue());
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public ASTNode visitCreateView(final CreateViewContext ctx) {
@Override
public ASTNode visitDropView(final DropViewContext ctx) {
PrestoDropViewStatement result = new PrestoDropViewStatement();
result.setIfExists(null != ctx.ifExists());
result.getViews().addAll(((CollectionValue<SimpleTableSegment>) visit(ctx.viewNames())).getValue());
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ public ASTNode visitDropProcedure(final DropProcedureContext ctx) {
@Override
public ASTNode visitDropView(final DropViewContext ctx) {
SQLServerDropViewStatement result = new SQLServerDropViewStatement();
result.setIfExists(null != ctx.ifExists());
for (ViewNameContext each : ctx.viewName()) {
result.getViews().add((SimpleTableSegment) visit(each));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@

package org.apache.shardingsphere.sql.parser.statement.doris.ddl;

import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.sql.parser.statement.core.statement.ddl.DropViewStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.DorisStatement;

/**
* Doris drop view statement.
*/
@Getter
@Setter
public final class DorisDropViewStatement extends DropViewStatement implements DorisStatement {

private boolean ifExists;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@

package org.apache.shardingsphere.sql.parser.statement.opengauss.ddl;

import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.sql.parser.statement.core.statement.ddl.DropViewStatement;
import org.apache.shardingsphere.sql.parser.statement.opengauss.OpenGaussStatement;

/**
* OpenGauss drop view statement.
*/
@Getter
@Setter
public final class OpenGaussDropViewStatement extends DropViewStatement implements OpenGaussStatement {

private boolean ifExists;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@

package org.apache.shardingsphere.sql.parser.statement.postgresql.ddl;

import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.sql.parser.statement.core.statement.ddl.DropViewStatement;
import org.apache.shardingsphere.sql.parser.statement.postgresql.PostgreSQLStatement;

/**
* PostgreSQL drop view statement.
*/
@Getter
@Setter
public final class PostgreSQLDropViewStatement extends DropViewStatement implements PostgreSQLStatement {

private boolean ifExists;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@

package org.apache.shardingsphere.sql.parser.statement.presto.ddl;

import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.sql.parser.statement.core.statement.ddl.DropViewStatement;
import org.apache.shardingsphere.sql.parser.statement.presto.PrestoStatement;

/**
* Presto drop view statement.
*/
@Getter
@Setter
public final class PrestoDropViewStatement extends DropViewStatement implements PrestoStatement {

private boolean ifExists;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@

package org.apache.shardingsphere.sql.parser.statement.sqlserver.ddl;

import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.sql.parser.statement.core.statement.ddl.DropViewStatement;
import org.apache.shardingsphere.sql.parser.statement.sqlserver.SQLServerStatement;

/**
* SQLServer drop view statement.
*/
@Getter
@Setter
public final class SQLServerDropViewStatement extends DropViewStatement implements SQLServerStatement {

private boolean ifExists;
}
Loading