Skip to content

Commit

Permalink
Change the definition position of the create table SelectStatement class
Browse files Browse the repository at this point in the history
  • Loading branch information
zihaoAK47 committed Oct 19, 2023
1 parent 83eb124 commit 8dee1dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.ConstraintDefinitionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
import org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement;

import java.util.Collection;
import java.util.LinkedList;
import java.util.Optional;

/**
* Create table statement.
Expand All @@ -36,7 +38,18 @@ public abstract class CreateTableStatement extends AbstractSQLStatement implemen

private SimpleTableSegment table;

private SelectStatement selectStatement;

private final Collection<ColumnDefinitionSegment> columnDefinitions = new LinkedList<>();

private final Collection<ConstraintDefinitionSegment> constraintDefinitions = new LinkedList<>();

/**
* Get select statement.
*
* @return select statement
*/
public Optional<SelectStatement> getSelectStatement() {
return Optional.ofNullable(selectStatement);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
import lombok.Setter;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateTableStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement;
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.SQLServerStatement;

import java.util.LinkedList;
import java.util.List;
import java.util.Optional;

/**
* SQLServer create table statement.
Expand All @@ -36,15 +34,4 @@
public final class SQLServerCreateTableStatement extends CreateTableStatement implements SQLServerStatement {

private final List<ColumnSegment> columns = new LinkedList<>();

private SelectStatement selectStatement;

/**
* Get select statement.
*
* @return select statement
*/
public Optional<SelectStatement> getSelectStatement() {
return Optional.ofNullable(selectStatement);
}
}

0 comments on commit 8dee1dc

Please sign in to comment.