You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by tu...@apache.org on 2022/11/18 07:42:48 UTC
[shardingsphere] branch master updated: Rename constant package to enums and rename NullsOrderDirection to NullsOrderType (#22256)
This is an automated email from the ASF dual-hosted git repository.
tuichenchuxin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 1aab71057d0 Rename constant package to enums and rename NullsOrderDirection to NullsOrderType (#22256)
1aab71057d0 is described below
commit 1aab71057d0b3168a3f04c9737b0cb8107c66eed
Author: Zhengqiang Duan <du...@apache.org>
AuthorDate: Fri Nov 18 15:42:40 2022 +0800
Rename constant package to enums and rename NullsOrderDirection to NullsOrderType (#22256)
---
.../EncryptIndexColumnTokenGenerator.java | 2 +-
.../generator/EncryptProjectionTokenGenerator.java | 2 +-
.../impl/EncryptOrderByItemTokenGeneratorTest.java | 6 ++--
.../merge/ddl/fetch/FetchStreamMergedResult.java | 2 +-
.../merge/dql/ShardingDQLResultMerger.java | 12 +++----
.../dql/groupby/GroupByMemoryMergedResult.java | 2 +-
.../merge/dql/groupby/GroupByRowComparator.java | 2 +-
.../aggregation/AggregationUnitFactory.java | 2 +-
.../sharding/merge/dql/orderby/CompareUtil.java | 12 +++----
.../sharding/merge/dql/orderby/OrderByValue.java | 2 +-
.../impl/FetchDirectionTokenGenerator.java | 2 +-
.../generator/impl/ProjectionsTokenGenerator.java | 12 +++----
.../rewrite/token/pojo/FetchDirectionToken.java | 2 +-
.../sharding/rewrite/token/pojo/OrderByToken.java | 2 +-
.../ddl/fetch/FetchStreamMergedResultTest.java | 2 +-
.../merge/dql/ShardingDQLResultMergerTest.java | 42 +++++++++++-----------
.../dql/groupby/GroupByMemoryMergedResultTest.java | 12 +++----
.../dql/groupby/GroupByRowComparatorTest.java | 40 ++++++++++-----------
.../dql/groupby/GroupByStreamMergedResultTest.java | 10 +++---
.../merge/dql/groupby/GroupByValueTest.java | 24 ++++++-------
.../aggregation/AggregationUnitFactoryTest.java | 2 +-
.../merge/dql/orderby/CompareUtilTest.java | 30 ++++++++--------
.../dql/orderby/OrderByStreamMergedResultTest.java | 8 ++---
.../merge/dql/orderby/OrderByValueTest.java | 30 ++++++++--------
.../rewrite/token/OrderByTokenGeneratorTest.java | 2 +-
.../token/ProjectionsTokenGeneratorTest.java | 2 +-
.../token/ShardingRemoveTokenGeneratorTest.java | 8 ++---
.../rewrite/token/pojo/OrderByTokenTest.java | 2 +-
.../orderby/engine/OrderByContextEngine.java | 12 +++----
.../select/projection/engine/ProjectionEngine.java | 2 +-
.../impl/AggregationDistinctProjection.java | 2 +-
.../projection/impl/AggregationProjection.java | 2 +-
.../projection/impl/ParameterMarkerProjection.java | 2 +-
.../statement/dml/SelectStatementContext.java | 4 +--
.../groupby/engine/GroupByContextEngineTest.java | 10 +++---
.../orderby/engine/OrderByContextEngineTest.java | 14 ++++----
.../select/pagination/PaginationContextTest.java | 8 ++---
.../select/projection/ProjectionsContextTest.java | 2 +-
.../projection/engine/ProjectionEngineTest.java | 2 +-
.../engine/ProjectionsContextEngineTest.java | 20 +++++------
.../impl/AggregationDistinctProjectionTest.java | 2 +-
.../projection/impl/AggregationProjectionTest.java | 2 +-
.../statement/impl/SelectStatementContextTest.java | 24 ++++++-------
.../infra/database/type/DatabaseType.java | 2 +-
.../database/type/dialect/H2DatabaseType.java | 2 +-
.../database/type/dialect/MariaDBDatabaseType.java | 2 +-
.../database/type/dialect/MySQLDatabaseType.java | 2 +-
.../type/dialect/OpenGaussDatabaseType.java | 2 +-
.../database/type/dialect/OracleDatabaseType.java | 2 +-
.../type/dialect/PostgreSQLDatabaseType.java | 2 +-
.../database/type/dialect/SQL92DatabaseType.java | 2 +-
.../type/dialect/SQLServerDatabaseType.java | 2 +-
.../database/type/dialect/H2DatabaseTypeTest.java | 2 +-
.../type/dialect/MariaDBDatabaseTypeTest.java | 2 +-
.../type/dialect/MySQLDatabaseTypeTest.java | 2 +-
.../type/dialect/OracleDatabaseTypeTest.java | 2 +-
.../type/dialect/PostgreSQLDatabaseTypeTest.java | 2 +-
.../type/dialect/SQL92DatabaseTypeTest.java | 2 +-
.../type/dialect/SQLServerDatabaseTypeTest.java | 2 +-
.../infra/fixture/InfraDatabaseTypeFixture.java | 2 +-
.../sql/token/pojo/generic/InsertValue.java | 2 +-
.../pojo/generic/SubstitutableColumnNameToken.java | 2 +-
.../sql/token/pojo/generic/InsertValueTest.java | 2 +-
.../generic/SubstitutableColumnNameTokenTest.java | 2 +-
.../orderby/item/ColumnOrderByItemConverter.java | 2 +-
.../orderby/item/IndexOrderByItemConverter.java | 2 +-
.../converter/type/CombineOperatorConverter.java | 2 +-
.../type/CombineOperatorConverterTest.java | 2 +-
.../TransactionBackendHandlerFactory.java | 2 +-
.../handler/transaction/TransactionSetHandler.java | 2 +-
.../proxy/backend/session/ConnectionSession.java | 2 +-
.../proxy/backend/util/TransactionUtil.java | 2 +-
.../extended/parse/PostgreSQLComParseExecutor.java | 2 +-
.../statement/impl/MySQLStatementSQLVisitor.java | 20 +++++------
.../impl/MySQLTCLStatementSQLVisitor.java | 6 ++--
.../impl/OpenGaussDDLStatementSQLVisitor.java | 2 +-
.../impl/OpenGaussStatementSQLVisitor.java | 36 +++++++++----------
.../impl/OracleDMLStatementSQLVisitor.java | 12 +++----
.../statement/impl/OracleStatementSQLVisitor.java | 22 ++++++------
.../impl/PostgreSQLDDLStatementSQLVisitor.java | 2 +-
.../impl/PostgreSQLStatementSQLVisitor.java | 36 +++++++++----------
.../impl/SQL92DMLStatementSQLVisitor.java | 2 +-
.../statement/impl/SQL92StatementSQLVisitor.java | 14 ++++----
.../impl/SQLServerStatementSQLVisitor.java | 18 +++++-----
.../impl/SQLServerTCLStatementSQLVisitor.java | 2 +-
.../{constant => enums}/AggregationType.java | 2 +-
.../common/{constant => enums}/CombineType.java | 2 +-
.../common/{constant => enums}/DirectionType.java | 2 +-
.../sql/common/{constant => enums}/JoinType.java | 2 +-
.../{constant => enums}/LogicalOperator.java | 2 +-
.../NullsOrderType.java} | 10 +++---
.../common/{constant => enums}/OperationScope.java | 2 +-
.../common/{constant => enums}/OrderDirection.java | 2 +-
.../{constant => enums}/ParameterMarkerType.java | 2 +-
.../sql/common/{constant => enums}/Paren.java | 2 +-
.../common/{constant => enums}/QuoteCharacter.java | 2 +-
.../common/{constant => enums}/SubqueryType.java | 2 +-
.../{constant => enums}/TransactionAccessType.java | 2 +-
.../TransactionIsolationLevel.java | 2 +-
.../segment/ddl/cursor/DirectionSegment.java | 2 +-
.../common/segment/dml/combine/CombineSegment.java | 2 +-
.../simple/ParameterMarkerExpressionSegment.java | 2 +-
.../segment/dml/expr/subquery/SubquerySegment.java | 2 +-
.../item/AggregationDistinctProjectionSegment.java | 2 +-
.../dml/item/AggregationProjectionSegment.java | 2 +-
.../dml/order/item/ColumnOrderByItemSegment.java | 8 ++---
.../order/item/ExpressionOrderByItemSegment.java | 12 +++----
.../dml/order/item/IndexOrderByItemSegment.java | 8 ++---
.../segment/dml/order/item/OrderByItemSegment.java | 6 ++--
.../dml/order/item/TextOrderByItemSegment.java | 8 ++---
.../statement/tcl/SetTransactionStatement.java | 6 ++--
.../sql/common/util/ExpressionExtractUtil.java | 2 +-
.../sql/parser/sql/common/util/SQLUtil.java | 2 +-
.../sql/common/util/SubqueryExtractUtil.java | 2 +-
.../common/value/identifier/IdentifierValue.java | 2 +-
.../parametermarker/ParameterMarkerValue.java | 2 +-
.../{constant => enums}/AggregationTypeTest.java | 2 +-
.../{constant => enums}/DirectionTypeTest.java | 2 +-
.../{constant => enums}/LogicalOperatorTest.java | 2 +-
.../sql/common/{constant => enums}/ParenTest.java | 2 +-
.../{constant => enums}/QuoteCharacterTest.java | 2 +-
.../sql/common/extractor/TableExtractorTest.java | 2 +-
.../sql/common/util/SubqueryExtractUtilTest.java | 4 +--
.../fixture/database/type/MockedDatabaseType.java | 2 +-
.../asserts/segment/orderby/OrderByItemAssert.java | 2 +-
.../internal/jaxb/sql/loader/SQLCasesLoader.java | 2 +-
126 files changed, 372 insertions(+), 372 deletions(-)
diff --git a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptIndexColumnTokenGenerator.java b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptIndexColumnTokenGenerator.java
index aed057b3d79..1f6fd2a23da 100644
--- a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptIndexColumnTokenGenerator.java
+++ b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptIndexColumnTokenGenerator.java
@@ -27,7 +27,7 @@ import org.apache.shardingsphere.infra.binder.type.IndexAvailable;
import org.apache.shardingsphere.infra.rewrite.sql.token.generator.CollectionSQLTokenGenerator;
import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.SQLToken;
import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.generic.SubstitutableColumnNameToken;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import java.util.Collection;
diff --git a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptProjectionTokenGenerator.java b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptProjectionTokenGenerator.java
index e191811c849..276a9b38123 100644
--- a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptProjectionTokenGenerator.java
+++ b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptProjectionTokenGenerator.java
@@ -35,7 +35,7 @@ import org.apache.shardingsphere.infra.rewrite.sql.token.generator.aware.Previou
import org.apache.shardingsphere.infra.rewrite.sql.token.generator.aware.SchemaMetaDataAware;
import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.SQLToken;
import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.generic.SubstitutableColumnNameToken;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.SubqueryType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.SubqueryType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ColumnProjectionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ShorthandProjectionSegment;
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptOrderByItemTokenGeneratorTest.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptOrderByItemTokenGeneratorTest.java
index 6c5ad05a174..db90b518bab 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptOrderByItemTokenGeneratorTest.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptOrderByItemTokenGeneratorTest.java
@@ -26,8 +26,8 @@ import org.apache.shardingsphere.infra.binder.segment.table.TablesContext;
import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.ColumnOrderByItemSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.AliasSegment;
@@ -70,7 +70,7 @@ public final class EncryptOrderByItemTokenGeneratorTest {
ColumnSegment columnSegment = new ColumnSegment(0, 0, new IdentifierValue("certificate_number"));
columnSegment.setOwner(new OwnerSegment(0, 0, new IdentifierValue("a")));
SelectStatementContext result = mock(SelectStatementContext.class, RETURNS_DEEP_STUBS);
- ColumnOrderByItemSegment columnOrderByItemSegment = new ColumnOrderByItemSegment(columnSegment, OrderDirection.ASC, NullsOrderDirection.FIRST);
+ ColumnOrderByItemSegment columnOrderByItemSegment = new ColumnOrderByItemSegment(columnSegment, OrderDirection.ASC, NullsOrderType.FIRST);
OrderByItem orderByItem = new OrderByItem(columnOrderByItemSegment);
when(result.getOrderByContext().getItems()).thenReturn(Collections.singletonList(orderByItem));
when(result.getGroupByContext().getItems()).thenReturn(Collections.emptyList());
diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/ddl/fetch/FetchStreamMergedResult.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/ddl/fetch/FetchStreamMergedResult.java
index 2edf9fe5a62..649866fc0d7 100644
--- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/ddl/fetch/FetchStreamMergedResult.java
+++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/ddl/fetch/FetchStreamMergedResult.java
@@ -30,7 +30,7 @@ import org.apache.shardingsphere.infra.merge.result.impl.stream.StreamMergedResu
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
import org.apache.shardingsphere.sharding.exception.connection.CursorNameNotFoundException;
import org.apache.shardingsphere.sharding.merge.dql.orderby.OrderByValue;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.DirectionType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.DirectionType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.cursor.DirectionSegment;
import java.sql.SQLException;
diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMerger.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMerger.java
index 0442e520ca4..925a98a6c83 100644
--- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMerger.java
+++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMerger.java
@@ -37,8 +37,8 @@ import org.apache.shardingsphere.sharding.merge.dql.orderby.OrderByStreamMergedR
import org.apache.shardingsphere.sharding.merge.dql.pagination.LimitDecoratorMergedResult;
import org.apache.shardingsphere.sharding.merge.dql.pagination.RowNumberDecoratorMergedResult;
import org.apache.shardingsphere.sharding.merge.dql.pagination.TopAndRowNumberDecoratorMergedResult;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.IndexOrderByItemSegment;
import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement;
import org.apache.shardingsphere.sql.parser.sql.common.util.SQLUtil;
@@ -112,15 +112,15 @@ public final class ShardingDQLResultMerger implements ResultMerger {
private void setGroupByForDistinctRow(final SelectStatementContext selectStatementContext) {
for (int index = 1; index <= selectStatementContext.getProjectionsContext().getExpandProjections().size(); index++) {
- OrderByItem orderByItem = new OrderByItem(new IndexOrderByItemSegment(-1, -1, index, OrderDirection.ASC, createDefaultNullsOrderDirection(selectStatementContext.getSqlStatement())));
+ OrderByItem orderByItem = new OrderByItem(new IndexOrderByItemSegment(-1, -1, index, OrderDirection.ASC, createDefaultNullsOrderType(selectStatementContext.getSqlStatement())));
orderByItem.setIndex(index);
selectStatementContext.getGroupByContext().getItems().add(orderByItem);
}
}
- private NullsOrderDirection createDefaultNullsOrderDirection(final SelectStatement selectStatement) {
- return selectStatement instanceof PostgreSQLStatement || selectStatement instanceof OpenGaussStatement || selectStatement instanceof OracleStatement ? NullsOrderDirection.LAST
- : NullsOrderDirection.FIRST;
+ private NullsOrderType createDefaultNullsOrderType(final SelectStatement selectStatement) {
+ return selectStatement instanceof PostgreSQLStatement || selectStatement instanceof OpenGaussStatement || selectStatement instanceof OracleStatement ? NullsOrderType.LAST
+ : NullsOrderType.FIRST;
}
private MergedResult getGroupByMergedResult(final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext,
diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResult.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResult.java
index e582485e102..852f73a0a3a 100644
--- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResult.java
+++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResult.java
@@ -33,7 +33,7 @@ import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.
import org.apache.shardingsphere.sharding.merge.dql.groupby.aggregation.AggregationUnit;
import org.apache.shardingsphere.sharding.merge.dql.groupby.aggregation.AggregationUnitFactory;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
import java.sql.SQLException;
diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparator.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparator.java
index a324906d338..a5842b22dae 100644
--- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparator.java
+++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparator.java
@@ -54,7 +54,7 @@ public final class GroupByRowComparator implements Comparator<MemoryQueryResultR
Object orderValue2 = o2.getCell(each.getIndex());
Preconditions.checkState(null == orderValue2 || orderValue2 instanceof Comparable, "Order by value must implements Comparable");
int result = CompareUtil.compareTo((Comparable) orderValue1, (Comparable) orderValue2, each.getSegment().getOrderDirection(),
- each.getSegment().getNullsOrderDirection(), valueCaseSensitive.get(each.getIndex()));
+ each.getSegment().getNullsOrderType(), valueCaseSensitive.get(each.getIndex()));
if (0 != result) {
return result;
}
diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/aggregation/AggregationUnitFactory.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/aggregation/AggregationUnitFactory.java
index 617fd74b24e..41ee0b144cf 100644
--- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/aggregation/AggregationUnitFactory.java
+++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/aggregation/AggregationUnitFactory.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.sharding.merge.dql.groupby.aggregation;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.infra.util.exception.external.sql.type.generic.UnsupportedSQLOperationException;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
/**
* Aggregation unit factory.
diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/CompareUtil.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/CompareUtil.java
index 636155317e5..8b3cd8a72fd 100644
--- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/CompareUtil.java
+++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/CompareUtil.java
@@ -19,8 +19,8 @@ package org.apache.shardingsphere.sharding.merge.dql.orderby;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
/**
* Compare util.
@@ -34,21 +34,21 @@ public final class CompareUtil {
* @param thisValue this value
* @param otherValue other value
* @param orderDirection order direction
- * @param nullsOrderDirection order direction for nulls value
+ * @param nullsOrderType order type for nulls value
* @param caseSensitive case sensitive
* @return compare result
*/
@SuppressWarnings({"unchecked", "rawtypes"})
- public static int compareTo(final Comparable thisValue, final Comparable otherValue, final OrderDirection orderDirection, final NullsOrderDirection nullsOrderDirection,
+ public static int compareTo(final Comparable thisValue, final Comparable otherValue, final OrderDirection orderDirection, final NullsOrderType nullsOrderType,
final boolean caseSensitive) {
if (null == thisValue && null == otherValue) {
return 0;
}
if (null == thisValue) {
- return NullsOrderDirection.FIRST.equals(nullsOrderDirection) ? -1 : 1;
+ return NullsOrderType.FIRST.equals(nullsOrderType) ? -1 : 1;
}
if (null == otherValue) {
- return NullsOrderDirection.FIRST.equals(nullsOrderDirection) ? 1 : -1;
+ return NullsOrderType.FIRST.equals(nullsOrderType) ? 1 : -1;
}
if (!caseSensitive && thisValue instanceof String && otherValue instanceof String) {
return compareToCaseInsensitiveString((String) thisValue, (String) otherValue, orderDirection);
diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValue.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValue.java
index 5e7a83e6095..e57e9a24520 100644
--- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValue.java
+++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValue.java
@@ -118,7 +118,7 @@ public final class OrderByValue implements Comparable<OrderByValue> {
int i = 0;
for (OrderByItem each : orderByItems) {
int result = CompareUtil.compareTo(orderValues.get(i), orderByValue.orderValues.get(i), each.getSegment().getOrderDirection(),
- each.getSegment().getNullsOrderDirection(), orderValuesCaseSensitive.get(i));
+ each.getSegment().getNullsOrderType(), orderValuesCaseSensitive.get(i));
if (0 != result) {
return result;
}
diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/FetchDirectionTokenGenerator.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/FetchDirectionTokenGenerator.java
index ee0174d6950..82f52d3c15d 100644
--- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/FetchDirectionTokenGenerator.java
+++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/FetchDirectionTokenGenerator.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.infra.rewrite.sql.token.generator.OptionalSQLTo
import org.apache.shardingsphere.infra.rewrite.sql.token.generator.aware.ConnectionContextAware;
import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.SQLToken;
import org.apache.shardingsphere.sharding.rewrite.token.pojo.FetchDirectionToken;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.DirectionType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.DirectionType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.cursor.CursorNameSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.cursor.DirectionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.FetchStatement;
diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ProjectionsTokenGenerator.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ProjectionsTokenGenerator.java
index 4f69ca08a7e..f97cee5c964 100644
--- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ProjectionsTokenGenerator.java
+++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/generator/impl/ProjectionsTokenGenerator.java
@@ -36,8 +36,8 @@ import org.apache.shardingsphere.infra.route.context.RouteMapper;
import org.apache.shardingsphere.infra.route.context.RouteUnit;
import org.apache.shardingsphere.sharding.rewrite.token.generator.IgnoreForSingleRoute;
import org.apache.shardingsphere.sharding.rewrite.token.pojo.ProjectionsToken;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.extractor.TableExtractor;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.ColumnOrderByItemSegment;
@@ -137,13 +137,13 @@ public final class ProjectionsTokenGenerator implements OptionalSQLTokenGenerato
IdentifierValue newOwnerIdentifier = new IdentifierValue(ownerSegment.get().getIdentifier().getQuoteCharacter().wrap(actualTableName.get()));
OwnerSegment newOwner = new OwnerSegment(0, 0, newOwnerIdentifier);
newColumnSegment.setOwner(newOwner);
- return new ColumnOrderByItemSegment(newColumnSegment, old.getOrderDirection(), generateNewNullsOrderDirection(databaseType, old.getOrderDirection()));
+ return new ColumnOrderByItemSegment(newColumnSegment, old.getOrderDirection(), generateNewNullsOrderType(databaseType, old.getOrderDirection()));
}
- private NullsOrderDirection generateNewNullsOrderDirection(final DatabaseType databaseType, final OrderDirection orderDirection) {
+ private NullsOrderType generateNewNullsOrderType(final DatabaseType databaseType, final OrderDirection orderDirection) {
if (databaseType instanceof PostgreSQLDatabaseType || databaseType instanceof OpenGaussDatabaseType || databaseType instanceof OracleDatabaseType) {
- return OrderDirection.ASC.equals(orderDirection) ? NullsOrderDirection.LAST : NullsOrderDirection.FIRST;
+ return OrderDirection.ASC.equals(orderDirection) ? NullsOrderType.LAST : NullsOrderType.FIRST;
}
- return OrderDirection.ASC.equals(orderDirection) ? NullsOrderDirection.FIRST : NullsOrderDirection.LAST;
+ return OrderDirection.ASC.equals(orderDirection) ? NullsOrderType.FIRST : NullsOrderType.LAST;
}
}
diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/FetchDirectionToken.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/FetchDirectionToken.java
index c840f597154..9f373af3e27 100644
--- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/FetchDirectionToken.java
+++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/FetchDirectionToken.java
@@ -21,7 +21,7 @@ import lombok.Getter;
import org.apache.shardingsphere.infra.context.ConnectionContext;
import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.SQLToken;
import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.Substitutable;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.DirectionType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.DirectionType;
/**
* Fetch direction token.
diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/OrderByToken.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/OrderByToken.java
index 13b24cdd164..6e1ca376862 100644
--- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/OrderByToken.java
+++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/OrderByToken.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.rewrite.token.pojo;
import lombok.Getter;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.Attachable;
import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.SQLToken;
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/ddl/fetch/FetchStreamMergedResultTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/ddl/fetch/FetchStreamMergedResultTest.java
index 8fd7c5cef9f..6e03fd59c1d 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/ddl/fetch/FetchStreamMergedResultTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/ddl/fetch/FetchStreamMergedResultTest.java
@@ -29,7 +29,7 @@ import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData;
import org.apache.shardingsphere.sharding.merge.ddl.ShardingDDLResultMerger;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.DirectionType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.DirectionType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.cursor.CursorNameSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.cursor.DirectionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionsSegment;
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMergerTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMergerTest.java
index 55427e4d096..038bda5c26a 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMergerTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMergerTest.java
@@ -39,9 +39,9 @@ import org.apache.shardingsphere.sharding.merge.dql.orderby.OrderByStreamMergedR
import org.apache.shardingsphere.sharding.merge.dql.pagination.LimitDecoratorMergedResult;
import org.apache.shardingsphere.sharding.merge.dql.pagination.RowNumberDecoratorMergedResult;
import org.apache.shardingsphere.sharding.merge.dql.pagination.TopAndRowNumberDecoratorMergedResult;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.LiteralExpressionSegment;
@@ -169,7 +169,7 @@ public final class ShardingDQLResultMergerTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
MySQLSelectStatement selectStatement = (MySQLSelectStatement) buildSelectStatement(new MySQLSelectStatement());
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
selectStatement, DefaultDatabase.LOGIC_NAME);
@@ -182,7 +182,7 @@ public final class ShardingDQLResultMergerTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
MySQLSelectStatement selectStatement = (MySQLSelectStatement) buildSelectStatement(new MySQLSelectStatement());
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
selectStatement.setLimit(new LimitSegment(0, 0, new NumberLiteralLimitValueSegment(0, 0, 1), null));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
@@ -213,7 +213,7 @@ public final class ShardingDQLResultMergerTest {
when(subquerySegment.getSelect()).thenReturn(subSelectStatement);
when(subqueryTableSegment.getSubquery()).thenReturn(subquerySegment);
OracleSelectStatement selectStatement = (OracleSelectStatement) buildSelectStatement(new OracleSelectStatement());
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
selectStatement.setFrom(subqueryTableSegment);
selectStatement.setWhere(whereSegment);
@@ -230,7 +230,7 @@ public final class ShardingDQLResultMergerTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
SQLServerSelectStatement selectStatement = (SQLServerSelectStatement) buildSelectStatement(new SQLServerSelectStatement());
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
selectStatement.setLimit(new LimitSegment(0, 0, new NumberLiteralRowNumberValueSegment(0, 0, 1, true), null));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
@@ -246,8 +246,8 @@ public final class ShardingDQLResultMergerTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
MySQLSelectStatement selectStatement = (MySQLSelectStatement) buildSelectStatement(new MySQLSelectStatement());
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
selectStatement, DefaultDatabase.LOGIC_NAME);
@@ -260,8 +260,8 @@ public final class ShardingDQLResultMergerTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
MySQLSelectStatement selectStatement = (MySQLSelectStatement) buildSelectStatement(new MySQLSelectStatement());
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
selectStatement.setLimit(new LimitSegment(0, 0, new NumberLiteralLimitValueSegment(0, 0, 1), null));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
@@ -292,8 +292,8 @@ public final class ShardingDQLResultMergerTest {
when(subquerySegment.getSelect()).thenReturn(subSelectStatement);
when(subqueryTableSegment.getSubquery()).thenReturn(subquerySegment);
OracleSelectStatement selectStatement = (OracleSelectStatement) buildSelectStatement(new OracleSelectStatement());
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
selectStatement.setFrom(subqueryTableSegment);
selectStatement.setWhere(whereSegment);
@@ -310,8 +310,8 @@ public final class ShardingDQLResultMergerTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
SQLServerSelectStatement selectStatement = (SQLServerSelectStatement) buildSelectStatement(new SQLServerSelectStatement());
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
selectStatement.setLimit(new LimitSegment(0, 0, new NumberLiteralRowNumberValueSegment(0, 0, 1, true), null));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
@@ -327,7 +327,7 @@ public final class ShardingDQLResultMergerTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
MySQLSelectStatement selectStatement = (MySQLSelectStatement) buildSelectStatement(new MySQLSelectStatement());
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
selectStatement, DefaultDatabase.LOGIC_NAME);
@@ -340,7 +340,7 @@ public final class ShardingDQLResultMergerTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
MySQLSelectStatement selectStatement = (MySQLSelectStatement) buildSelectStatement(new MySQLSelectStatement());
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
selectStatement.setLimit(new LimitSegment(0, 0, new NumberLiteralLimitValueSegment(0, 0, 1), null));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
@@ -371,8 +371,8 @@ public final class ShardingDQLResultMergerTest {
when(subquerySegment.getSelect()).thenReturn(subSelectStatement);
when(subqueryTableSegment.getSubquery()).thenReturn(subquerySegment);
OracleSelectStatement selectStatement = (OracleSelectStatement) buildSelectStatement(new OracleSelectStatement());
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
selectStatement.setFrom(subqueryTableSegment);
selectStatement.setWhere(whereSegment);
@@ -390,8 +390,8 @@ public final class ShardingDQLResultMergerTest {
SQLServerSelectStatement selectStatement = (SQLServerSelectStatement) buildSelectStatement(new SQLServerSelectStatement());
ProjectionsSegment projectionsSegment = new ProjectionsSegment(0, 0);
selectStatement.setProjections(projectionsSegment);
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST))));
selectStatement.setLimit(new LimitSegment(0, 0, new NumberLiteralRowNumberValueSegment(0, 0, 1, true), null));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
selectStatement, DefaultDatabase.LOGIC_NAME);
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java
index b50f7b1644c..1ce423d71f3 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java
@@ -30,9 +30,9 @@ import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRule
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereTable;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.AggregationProjectionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionsSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ShorthandProjectionSegment;
@@ -122,8 +122,8 @@ public final class GroupByMemoryMergedResultTest {
projectionsSegment.getProjections().add(new AggregationProjectionSegment(0, 0, AggregationType.COUNT, "(*)"));
projectionsSegment.getProjections().add(new AggregationProjectionSegment(0, 0, AggregationType.AVG, "(num)"));
selectStatement.setProjections(projectionsSegment);
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.ASC, NullsOrderDirection.FIRST))));
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.ASC, NullsOrderType.FIRST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(projectionsSegment);
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
@@ -136,7 +136,7 @@ public final class GroupByMemoryMergedResultTest {
projectionsSegment.setDistinctRow(true);
projectionsSegment.getProjections().add(new ShorthandProjectionSegment(0, 0));
selectStatement.setProjections(projectionsSegment);
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setFrom(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
selectStatement.setProjections(projectionsSegment);
return new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(), selectStatement, DefaultDatabase.LOGIC_NAME);
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparatorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparatorTest.java
index 679eab226d6..ccd64450e58 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparatorTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparatorTest.java
@@ -26,8 +26,8 @@ import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionsSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.GroupBySegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.OrderBySegment;
@@ -87,11 +87,11 @@ public final class GroupByRowComparatorTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
selectStatement.setGroupBy(new GroupBySegment(0, 0, Arrays.asList(
- new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST),
- new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST),
+ new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setOrderBy(new OrderBySegment(0, 0, Arrays.asList(
- new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST),
- new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderDirection.FIRST))));
+ new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST),
+ new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
selectStatement, DefaultDatabase.LOGIC_NAME);
@@ -130,11 +130,11 @@ public final class GroupByRowComparatorTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
selectStatement.setGroupBy(new GroupBySegment(0, 0, Arrays.asList(
- new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST),
- new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderDirection.FIRST))));
+ new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST),
+ new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderType.FIRST))));
selectStatement.setOrderBy(new OrderBySegment(0, 0, Arrays.asList(
- new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST),
- new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST),
+ new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
selectStatement, DefaultDatabase.LOGIC_NAME);
@@ -173,11 +173,11 @@ public final class GroupByRowComparatorTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
selectStatement.setGroupBy(new GroupBySegment(0, 0, Arrays.asList(
- new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST),
- new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderDirection.FIRST))));
+ new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST),
+ new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderType.FIRST))));
selectStatement.setOrderBy(new OrderBySegment(0, 0, Arrays.asList(
- new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST),
- new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST),
+ new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
selectStatement, DefaultDatabase.LOGIC_NAME);
@@ -216,8 +216,8 @@ public final class GroupByRowComparatorTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
selectStatement.setGroupBy(new GroupBySegment(0, 0, Arrays.asList(
- new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST),
- new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderDirection.FIRST))));
+ new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST),
+ new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderType.FIRST))));
selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.emptyList()));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
@@ -257,8 +257,8 @@ public final class GroupByRowComparatorTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
selectStatement.setGroupBy(new GroupBySegment(0, 0, Arrays.asList(
- new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST),
- new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST),
+ new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.emptyList()));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
@@ -302,8 +302,8 @@ public final class GroupByRowComparatorTest {
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
when(database.getSchema(DefaultDatabase.LOGIC_NAME)).thenReturn(mock(ShardingSphereSchema.class));
selectStatement.setGroupBy(new GroupBySegment(0, 0, Arrays.asList(
- new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST),
- new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST),
+ new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderType.FIRST))));
selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.emptyList()));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
SelectStatementContext selectStatementContext = new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(),
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResultTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResultTest.java
index 98d823ac419..8ab8e023f4b 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResultTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResultTest.java
@@ -32,9 +32,9 @@ import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereTable;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.AggregationProjectionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionsSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.GroupBySegment;
@@ -171,8 +171,8 @@ public final class GroupByStreamMergedResultTest {
projectionsSegment.getProjections().add(new AggregationProjectionSegment(0, 0, AggregationType.COUNT, "(*)"));
projectionsSegment.getProjections().add(new AggregationProjectionSegment(0, 0, AggregationType.AVG, "(num)"));
selectStatement.setProjections(projectionsSegment);
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.ASC, NullsOrderDirection.FIRST))));
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.ASC, NullsOrderDirection.FIRST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.ASC, NullsOrderType.FIRST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.ASC, NullsOrderType.FIRST))));
return new SelectStatementContext(createShardingSphereMetaData(database), Collections.emptyList(), selectStatement, DefaultDatabase.LOGIC_NAME);
}
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByValueTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByValueTest.java
index 0ada960130c..5a0ca123217 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByValueTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByValueTest.java
@@ -19,8 +19,8 @@ package org.apache.shardingsphere.sharding.merge.dql.groupby;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.binder.segment.select.orderby.OrderByItem;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.IndexOrderByItemSegment;
import org.junit.Before;
import org.junit.Test;
@@ -52,8 +52,8 @@ public final class GroupByValueTest {
@Test
public void assertGetGroupByValues() throws SQLException {
List<?> actual = new GroupByValue(queryResult, Arrays.asList(
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST)),
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.DESC, NullsOrderDirection.FIRST)))).getGroupValues();
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST)),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.DESC, NullsOrderType.FIRST)))).getGroupValues();
List<?> expected = Arrays.asList("1", "3");
assertThat(actual, is(expected));
}
@@ -61,11 +61,11 @@ public final class GroupByValueTest {
@Test
public void assertGroupByValueEquals() throws SQLException {
GroupByValue groupByValue1 = new GroupByValue(queryResult, Arrays.asList(
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST)),
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST)),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.DESC, NullsOrderType.FIRST))));
GroupByValue groupByValue2 = new GroupByValue(queryResult, Arrays.asList(
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST)),
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST)),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.DESC, NullsOrderType.FIRST))));
assertThat(groupByValue1, is(groupByValue2));
assertThat(groupByValue2, is(groupByValue1));
assertThat(groupByValue1.hashCode(), is(groupByValue2.hashCode()));
@@ -74,11 +74,11 @@ public final class GroupByValueTest {
@Test
public void assertGroupByValueNotEquals() throws SQLException {
GroupByValue groupByValue1 = new GroupByValue(queryResult, Arrays.asList(
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST)),
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST)),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.DESC, NullsOrderType.FIRST))));
GroupByValue groupByValue2 = new GroupByValue(queryResult, Arrays.asList(
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.ASC, NullsOrderDirection.FIRST)),
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST))));
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 3, OrderDirection.ASC, NullsOrderType.FIRST)),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST))));
assertThat(groupByValue1, not(groupByValue2));
assertThat(groupByValue1.hashCode(), not(groupByValue2.hashCode()));
}
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/aggregation/AggregationUnitFactoryTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/aggregation/AggregationUnitFactoryTest.java
index 230cde0d2c3..e4eadf9b9a4 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/aggregation/AggregationUnitFactoryTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/aggregation/AggregationUnitFactoryTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.sharding.merge.dql.groupby.aggregation;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.instanceOf;
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/CompareUtilTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/CompareUtilTest.java
index d2a28293592..b83ca06218f 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/CompareUtilTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/CompareUtilTest.java
@@ -17,8 +17,8 @@
package org.apache.shardingsphere.sharding.merge.dql.orderby;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
@@ -30,66 +30,66 @@ public final class CompareUtilTest {
@Test
public void assertCompareToWhenBothNull() {
- assertThat(CompareUtil.compareTo(null, null, OrderDirection.DESC, NullsOrderDirection.FIRST, caseSensitive), is(0));
+ assertThat(CompareUtil.compareTo(null, null, OrderDirection.DESC, NullsOrderType.FIRST, caseSensitive), is(0));
}
@Test
public void assertCompareToWhenFirstValueIsNullForOrderByAscAndNullsFirst() {
- assertThat(CompareUtil.compareTo(null, 1, OrderDirection.ASC, NullsOrderDirection.FIRST, caseSensitive), is(-1));
+ assertThat(CompareUtil.compareTo(null, 1, OrderDirection.ASC, NullsOrderType.FIRST, caseSensitive), is(-1));
}
@Test
public void assertCompareToWhenFirstValueIsNullForOrderByAscAndNullsLast() {
- assertThat(CompareUtil.compareTo(null, 1, OrderDirection.ASC, NullsOrderDirection.LAST, caseSensitive), is(1));
+ assertThat(CompareUtil.compareTo(null, 1, OrderDirection.ASC, NullsOrderType.LAST, caseSensitive), is(1));
}
@Test
public void assertCompareToWhenFirstValueIsNullForOrderByDescAndNullsFirst() {
- assertThat(CompareUtil.compareTo(null, 1, OrderDirection.DESC, NullsOrderDirection.FIRST, caseSensitive), is(-1));
+ assertThat(CompareUtil.compareTo(null, 1, OrderDirection.DESC, NullsOrderType.FIRST, caseSensitive), is(-1));
}
@Test
public void assertCompareToWhenFirstValueIsNullForOrderByDescAndNullsLast() {
- assertThat(CompareUtil.compareTo(null, 1, OrderDirection.DESC, NullsOrderDirection.LAST, caseSensitive), is(1));
+ assertThat(CompareUtil.compareTo(null, 1, OrderDirection.DESC, NullsOrderType.LAST, caseSensitive), is(1));
}
@Test
public void assertCompareToWhenSecondValueIsNullForOrderByAscAndNullsFirst() {
- assertThat(CompareUtil.compareTo(1, null, OrderDirection.ASC, NullsOrderDirection.FIRST, caseSensitive), is(1));
+ assertThat(CompareUtil.compareTo(1, null, OrderDirection.ASC, NullsOrderType.FIRST, caseSensitive), is(1));
}
@Test
public void assertCompareToWhenSecondValueIsNullForOrderByAscAndNullsLast() {
- assertThat(CompareUtil.compareTo(1, null, OrderDirection.ASC, NullsOrderDirection.LAST, caseSensitive), is(-1));
+ assertThat(CompareUtil.compareTo(1, null, OrderDirection.ASC, NullsOrderType.LAST, caseSensitive), is(-1));
}
@Test
public void assertCompareToWhenSecondValueIsNullForOrderByDescAndNullsFirst() {
- assertThat(CompareUtil.compareTo(1, null, OrderDirection.DESC, NullsOrderDirection.FIRST, caseSensitive), is(1));
+ assertThat(CompareUtil.compareTo(1, null, OrderDirection.DESC, NullsOrderType.FIRST, caseSensitive), is(1));
}
@Test
public void assertCompareToWhenSecondValueIsNullForOrderByDescAndNullsLast() {
- assertThat(CompareUtil.compareTo(1, null, OrderDirection.DESC, NullsOrderDirection.LAST, caseSensitive), is(-1));
+ assertThat(CompareUtil.compareTo(1, null, OrderDirection.DESC, NullsOrderType.LAST, caseSensitive), is(-1));
}
@Test
public void assertCompareToWhenAsc() {
- assertThat(CompareUtil.compareTo(1, 2, OrderDirection.ASC, NullsOrderDirection.FIRST, caseSensitive), is(-1));
+ assertThat(CompareUtil.compareTo(1, 2, OrderDirection.ASC, NullsOrderType.FIRST, caseSensitive), is(-1));
}
@Test
public void assertCompareToWhenDesc() {
- assertThat(CompareUtil.compareTo(1, 2, OrderDirection.DESC, NullsOrderDirection.FIRST, caseSensitive), is(1));
+ assertThat(CompareUtil.compareTo(1, 2, OrderDirection.DESC, NullsOrderType.FIRST, caseSensitive), is(1));
}
@Test
public void assetCompareToStringWithCaseSensitive() {
- assertThat(CompareUtil.compareTo("A", "a", OrderDirection.DESC, NullsOrderDirection.FIRST, caseSensitive), is(32));
+ assertThat(CompareUtil.compareTo("A", "a", OrderDirection.DESC, NullsOrderType.FIRST, caseSensitive), is(32));
}
@Test
public void assetCompareToStringWithCaseInsensitive() {
- assertThat(CompareUtil.compareTo("A", "a", OrderDirection.DESC, NullsOrderDirection.FIRST, !caseSensitive), is(0));
+ assertThat(CompareUtil.compareTo("A", "a", OrderDirection.DESC, NullsOrderType.FIRST, !caseSensitive), is(0));
}
}
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResultTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResultTest.java
index 8d6ad8bd164..91777c0de49 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResultTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResultTest.java
@@ -33,8 +33,8 @@ import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereTable;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionsSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.OrderBySegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.IndexOrderByItemSegment;
@@ -70,8 +70,8 @@ public final class OrderByStreamMergedResultTest {
ProjectionsSegment projectionsSegment = new ProjectionsSegment(0, 0);
selectStatement.setProjections(projectionsSegment);
selectStatement.setOrderBy(new OrderBySegment(0, 0, Arrays.asList(
- new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST),
- new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderDirection.FIRST))));
+ new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST),
+ new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderType.FIRST))));
selectStatement.setProjections(new ProjectionsSegment(0, 0));
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class);
selectStatementContext = new SelectStatementContext(
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValueTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValueTest.java
index 71343ecc7ab..3e1f5a46b5c 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValueTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValueTest.java
@@ -27,8 +27,8 @@ import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereTable;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionsSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.OrderBySegment;
@@ -94,16 +94,16 @@ public final class OrderByValueTest {
ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
QueryResult queryResult1 = createQueryResult("1", "2");
OrderByValue orderByValue1 = new OrderByValue(queryResult1, Arrays.asList(
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST)),
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderDirection.FIRST))),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST)),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderType.FIRST))),
selectStatementContext, schema);
MemberAccessor accessor = Plugins.getMemberAccessor();
accessor.set(OrderByValue.class.getDeclaredField("orderValuesCaseSensitive"), orderByValue1, Arrays.asList(false, false));
assertTrue(orderByValue1.next());
QueryResult queryResult2 = createQueryResult("3", "4");
OrderByValue orderByValue2 = new OrderByValue(queryResult2, Arrays.asList(
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST)),
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderDirection.FIRST))),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST)),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, NullsOrderType.FIRST))),
selectStatementContext, schema);
accessor.set(OrderByValue.class.getDeclaredField("orderValuesCaseSensitive"), orderByValue2, Arrays.asList(false, false));
assertTrue(orderByValue2.next());
@@ -152,16 +152,16 @@ public final class OrderByValueTest {
when(schema.getTable("table")).thenReturn(new ShardingSphereTable());
QueryResult queryResult1 = createQueryResult("1", "2");
OrderByValue orderByValue1 = new OrderByValue(queryResult1, Arrays.asList(
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST)),
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderDirection.FIRST))),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST)),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderType.FIRST))),
selectStatementContext, schema);
MemberAccessor accessor = Plugins.getMemberAccessor();
accessor.set(OrderByValue.class.getDeclaredField("orderValuesCaseSensitive"), orderByValue1, Arrays.asList(false, false));
assertTrue(orderByValue1.next());
QueryResult queryResult2 = createQueryResult("3", "4");
OrderByValue orderByValue2 = new OrderByValue(queryResult2, Arrays.asList(
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.FIRST)),
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderDirection.FIRST))),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.FIRST)),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderType.FIRST))),
selectStatementContext, schema);
accessor.set(OrderByValue.class.getDeclaredField("orderValuesCaseSensitive"), orderByValue2, Arrays.asList(false, false));
assertTrue(orderByValue2.next());
@@ -205,16 +205,16 @@ public final class OrderByValueTest {
ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
QueryResult queryResult1 = createQueryResult("1", "2");
OrderByValue orderByValue1 = new OrderByValue(queryResult1, Arrays.asList(
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST)),
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderDirection.FIRST))),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST)),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderType.FIRST))),
selectStatementContext, schema);
MemberAccessor accessor = Plugins.getMemberAccessor();
accessor.set(OrderByValue.class.getDeclaredField("orderValuesCaseSensitive"), orderByValue1, Arrays.asList(false, false));
assertTrue(orderByValue1.next());
QueryResult queryResult2 = createQueryResult("1", "2");
OrderByValue orderByValue2 = new OrderByValue(queryResult2, Arrays.asList(
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST)),
- createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderDirection.FIRST))),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST)),
+ createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, NullsOrderType.FIRST))),
selectStatementContext, schema);
accessor.set(OrderByValue.class.getDeclaredField("orderValuesCaseSensitive"), orderByValue2, Arrays.asList(false, false));
assertTrue(orderByValue2.next());
@@ -239,7 +239,7 @@ public final class OrderByValueTest {
}
private OrderBySegment createOrderBySegment() {
- OrderByItemSegment orderByItemSegment = new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("id")), OrderDirection.ASC, NullsOrderDirection.FIRST);
+ OrderByItemSegment orderByItemSegment = new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("id")), OrderDirection.ASC, NullsOrderType.FIRST);
return new OrderBySegment(0, 0, Collections.singletonList(orderByItemSegment));
}
}
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OrderByTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OrderByTokenGeneratorTest.java
index 9e24db8961d..a980900b63e 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OrderByTokenGeneratorTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OrderByTokenGeneratorTest.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementConte
import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext;
import org.apache.shardingsphere.sharding.rewrite.token.generator.impl.OrderByTokenGenerator;
import org.apache.shardingsphere.sharding.rewrite.token.pojo.OrderByToken;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.ColumnOrderByItemSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.ExpressionOrderByItemSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.OrderByItemSegment;
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ProjectionsTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ProjectionsTokenGeneratorTest.java
index cd67956805e..7f5fdd1e75e 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ProjectionsTokenGeneratorTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ProjectionsTokenGeneratorTest.java
@@ -28,7 +28,7 @@ import org.apache.shardingsphere.infra.route.context.RouteMapper;
import org.apache.shardingsphere.infra.route.context.RouteUnit;
import org.apache.shardingsphere.sharding.rewrite.token.generator.impl.ProjectionsTokenGenerator;
import org.apache.shardingsphere.sharding.rewrite.token.pojo.ProjectionsToken;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.ColumnOrderByItemSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.OwnerSegment;
import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue;
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingRemoveTokenGeneratorTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingRemoveTokenGeneratorTest.java
index 7a093152418..7cc59b6cc7a 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingRemoveTokenGeneratorTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingRemoveTokenGeneratorTest.java
@@ -27,9 +27,9 @@ import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRule
import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.SQLToken;
import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.generic.RemoveToken;
import org.apache.shardingsphere.sharding.rewrite.token.generator.impl.ShardingRemoveTokenGenerator;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.AggregationDistinctProjectionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionsSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.GroupBySegment;
@@ -82,7 +82,7 @@ public final class ShardingRemoveTokenGeneratorTest {
private SelectStatementContext createUpdatesStatementContext() {
MySQLSelectStatement selectStatement = new MySQLSelectStatement();
selectStatement.setFrom(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_user"))));
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.FIRST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.FIRST))));
selectStatement.setProjections(createProjectionsSegment());
return new SelectStatementContext(
createShardingSphereMetaData(mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS)), Collections.emptyList(), selectStatement, DefaultDatabase.LOGIC_NAME);
diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/OrderByTokenTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/OrderByTokenTest.java
index 8eebe65a208..2f7cfe2223a 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/OrderByTokenTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/OrderByTokenTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.sharding.rewrite.token.pojo;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.junit.Before;
import org.junit.Test;
diff --git a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/orderby/engine/OrderByContextEngine.java b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/orderby/engine/OrderByContextEngine.java
index 642d4f087d0..25fd9ae7a4c 100644
--- a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/orderby/engine/OrderByContextEngine.java
+++ b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/orderby/engine/OrderByContextEngine.java
@@ -20,8 +20,8 @@ package org.apache.shardingsphere.infra.binder.segment.select.orderby.engine;
import org.apache.shardingsphere.infra.binder.segment.select.groupby.GroupByContext;
import org.apache.shardingsphere.infra.binder.segment.select.orderby.OrderByContext;
import org.apache.shardingsphere.infra.binder.segment.select.orderby.OrderByItem;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ColumnProjectionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.ColumnOrderByItemSegment;
@@ -71,7 +71,7 @@ public final class OrderByContextEngine {
if (projectionSegment instanceof ColumnProjectionSegment) {
ColumnProjectionSegment columnProjectionSegment = (ColumnProjectionSegment) projectionSegment;
ColumnOrderByItemSegment columnOrderByItemSegment =
- new ColumnOrderByItemSegment(columnProjectionSegment.getColumn(), OrderDirection.ASC, createDefaultNullsOrderDirection(selectStatement));
+ new ColumnOrderByItemSegment(columnProjectionSegment.getColumn(), OrderDirection.ASC, createDefaultNullsOrderType(selectStatement));
OrderByItem item = new OrderByItem(columnOrderByItemSegment);
item.setIndex(index++);
orderByItems.add(item);
@@ -84,8 +84,8 @@ public final class OrderByContextEngine {
return null;
}
- private NullsOrderDirection createDefaultNullsOrderDirection(final SelectStatement selectStatement) {
- return selectStatement instanceof PostgreSQLStatement || selectStatement instanceof OpenGaussStatement || selectStatement instanceof OracleStatement ? NullsOrderDirection.LAST
- : NullsOrderDirection.FIRST;
+ private NullsOrderType createDefaultNullsOrderType(final SelectStatement selectStatement) {
+ return selectStatement instanceof PostgreSQLStatement || selectStatement instanceof OpenGaussStatement || selectStatement instanceof OracleStatement ? NullsOrderType.LAST
+ : NullsOrderType.FIRST;
}
}
diff --git a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngine.java b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngine.java
index ce61e1aee6b..8f144f0d97e 100644
--- a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngine.java
+++ b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngine.java
@@ -32,7 +32,7 @@ import org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine;
import org.apache.shardingsphere.infra.exception.SchemaNotFoundException;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.ParameterMarkerExpressionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.AggregationDistinctProjectionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.AggregationProjectionSegment;
diff --git a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationDistinctProjection.java b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationDistinctProjection.java
index 07f774636f0..ca09a4e6b8b 100644
--- a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationDistinctProjection.java
+++ b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationDistinctProjection.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.binder.segment.select.projection.impl;
import lombok.Getter;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
/**
* Aggregation distinct projection.
diff --git a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationProjection.java b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationProjection.java
index 2f2d4f89b85..4c9d4778f7e 100644
--- a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationProjection.java
+++ b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationProjection.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.infra.binder.segment.select.projection.Projecti
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.database.type.dialect.OpenGaussDatabaseType;
import org.apache.shardingsphere.infra.database.type.dialect.PostgreSQLDatabaseType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
import java.util.ArrayList;
import java.util.List;
diff --git a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/ParameterMarkerProjection.java b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/ParameterMarkerProjection.java
index 8f7a16bd84e..7b695d106a8 100644
--- a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/ParameterMarkerProjection.java
+++ b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/ParameterMarkerProjection.java
@@ -22,7 +22,7 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import org.apache.shardingsphere.infra.binder.segment.select.projection.Projection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import java.util.Optional;
diff --git a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/SelectStatementContext.java b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/SelectStatementContext.java
index fda4c843521..2d66c42c894 100644
--- a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/SelectStatementContext.java
+++ b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/SelectStatementContext.java
@@ -45,8 +45,8 @@ import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.SubqueryType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.SubqueryType;
import org.apache.shardingsphere.sql.parser.sql.common.extractor.TableExtractor;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment;
diff --git a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/groupby/engine/GroupByContextEngineTest.java b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/groupby/engine/GroupByContextEngineTest.java
index 95dd41ff875..d2e74f8f6b2 100644
--- a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/groupby/engine/GroupByContextEngineTest.java
+++ b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/groupby/engine/GroupByContextEngineTest.java
@@ -19,8 +19,8 @@ package org.apache.shardingsphere.infra.binder.segment.select.groupby.engine;
import org.apache.shardingsphere.infra.binder.segment.select.groupby.GroupByContext;
import org.apache.shardingsphere.infra.binder.segment.select.orderby.OrderByItem;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.GroupBySegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.ColumnOrderByItemSegment;
@@ -99,9 +99,9 @@ public final class GroupByContextEngineTest {
}
private void assertCreateGroupByContextWithGroupBy(final SelectStatement selectStatement) {
- OrderByItemSegment columnOrderByItemSegment = new ColumnOrderByItemSegment(new ColumnSegment(0, 1, new IdentifierValue("column1")), OrderDirection.ASC, NullsOrderDirection.LAST);
- OrderByItemSegment indexOrderByItemSegment1 = new IndexOrderByItemSegment(1, 2, 2, OrderDirection.ASC, NullsOrderDirection.LAST);
- OrderByItemSegment indexOrderByItemSegment2 = new IndexOrderByItemSegment(2, 3, 3, OrderDirection.ASC, NullsOrderDirection.LAST);
+ OrderByItemSegment columnOrderByItemSegment = new ColumnOrderByItemSegment(new ColumnSegment(0, 1, new IdentifierValue("column1")), OrderDirection.ASC, NullsOrderType.LAST);
+ OrderByItemSegment indexOrderByItemSegment1 = new IndexOrderByItemSegment(1, 2, 2, OrderDirection.ASC, NullsOrderType.LAST);
+ OrderByItemSegment indexOrderByItemSegment2 = new IndexOrderByItemSegment(2, 3, 3, OrderDirection.ASC, NullsOrderType.LAST);
GroupBySegment groupBySegment = new GroupBySegment(0, 10, Arrays.asList(columnOrderByItemSegment, indexOrderByItemSegment1, indexOrderByItemSegment2));
selectStatement.setGroupBy(groupBySegment);
GroupByContext actualGroupByContext = new GroupByContextEngine().createGroupByContext(selectStatement);
diff --git a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/orderby/engine/OrderByContextEngineTest.java b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/orderby/engine/OrderByContextEngineTest.java
index 06e8691fa79..dae8bedcb4e 100644
--- a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/orderby/engine/OrderByContextEngineTest.java
+++ b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/orderby/engine/OrderByContextEngineTest.java
@@ -20,8 +20,8 @@ package org.apache.shardingsphere.infra.binder.segment.select.orderby.engine;
import org.apache.shardingsphere.infra.binder.segment.select.groupby.GroupByContext;
import org.apache.shardingsphere.infra.binder.segment.select.orderby.OrderByContext;
import org.apache.shardingsphere.infra.binder.segment.select.orderby.OrderByItem;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ColumnProjectionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionSegment;
@@ -77,8 +77,8 @@ public final class OrderByContextEngineTest {
}
private void assertCreateOrderByWithoutOrderBy(final SelectStatement selectStatement) {
- OrderByItem orderByItem1 = new OrderByItem(new IndexOrderByItemSegment(0, 1, 1, OrderDirection.ASC, NullsOrderDirection.LAST));
- OrderByItem orderByItem2 = new OrderByItem(new IndexOrderByItemSegment(1, 2, 2, OrderDirection.ASC, NullsOrderDirection.LAST));
+ OrderByItem orderByItem1 = new OrderByItem(new IndexOrderByItemSegment(0, 1, 1, OrderDirection.ASC, NullsOrderType.LAST));
+ OrderByItem orderByItem2 = new OrderByItem(new IndexOrderByItemSegment(1, 2, 2, OrderDirection.ASC, NullsOrderType.LAST));
Collection<OrderByItem> orderByItems = Arrays.asList(orderByItem1, orderByItem2);
GroupByContext groupByContext = new GroupByContext(orderByItems);
OrderByContext actualOrderByContext = new OrderByContextEngine().createOrderBy(selectStatement, groupByContext);
@@ -112,9 +112,9 @@ public final class OrderByContextEngineTest {
}
private void assertCreateOrderByWithOrderBy(final SelectStatement selectStatement) {
- OrderByItemSegment columnOrderByItemSegment = new ColumnOrderByItemSegment(new ColumnSegment(0, 1, new IdentifierValue("column1")), OrderDirection.ASC, NullsOrderDirection.FIRST);
- OrderByItemSegment indexOrderByItemSegment1 = new IndexOrderByItemSegment(1, 2, 2, OrderDirection.ASC, NullsOrderDirection.LAST);
- OrderByItemSegment indexOrderByItemSegment2 = new IndexOrderByItemSegment(2, 3, 3, OrderDirection.ASC, NullsOrderDirection.LAST);
+ OrderByItemSegment columnOrderByItemSegment = new ColumnOrderByItemSegment(new ColumnSegment(0, 1, new IdentifierValue("column1")), OrderDirection.ASC, NullsOrderType.FIRST);
+ OrderByItemSegment indexOrderByItemSegment1 = new IndexOrderByItemSegment(1, 2, 2, OrderDirection.ASC, NullsOrderType.LAST);
+ OrderByItemSegment indexOrderByItemSegment2 = new IndexOrderByItemSegment(2, 3, 3, OrderDirection.ASC, NullsOrderType.LAST);
OrderBySegment orderBySegment = new OrderBySegment(0, 1, Arrays.asList(columnOrderByItemSegment, indexOrderByItemSegment1, indexOrderByItemSegment2));
selectStatement.setOrderBy(orderBySegment);
GroupByContext emptyGroupByContext = new GroupByContext(Collections.emptyList());
diff --git a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/pagination/PaginationContextTest.java b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/pagination/PaginationContextTest.java
index 0194230cde8..be5d17c4c74 100644
--- a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/pagination/PaginationContextTest.java
+++ b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/pagination/PaginationContextTest.java
@@ -23,8 +23,8 @@ import org.apache.shardingsphere.infra.database.DefaultDatabase;
import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionsSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.GroupBySegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.OrderBySegment;
@@ -198,8 +198,8 @@ public final class PaginationContextTest {
private void getRevisedRowCountWithMax(final SelectStatement selectStatement) {
selectStatement.setProjections(new ProjectionsSegment(0, 0));
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.LAST))));
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.LAST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.LAST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.LAST))));
Map<String, ShardingSphereDatabase> databases = Collections.singletonMap(DefaultDatabase.LOGIC_NAME, mock(ShardingSphereDatabase.class));
ShardingSphereMetaData metaData = new ShardingSphereMetaData(databases, mock(ShardingSphereRuleMetaData.class), mock(ConfigurationProperties.class));
SelectStatementContext selectStatementContext = new SelectStatementContext(metaData, Collections.emptyList(), selectStatement, DefaultDatabase.LOGIC_NAME);
diff --git a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/ProjectionsContextTest.java b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/ProjectionsContextTest.java
index 7c398e00978..b6ddac37442 100644
--- a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/ProjectionsContextTest.java
+++ b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/ProjectionsContextTest.java
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.infra.binder.segment.select.projection.impl.Der
import org.apache.shardingsphere.infra.binder.segment.select.projection.impl.ExpressionProjection;
import org.apache.shardingsphere.infra.binder.segment.select.projection.impl.ShorthandProjection;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
import org.junit.Test;
import java.util.Arrays;
diff --git a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngineTest.java b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngineTest.java
index 84cbdd51a2a..e63bacd51f4 100644
--- a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngineTest.java
+++ b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngineTest.java
@@ -28,7 +28,7 @@ import org.apache.shardingsphere.infra.database.DefaultDatabase;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.exception.SchemaNotFoundException;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.CommonExpressionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.ParameterMarkerExpressionSegment;
diff --git a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionsContextEngineTest.java b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionsContextEngineTest.java
index b17520c99e3..f34b6edaacb 100644
--- a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionsContextEngineTest.java
+++ b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionsContextEngineTest.java
@@ -28,8 +28,8 @@ import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubquerySegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ColumnProjectionSegment;
@@ -178,7 +178,7 @@ public final class ProjectionsContextEngineTest {
OwnerSegment owner = new OwnerSegment(0, 10, new IdentifierValue("name"));
shorthandProjectionSegment.setOwner(owner);
projectionsSegment.getProjections().add(shorthandProjectionSegment);
- OrderByItem orderByItem = new OrderByItem(new IndexOrderByItemSegment(0, 1, 0, OrderDirection.ASC, NullsOrderDirection.FIRST));
+ OrderByItem orderByItem = new OrderByItem(new IndexOrderByItemSegment(0, 1, 0, OrderDirection.ASC, NullsOrderType.FIRST));
OrderByContext orderByContext = new OrderByContext(Collections.singletonList(orderByItem), true);
SelectStatementContext selectStatementContext = createSelectStatementContext(selectStatement);
ProjectionsContextEngine engine = new ProjectionsContextEngine(DefaultDatabase.LOGIC_NAME, mockSchemas(), selectStatementContext.getDatabaseType());
@@ -218,7 +218,7 @@ public final class ProjectionsContextEngineTest {
OwnerSegment owner = new OwnerSegment(0, 10, new IdentifierValue("name"));
shorthandProjectionSegment.setOwner(owner);
projectionsSegment.getProjections().add(shorthandProjectionSegment);
- OrderByItem orderByItem = new OrderByItem(new ExpressionOrderByItemSegment(0, 1, "", OrderDirection.ASC, NullsOrderDirection.FIRST));
+ OrderByItem orderByItem = new OrderByItem(new ExpressionOrderByItemSegment(0, 1, "", OrderDirection.ASC, NullsOrderType.FIRST));
OrderByContext orderByContext = new OrderByContext(Collections.singletonList(orderByItem), true);
SelectStatementContext selectStatementContext = createSelectStatementContext(selectStatement);
ProjectionsContextEngine engine = new ProjectionsContextEngine(DefaultDatabase.LOGIC_NAME, mockSchemas(), selectStatementContext.getDatabaseType());
@@ -274,7 +274,7 @@ public final class ProjectionsContextEngineTest {
OwnerSegment owner = new OwnerSegment(0, 10, new IdentifierValue("name"));
shorthandProjectionSegment.setOwner(owner);
projectionsSegment.getProjections().add(shorthandProjectionSegment);
- OrderByItem orderByItem = new OrderByItem(new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("name")), OrderDirection.ASC, NullsOrderDirection.FIRST));
+ OrderByItem orderByItem = new OrderByItem(new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("name")), OrderDirection.ASC, NullsOrderType.FIRST));
OrderByContext orderByContext = new OrderByContext(Collections.singletonList(orderByItem), true);
SelectStatementContext selectStatementContext = createSelectStatementContext(selectStatement);
ProjectionsContextEngine engine = new ProjectionsContextEngine(DefaultDatabase.LOGIC_NAME, mockSchemas(), selectStatementContext.getDatabaseType());
@@ -315,7 +315,7 @@ public final class ProjectionsContextEngineTest {
OwnerSegment owner = new OwnerSegment(0, 10, new IdentifierValue("name"));
shorthandProjectionSegment.setOwner(owner);
projectionsSegment.getProjections().add(shorthandProjectionSegment);
- OrderByItem orderByItem = new OrderByItem(new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("name")), OrderDirection.ASC, NullsOrderDirection.FIRST));
+ OrderByItem orderByItem = new OrderByItem(new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("name")), OrderDirection.ASC, NullsOrderType.FIRST));
OrderByContext orderByContext = new OrderByContext(Collections.singletonList(orderByItem), true);
SelectStatementContext selectStatementContext = createSelectStatementContext(selectStatement);
ProjectionsContextEngine engine = new ProjectionsContextEngine(DefaultDatabase.LOGIC_NAME, mockSchemas(), selectStatementContext.getDatabaseType());
@@ -364,7 +364,7 @@ public final class ProjectionsContextEngineTest {
ColumnProjectionSegment columnProjectionSegment = new ColumnProjectionSegment(columnSegment);
columnProjectionSegment.getColumn().setOwner(owner);
projectionsSegment.getProjections().addAll(Arrays.asList(columnProjectionSegment, shorthandProjectionSegment));
- OrderByItem orderByItem = new OrderByItem(new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("name")), OrderDirection.ASC, NullsOrderDirection.FIRST));
+ OrderByItem orderByItem = new OrderByItem(new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("name")), OrderDirection.ASC, NullsOrderType.FIRST));
OrderByContext orderByContext = new OrderByContext(Collections.singleton(orderByItem), false);
SelectStatementContext selectStatementContext = createSelectStatementContext(selectStatement);
ProjectionsContextEngine engine = new ProjectionsContextEngine(DefaultDatabase.LOGIC_NAME, mockSchemas(), selectStatementContext.getDatabaseType());
@@ -409,7 +409,7 @@ public final class ProjectionsContextEngineTest {
selectStatement.setFrom(subqueryTableSegment);
ColumnSegment columnSegment = new ColumnSegment(0, 0, new IdentifierValue("name"));
columnSegment.setOwner(new OwnerSegment(0, 0, new IdentifierValue("d")));
- OrderByItem groupByItem = new OrderByItem(new ColumnOrderByItemSegment(columnSegment, OrderDirection.ASC, NullsOrderDirection.FIRST));
+ OrderByItem groupByItem = new OrderByItem(new ColumnOrderByItemSegment(columnSegment, OrderDirection.ASC, NullsOrderType.FIRST));
GroupByContext groupByContext = new GroupByContext(Collections.singleton(groupByItem));
SelectStatementContext selectStatementContext = createSelectStatementContext(selectStatement);
ProjectionsContextEngine engine = new ProjectionsContextEngine(DefaultDatabase.LOGIC_NAME, mockSchemas(), selectStatementContext.getDatabaseType());
@@ -454,7 +454,7 @@ public final class ProjectionsContextEngineTest {
selectStatement.setFrom(subqueryTableSegment);
ColumnSegment columnSegment = new ColumnSegment(0, 0, new IdentifierValue("name"));
columnSegment.setOwner(new OwnerSegment(0, 0, new IdentifierValue("TAble")));
- OrderByItem groupByItem = new OrderByItem(new ColumnOrderByItemSegment(columnSegment, OrderDirection.ASC, NullsOrderDirection.FIRST));
+ OrderByItem groupByItem = new OrderByItem(new ColumnOrderByItemSegment(columnSegment, OrderDirection.ASC, NullsOrderType.FIRST));
GroupByContext groupByContext = new GroupByContext(Collections.singleton(groupByItem));
SelectStatementContext selectStatementContext = createSelectStatementContext(selectStatement);
ProjectionsContextEngine engine = new ProjectionsContextEngine(DefaultDatabase.LOGIC_NAME, mockSchemas(), selectStatementContext.getDatabaseType());
@@ -469,7 +469,7 @@ public final class ProjectionsContextEngineTest {
projectionsSegment.getProjections().add(new ShorthandProjectionSegment(0, 0));
selectStatement.setProjections(projectionsSegment);
selectStatement.setFrom(new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_order"))));
- OrderByItem orderByItem = new OrderByItem(new ExpressionOrderByItemSegment(0, 0, "id + 1", OrderDirection.ASC, NullsOrderDirection.FIRST));
+ OrderByItem orderByItem = new OrderByItem(new ExpressionOrderByItemSegment(0, 0, "id + 1", OrderDirection.ASC, NullsOrderType.FIRST));
OrderByContext orderByContext = new OrderByContext(Collections.singleton(orderByItem), false);
SelectStatementContext selectStatementContext = createSelectStatementContext(selectStatement);
ProjectionsContextEngine engine = new ProjectionsContextEngine(DefaultDatabase.LOGIC_NAME, mockSchemas(), selectStatementContext.getDatabaseType());
diff --git a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationDistinctProjectionTest.java b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationDistinctProjectionTest.java
index dd0aab77a80..ff664c4ec45 100644
--- a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationDistinctProjectionTest.java
+++ b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationDistinctProjectionTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.binder.segment.select.projection.impl;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
diff --git a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationProjectionTest.java b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationProjectionTest.java
index 640ddfefb40..d96f9b7fa3b 100644
--- a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationProjectionTest.java
+++ b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationProjectionTest.java
@@ -21,7 +21,7 @@ import org.apache.shardingsphere.infra.binder.segment.select.projection.Projecti
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.database.type.dialect.OpenGaussDatabaseType;
import org.apache.shardingsphere.infra.database.type.dialect.PostgreSQLDatabaseType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
import org.junit.Test;
import java.util.Optional;
diff --git a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/impl/SelectStatementContextTest.java b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/impl/SelectStatementContextTest.java
index 61ed7cbd8d0..e452b8f5d95 100644
--- a/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/impl/SelectStatementContextTest.java
+++ b/infra/binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/impl/SelectStatementContextTest.java
@@ -23,10 +23,10 @@ import org.apache.shardingsphere.infra.database.DefaultDatabase;
import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.rule.ShardingSphereRuleMetaData;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.LiteralExpressionSegment;
@@ -247,8 +247,8 @@ public final class SelectStatementContextTest {
private void assertIsSameGroupByAndOrderByItems(final SelectStatement selectStatement) {
selectStatement.setProjections(new ProjectionsSegment(0, 0));
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.LAST))));
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.LAST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.LAST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.LAST))));
SelectStatementContext selectStatementContext = createSelectStatementContext(selectStatement);
assertTrue(selectStatementContext.isSameGroupByAndOrderByItems());
}
@@ -317,8 +317,8 @@ public final class SelectStatementContextTest {
private void assertIsNotSameGroupByAndOrderByItemsWhenDifferentGroupByAndOrderBy(final SelectStatement selectStatement) {
selectStatement.setProjections(new ProjectionsSegment(0, 0));
- selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderDirection.LAST))));
- selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderDirection.LAST))));
+ selectStatement.setGroupBy(new GroupBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, NullsOrderType.LAST))));
+ selectStatement.setOrderBy(new OrderBySegment(0, 0, Collections.singletonList(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, NullsOrderType.LAST))));
SelectStatementContext selectStatementContext = createSelectStatementContext(selectStatement);
assertFalse(selectStatementContext.isSameGroupByAndOrderByItems());
}
@@ -574,15 +574,15 @@ public final class SelectStatementContextTest {
private OrderByItemSegment createOrderByItemSegment(final String type) {
switch (type) {
case INDEX_ORDER_BY:
- return new IndexOrderByItemSegment(0, 0, 4, OrderDirection.ASC, NullsOrderDirection.FIRST);
+ return new IndexOrderByItemSegment(0, 0, 4, OrderDirection.ASC, NullsOrderType.FIRST);
case COLUMN_ORDER_BY_WITH_OWNER:
ColumnSegment columnSegment = new ColumnSegment(0, 0, new IdentifierValue("name"));
columnSegment.setOwner(new OwnerSegment(0, 0, new IdentifierValue("table")));
- return new ColumnOrderByItemSegment(columnSegment, OrderDirection.ASC, NullsOrderDirection.FIRST);
+ return new ColumnOrderByItemSegment(columnSegment, OrderDirection.ASC, NullsOrderType.FIRST);
case COLUMN_ORDER_BY_WITH_ALIAS:
- return new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("n")), OrderDirection.ASC, NullsOrderDirection.FIRST);
+ return new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("n")), OrderDirection.ASC, NullsOrderType.FIRST);
default:
- return new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("id")), OrderDirection.ASC, NullsOrderDirection.FIRST);
+ return new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("id")), OrderDirection.ASC, NullsOrderType.FIRST);
}
}
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseType.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseType.java
index f780576c61b..e0c6e101198 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseType.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseType.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.infra.database.type;
import org.apache.shardingsphere.infra.database.metadata.DataSourceMetaData;
import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
import java.sql.Connection;
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/H2DatabaseType.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/H2DatabaseType.java
index 9b76049060d..321b432538f 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/H2DatabaseType.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/H2DatabaseType.java
@@ -21,7 +21,7 @@ import org.apache.shardingsphere.infra.database.metadata.dialect.H2DataSourceMet
import org.apache.shardingsphere.infra.database.type.BranchDatabaseType;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeFactory;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import java.util.Collection;
import java.util.Collections;
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/MariaDBDatabaseType.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/MariaDBDatabaseType.java
index 284a031d479..2e544ece84b 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/MariaDBDatabaseType.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/MariaDBDatabaseType.java
@@ -21,7 +21,7 @@ import org.apache.shardingsphere.infra.database.metadata.dialect.MariaDBDataSour
import org.apache.shardingsphere.infra.database.type.BranchDatabaseType;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeFactory;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import java.util.Collection;
import java.util.Collections;
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/MySQLDatabaseType.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/MySQLDatabaseType.java
index f1d10fd1a62..04c74de4514 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/MySQLDatabaseType.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/MySQLDatabaseType.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.MySQLDataSourceMetaData;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import java.util.Arrays;
import java.util.Collection;
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/OpenGaussDatabaseType.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/OpenGaussDatabaseType.java
index f461249d7b6..60d47b27050 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/OpenGaussDatabaseType.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/OpenGaussDatabaseType.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.OpenGaussDataSourceMetaData;
import org.apache.shardingsphere.infra.database.type.SchemaSupportedDatabaseType;
import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.CommitStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.RollbackStatement;
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/OracleDatabaseType.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/OracleDatabaseType.java
index 9c93ac6ecd9..5071f048f68 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/OracleDatabaseType.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/OracleDatabaseType.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.OracleDataSourceMetaData;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import java.sql.Connection;
import java.sql.SQLException;
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/PostgreSQLDatabaseType.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/PostgreSQLDatabaseType.java
index 4136f53cfb2..f2492c5ff8f 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/PostgreSQLDatabaseType.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/PostgreSQLDatabaseType.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.PostgreSQLDataSourceMetaData;
import org.apache.shardingsphere.infra.database.type.SchemaSupportedDatabaseType;
import org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.CommitStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.RollbackStatement;
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/SQL92DatabaseType.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/SQL92DatabaseType.java
index 24f7ac35f81..7c5bb811f19 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/SQL92DatabaseType.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/SQL92DatabaseType.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.SQL92DataSourceMetaData;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import java.util.Collection;
import java.util.Collections;
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/SQLServerDatabaseType.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/SQLServerDatabaseType.java
index 7bd0ff92503..de97eda90fc 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/SQLServerDatabaseType.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/SQLServerDatabaseType.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.SQLServerDataSourceMetaData;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import java.util.Arrays;
import java.util.Collection;
diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/H2DatabaseTypeTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/H2DatabaseTypeTest.java
index fd814977a18..4f4e552edf1 100644
--- a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/H2DatabaseTypeTest.java
+++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/H2DatabaseTypeTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.H2DataSourceMetaData;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import org.junit.Test;
import java.util.Collections;
diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/MariaDBDatabaseTypeTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/MariaDBDatabaseTypeTest.java
index 67efd52bb89..29fdf824652 100644
--- a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/MariaDBDatabaseTypeTest.java
+++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/MariaDBDatabaseTypeTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.MariaDBDataSourceMetaData;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import org.junit.Test;
import java.util.Collections;
diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/MySQLDatabaseTypeTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/MySQLDatabaseTypeTest.java
index 2501e9052f0..75542fca07b 100644
--- a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/MySQLDatabaseTypeTest.java
+++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/MySQLDatabaseTypeTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.MySQLDataSourceMetaData;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import org.junit.Test;
import java.util.Arrays;
diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/OracleDatabaseTypeTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/OracleDatabaseTypeTest.java
index 828043e6794..68ef44b95e4 100644
--- a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/OracleDatabaseTypeTest.java
+++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/OracleDatabaseTypeTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.OracleDataSourceMetaData;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import org.junit.Test;
import java.sql.Connection;
diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/PostgreSQLDatabaseTypeTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/PostgreSQLDatabaseTypeTest.java
index 56a59f6a00d..1446f025954 100644
--- a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/PostgreSQLDatabaseTypeTest.java
+++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/PostgreSQLDatabaseTypeTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.PostgreSQLDataSourceMetaData;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.CommitStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.RollbackStatement;
diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/SQL92DatabaseTypeTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/SQL92DatabaseTypeTest.java
index d213d649528..5384e0f26fe 100644
--- a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/SQL92DatabaseTypeTest.java
+++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/SQL92DatabaseTypeTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.SQL92DataSourceMetaData;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import org.junit.Test;
import java.util.Collections;
diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/SQLServerDatabaseTypeTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/SQLServerDatabaseTypeTest.java
index 24568c8662a..1311b9a5ff3 100644
--- a/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/SQLServerDatabaseTypeTest.java
+++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/database/type/dialect/SQLServerDatabaseTypeTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.SQLServerDataSourceMetaData;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import org.junit.Test;
import java.util.Arrays;
diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/fixture/InfraDatabaseTypeFixture.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/fixture/InfraDatabaseTypeFixture.java
index 0efbf27e2f2..bdc2bc3c1c4 100644
--- a/infra/common/src/test/java/org/apache/shardingsphere/infra/fixture/InfraDatabaseTypeFixture.java
+++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/fixture/InfraDatabaseTypeFixture.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.fixture;
import org.apache.shardingsphere.infra.database.metadata.DataSourceMetaData;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import java.util.Collection;
import java.util.Collections;
diff --git a/infra/rewrite/src/main/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/InsertValue.java b/infra/rewrite/src/main/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/InsertValue.java
index 2ba80ca37c0..9f28b9aa518 100644
--- a/infra/rewrite/src/main/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/InsertValue.java
+++ b/infra/rewrite/src/main/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/InsertValue.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.rewrite.sql.token.pojo.generic;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.ComplexExpressionSegment;
diff --git a/infra/rewrite/src/main/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameToken.java b/infra/rewrite/src/main/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameToken.java
index 4bd7d5ca214..29228601b68 100644
--- a/infra/rewrite/src/main/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameToken.java
+++ b/infra/rewrite/src/main/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameToken.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.SQLToken;
import org.apache.shardingsphere.infra.rewrite.sql.token.pojo.Substitutable;
import org.apache.shardingsphere.infra.route.context.RouteMapper;
import org.apache.shardingsphere.infra.route.context.RouteUnit;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import java.util.Collection;
import java.util.Collections;
diff --git a/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/InsertValueTest.java b/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/InsertValueTest.java
index 30bf75717ce..03fed89df2c 100644
--- a/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/InsertValueTest.java
+++ b/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/InsertValueTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.infra.rewrite.sql.token.pojo.generic;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.ComplexExpressionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.LiteralExpressionSegment;
diff --git a/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameTokenTest.java b/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameTokenTest.java
index fddcdc36743..1063281d320 100644
--- a/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameTokenTest.java
+++ b/infra/rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/SubstitutableColumnNameTokenTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.rewrite.sql.token.pojo.generic;
import org.apache.shardingsphere.infra.binder.segment.select.projection.impl.ColumnProjection;
import org.apache.shardingsphere.infra.route.context.RouteUnit;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import org.junit.Test;
import java.util.Collection;
diff --git a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/ColumnOrderByItemConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/ColumnOrderByItemConverter.java
index dc132e3c1d5..5e0ab1ba148 100644
--- a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/ColumnOrderByItemConverter.java
+++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/ColumnOrderByItemConverter.java
@@ -23,7 +23,7 @@ import org.apache.calcite.sql.fun.SqlStdOperatorTable;
import org.apache.calcite.sql.parser.SqlParserPos;
import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter;
import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.ColumnConverter;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.ColumnOrderByItemSegment;
import java.util.Collections;
diff --git a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/IndexOrderByItemConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/IndexOrderByItemConverter.java
index 8aee1168751..f68a8e67952 100644
--- a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/IndexOrderByItemConverter.java
+++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/IndexOrderByItemConverter.java
@@ -23,7 +23,7 @@ import org.apache.calcite.sql.SqlNode;
import org.apache.calcite.sql.fun.SqlStdOperatorTable;
import org.apache.calcite.sql.parser.SqlParserPos;
import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.IndexOrderByItemSegment;
import java.util.Collections;
diff --git a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverter.java
index 0d8151fe2c8..44a76dfa3d7 100644
--- a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverter.java
+++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverter.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.sqlfederation.optimizer.converter.type;
import com.google.common.base.Preconditions;
import org.apache.calcite.sql.SqlOperator;
import org.apache.calcite.sql.fun.SqlStdOperatorTable;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.CombineType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.CombineType;
import java.util.HashMap;
import java.util.Map;
diff --git a/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverterTest.java b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverterTest.java
index a8dc1d77afd..c6347d50aa4 100644
--- a/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverterTest.java
+++ b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverterTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sqlfederation.optimizer.converter.type;
import org.apache.calcite.sql.fun.SqlStdOperatorTable;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.CombineType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.CombineType;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionBackendHandlerFactory.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionBackendHandlerFactory.java
index a10f5e2bddb..c29abd82430 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionBackendHandlerFactory.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionBackendHandlerFactory.java
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngineFactory;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
import org.apache.shardingsphere.proxy.backend.handler.ProxyBackendHandler;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OperationScope;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OperationScope;
import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.BeginTransactionStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.CommitStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.ReleaseSavepointStatement;
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionSetHandler.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionSetHandler.java
index 02027d206f7..dce670cd644 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionSetHandler.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/transaction/TransactionSetHandler.java
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.proxy.backend.response.header.ResponseHeader;
import org.apache.shardingsphere.proxy.backend.response.header.update.UpdateResponseHeader;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
import org.apache.shardingsphere.proxy.backend.util.TransactionUtil;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.TransactionAccessType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.TransactionAccessType;
import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.SetTransactionStatement;
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.MySQLStatement;
import org.apache.shardingsphere.transaction.exception.SwitchTypeInTransactionException;
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/session/ConnectionSession.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/session/ConnectionSession.java
index 62c4a724808..6ba901d3963 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/session/ConnectionSession.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/session/ConnectionSession.java
@@ -35,7 +35,7 @@ import org.apache.shardingsphere.proxy.backend.communication.vertx.VertxBackendC
import org.apache.shardingsphere.proxy.backend.communication.vertx.VertxBackendStatement;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import org.apache.shardingsphere.proxy.backend.session.transaction.TransactionStatus;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.TransactionIsolationLevel;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.TransactionIsolationLevel;
import org.apache.shardingsphere.transaction.core.TransactionType;
/**
diff --git a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/util/TransactionUtil.java b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/util/TransactionUtil.java
index d870a395655..0da0bae1a00 100644
--- a/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/util/TransactionUtil.java
+++ b/proxy/backend/src/main/java/org/apache/shardingsphere/proxy/backend/util/TransactionUtil.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.proxy.backend.util;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.TransactionIsolationLevel;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.TransactionIsolationLevel;
import java.sql.Connection;
diff --git a/proxy/frontend/postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutor.java b/proxy/frontend/postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutor.java
index a0802e26e9e..571a958df6e 100644
--- a/proxy/frontend/postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutor.java
+++ b/proxy/frontend/postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutor.java
@@ -34,7 +34,7 @@ import org.apache.shardingsphere.proxy.backend.distsql.DistSQLStatementContext;
import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
import org.apache.shardingsphere.proxy.frontend.command.executor.CommandExecutor;
import org.apache.shardingsphere.proxy.frontend.postgresql.command.query.extended.PostgreSQLServerPreparedStatement;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.ParameterMarkerSegment;
import org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
diff --git a/sql-parser/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLStatementSQLVisitor.java b/sql-parser/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLStatementSQLVisitor.java
index e1514e992c2..cb86d3dee1e 100644
--- a/sql-parser/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLStatementSQLVisitor.java
+++ b/sql-parser/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLStatementSQLVisitor.java
@@ -135,12 +135,12 @@ import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.WeightS
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.WhereClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.WindowClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.WindowFunctionContext;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.CombineType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.JoinType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.CombineType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.JoinType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.ConstraintSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexNameSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
@@ -1076,17 +1076,17 @@ public abstract class MySQLStatementSQLVisitor extends MySQLStatementBaseVisitor
} else {
orderDirection = OrderDirection.ASC;
}
- NullsOrderDirection nullsOrderDirection = OrderDirection.ASC.equals(orderDirection) ? NullsOrderDirection.FIRST : NullsOrderDirection.LAST;
+ NullsOrderType nullsOrderType = OrderDirection.ASC.equals(orderDirection) ? NullsOrderType.FIRST : NullsOrderType.LAST;
if (null != ctx.numberLiterals()) {
return new IndexOrderByItemSegment(ctx.numberLiterals().getStart().getStartIndex(), ctx.numberLiterals().getStop().getStopIndex(),
- SQLUtil.getExactlyNumber(ctx.numberLiterals().getText(), 10).intValue(), orderDirection, nullsOrderDirection);
+ SQLUtil.getExactlyNumber(ctx.numberLiterals().getText(), 10).intValue(), orderDirection, nullsOrderType);
} else {
ASTNode expr = visitExpr(ctx.expr());
if (expr instanceof ColumnSegment) {
- return new ColumnOrderByItemSegment((ColumnSegment) expr, orderDirection, nullsOrderDirection);
+ return new ColumnOrderByItemSegment((ColumnSegment) expr, orderDirection, nullsOrderType);
} else {
return new ExpressionOrderByItemSegment(ctx.expr().getStart().getStartIndex(),
- ctx.expr().getStop().getStopIndex(), getOriginalText(ctx.expr()), orderDirection, nullsOrderDirection, (ExpressionSegment) expr);
+ ctx.expr().getStop().getStopIndex(), getOriginalText(ctx.expr()), orderDirection, nullsOrderType, (ExpressionSegment) expr);
}
}
}
diff --git a/sql-parser/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLTCLStatementSQLVisitor.java b/sql-parser/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLTCLStatementSQLVisitor.java
index e93669b845e..2c6c560ce6d 100644
--- a/sql-parser/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLTCLStatementSQLVisitor.java
+++ b/sql-parser/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLTCLStatementSQLVisitor.java
@@ -32,9 +32,9 @@ import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.SetTran
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.TableLockContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.UnlockContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.XaContext;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OperationScope;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.TransactionAccessType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.TransactionIsolationLevel;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OperationScope;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.TransactionAccessType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.TransactionIsolationLevel;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.AliasSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.tcl.AutoCommitSegment;
diff --git a/sql-parser/dialect/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussDDLStatementSQLVisitor.java b/sql-parser/dialect/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussDDLStatementSQLVisitor.java
index 4aff0c4e59e..441c7fa47ac 100644
--- a/sql-parser/dialect/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussDDLStatementSQLVisitor.java
+++ b/sql-parser/dialect/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussDDLStatementSQLVisitor.java
@@ -137,7 +137,7 @@ import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.Tab
import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.TableNamesClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.TruncateTableContext;
import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.ValidateConstraintSpecificationContext;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.DirectionType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.DirectionType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.AlterDefinitionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.CreateDefinitionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.column.ColumnDefinitionSegment;
diff --git a/sql-parser/dialect/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussStatementSQLVisitor.java b/sql-parser/dialect/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussStatementSQLVisitor.java
index b9ad9cb4b66..479c3267e82 100644
--- a/sql-parser/dialect/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussStatementSQLVisitor.java
+++ b/sql-parser/dialect/opengauss/src/main/java/org/apache/shardingsphere/sql/parser/opengauss/visitor/statement/impl/OpenGaussStatementSQLVisitor.java
@@ -105,12 +105,12 @@ import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.Val
import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.WhereClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.WhereOrCurrentClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.OpenGaussStatementParser.WindowClauseContext;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.CombineType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.JoinType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.CombineType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.JoinType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.ConstraintSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexNameSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
@@ -581,28 +581,28 @@ public abstract class OpenGaussStatementSQLVisitor extends OpenGaussStatementBas
@Override
public final ASTNode visitSortby(final SortbyContext ctx) {
OrderDirection orderDirection = null != ctx.ascDesc() ? generateOrderDirection(ctx.ascDesc()) : OrderDirection.ASC;
- NullsOrderDirection nullsOrderDirection = generateNullsOrderDirection(ctx.nullsOrder(), orderDirection);
+ NullsOrderType nullsOrderType = generateNullsOrderType(ctx.nullsOrder(), orderDirection);
ASTNode expr = visit(ctx.aExpr());
if (expr instanceof ColumnSegment) {
ColumnSegment column = (ColumnSegment) expr;
- return new ColumnOrderByItemSegment(column, orderDirection, nullsOrderDirection);
+ return new ColumnOrderByItemSegment(column, orderDirection, nullsOrderType);
}
if (expr instanceof LiteralExpressionSegment) {
LiteralExpressionSegment index = (LiteralExpressionSegment) expr;
- return new IndexOrderByItemSegment(index.getStartIndex(), index.getStopIndex(), Integer.parseInt(index.getLiterals().toString()), orderDirection, nullsOrderDirection);
+ return new IndexOrderByItemSegment(index.getStartIndex(), index.getStopIndex(), Integer.parseInt(index.getLiterals().toString()), orderDirection, nullsOrderType);
}
if (expr instanceof ExpressionSegment) {
return new ExpressionOrderByItemSegment(ctx.aExpr().getStart().getStartIndex(),
- ctx.aExpr().getStop().getStopIndex(), getOriginalText(ctx.aExpr()), orderDirection, nullsOrderDirection, (ExpressionSegment) expr);
+ ctx.aExpr().getStop().getStopIndex(), getOriginalText(ctx.aExpr()), orderDirection, nullsOrderType, (ExpressionSegment) expr);
}
- return new ExpressionOrderByItemSegment(ctx.aExpr().getStart().getStartIndex(), ctx.aExpr().getStop().getStopIndex(), getOriginalText(ctx.aExpr()), orderDirection, nullsOrderDirection);
+ return new ExpressionOrderByItemSegment(ctx.aExpr().getStart().getStartIndex(), ctx.aExpr().getStop().getStopIndex(), getOriginalText(ctx.aExpr()), orderDirection, nullsOrderType);
}
- private NullsOrderDirection generateNullsOrderDirection(final NullsOrderContext ctx, final OrderDirection orderDirection) {
+ private NullsOrderType generateNullsOrderType(final NullsOrderContext ctx, final OrderDirection orderDirection) {
if (null == ctx) {
- return OrderDirection.ASC.equals(orderDirection) ? NullsOrderDirection.LAST : NullsOrderDirection.FIRST;
+ return OrderDirection.ASC.equals(orderDirection) ? NullsOrderType.LAST : NullsOrderType.FIRST;
}
- return null == ctx.FIRST() ? NullsOrderDirection.LAST : NullsOrderDirection.FIRST;
+ return null == ctx.FIRST() ? NullsOrderType.LAST : NullsOrderType.FIRST;
}
private OrderDirection generateOrderDirection(final AscDescContext ctx) {
@@ -994,16 +994,16 @@ public abstract class OpenGaussStatementSQLVisitor extends OpenGaussStatementBas
if (null != ctx.aExpr()) {
ASTNode astNode = visit(ctx.aExpr());
if (astNode instanceof ColumnSegment) {
- return new ColumnOrderByItemSegment((ColumnSegment) astNode, OrderDirection.ASC, NullsOrderDirection.LAST);
+ return new ColumnOrderByItemSegment((ColumnSegment) astNode, OrderDirection.ASC, NullsOrderType.LAST);
}
if (astNode instanceof LiteralExpressionSegment) {
LiteralExpressionSegment index = (LiteralExpressionSegment) astNode;
return new IndexOrderByItemSegment(index.getStartIndex(), index.getStopIndex(),
- Integer.parseInt(index.getLiterals().toString()), OrderDirection.ASC, NullsOrderDirection.LAST);
+ Integer.parseInt(index.getLiterals().toString()), OrderDirection.ASC, NullsOrderType.LAST);
}
- return new ExpressionOrderByItemSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(ctx), OrderDirection.ASC, NullsOrderDirection.LAST);
+ return new ExpressionOrderByItemSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(ctx), OrderDirection.ASC, NullsOrderType.LAST);
}
- return new ExpressionOrderByItemSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(ctx), OrderDirection.ASC, NullsOrderDirection.LAST);
+ return new ExpressionOrderByItemSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(ctx), OrderDirection.ASC, NullsOrderType.LAST);
}
@Override
diff --git a/sql-parser/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleDMLStatementSQLVisitor.java b/sql-parser/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleDMLStatementSQLVisitor.java
index 5615d41a859..357758f2ed5 100644
--- a/sql-parser/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleDMLStatementSQLVisitor.java
+++ b/sql-parser/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleDMLStatementSQLVisitor.java
@@ -103,9 +103,9 @@ import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.Update
import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.UsingClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.WhereClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.WithClauseContext;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.JoinType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.JoinType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.AssignmentSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.ColumnAssignmentSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.InsertValuesSegment;
@@ -962,14 +962,14 @@ public final class OracleDMLStatementSQLVisitor extends OracleStatementSQLVisito
ASTNode expression = visit(ctx);
if (expression instanceof ColumnSegment) {
ColumnSegment column = (ColumnSegment) expression;
- return new ColumnOrderByItemSegment(column, OrderDirection.ASC, NullsOrderDirection.LAST);
+ return new ColumnOrderByItemSegment(column, OrderDirection.ASC, NullsOrderType.LAST);
}
if (expression instanceof LiteralExpressionSegment) {
LiteralExpressionSegment literalExpression = (LiteralExpressionSegment) expression;
return new IndexOrderByItemSegment(literalExpression.getStartIndex(), literalExpression.getStopIndex(),
- SQLUtil.getExactlyNumber(literalExpression.getLiterals().toString(), 10).intValue(), OrderDirection.ASC, NullsOrderDirection.LAST);
+ SQLUtil.getExactlyNumber(literalExpression.getLiterals().toString(), 10).intValue(), OrderDirection.ASC, NullsOrderType.LAST);
}
- return new ExpressionOrderByItemSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), getOriginalText(ctx), OrderDirection.ASC, NullsOrderDirection.LAST,
+ return new ExpressionOrderByItemSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), getOriginalText(ctx), OrderDirection.ASC, NullsOrderType.LAST,
(ExpressionSegment) expression);
}
diff --git a/sql-parser/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleStatementSQLVisitor.java b/sql-parser/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleStatementSQLVisitor.java
index 79cec2e3f66..05ca830aed6 100644
--- a/sql-parser/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleStatementSQLVisitor.java
+++ b/sql-parser/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/impl/OracleStatementSQLVisitor.java
@@ -70,10 +70,10 @@ import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.Unrese
import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.ViewNameContext;
import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.XmlAggFunctionContext;
import org.apache.shardingsphere.sql.parser.autogen.OracleStatementParser.XmlFunctionContext;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.ConstraintSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexNameSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
@@ -637,24 +637,24 @@ public abstract class OracleStatementSQLVisitor extends OracleStatementBaseVisit
@Override
public final ASTNode visitOrderByItem(final OrderByItemContext ctx) {
OrderDirection orderDirection = null != ctx.DESC() ? OrderDirection.DESC : OrderDirection.ASC;
- NullsOrderDirection nullsOrderDirection = generateNullsOrderDirection(ctx, orderDirection);
+ NullsOrderType nullsOrderType = generateNullsOrderType(ctx, orderDirection);
if (null != ctx.columnName()) {
ColumnSegment column = (ColumnSegment) visit(ctx.columnName());
- return new ColumnOrderByItemSegment(column, orderDirection, nullsOrderDirection);
+ return new ColumnOrderByItemSegment(column, orderDirection, nullsOrderType);
}
if (null != ctx.numberLiterals()) {
return new IndexOrderByItemSegment(ctx.numberLiterals().getStart().getStartIndex(), ctx.numberLiterals().getStop().getStopIndex(),
- SQLUtil.getExactlyNumber(ctx.numberLiterals().getText(), 10).intValue(), orderDirection, nullsOrderDirection);
+ SQLUtil.getExactlyNumber(ctx.numberLiterals().getText(), 10).intValue(), orderDirection, nullsOrderType);
}
return new ExpressionOrderByItemSegment(ctx.expr().getStart().getStartIndex(), ctx.expr().getStop().getStopIndex(),
- getOriginalText(ctx.expr()), orderDirection, nullsOrderDirection, (ExpressionSegment) visit(ctx.expr()));
+ getOriginalText(ctx.expr()), orderDirection, nullsOrderType, (ExpressionSegment) visit(ctx.expr()));
}
- private NullsOrderDirection generateNullsOrderDirection(final OrderByItemContext ctx, final OrderDirection orderDirection) {
+ private NullsOrderType generateNullsOrderType(final OrderByItemContext ctx, final OrderDirection orderDirection) {
if (null == ctx) {
- return OrderDirection.ASC.equals(orderDirection) ? NullsOrderDirection.LAST : NullsOrderDirection.FIRST;
+ return OrderDirection.ASC.equals(orderDirection) ? NullsOrderType.LAST : NullsOrderType.FIRST;
}
- return null == ctx.FIRST() ? NullsOrderDirection.LAST : NullsOrderDirection.FIRST;
+ return null == ctx.FIRST() ? NullsOrderType.LAST : NullsOrderType.FIRST;
}
@Override
diff --git a/sql-parser/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLDDLStatementSQLVisitor.java b/sql-parser/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLDDLStatementSQLVisitor.java
index 83f9a1191ea..b3dc939328b 100644
--- a/sql-parser/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLDDLStatementSQLVisitor.java
+++ b/sql-parser/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLDDLStatementSQLVisitor.java
@@ -174,7 +174,7 @@ import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Ta
import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.TruncateTableContext;
import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.UnlistenContext;
import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.ValidateConstraintSpecificationContext;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.DirectionType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.DirectionType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.AlterDefinitionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.CreateDefinitionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.column.ColumnDefinitionSegment;
diff --git a/sql-parser/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java b/sql-parser/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java
index 04290c06c6f..901d9caf9ec 100644
--- a/sql-parser/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java
+++ b/sql-parser/dialect/postgresql/src/main/java/org/apache/shardingsphere/sql/parser/postgresql/visitor/statement/impl/PostgreSQLStatementSQLVisitor.java
@@ -105,12 +105,12 @@ import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.Wh
import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.WhereOrCurrentClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.WindowClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParserBaseVisitor;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.CombineType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.JoinType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.CombineType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.JoinType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.ConstraintSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexNameSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
@@ -578,28 +578,28 @@ public abstract class PostgreSQLStatementSQLVisitor extends PostgreSQLStatementP
@Override
public final ASTNode visitSortby(final SortbyContext ctx) {
OrderDirection orderDirection = null != ctx.ascDesc() ? generateOrderDirection(ctx.ascDesc()) : OrderDirection.ASC;
- NullsOrderDirection nullsOrderDirection = generateNullsOrderDirection(ctx.nullsOrder(), orderDirection);
+ NullsOrderType nullsOrderType = generateNullsOrderType(ctx.nullsOrder(), orderDirection);
ASTNode expr = visit(ctx.aExpr());
if (expr instanceof ColumnSegment) {
ColumnSegment column = (ColumnSegment) expr;
- return new ColumnOrderByItemSegment(column, orderDirection, nullsOrderDirection);
+ return new ColumnOrderByItemSegment(column, orderDirection, nullsOrderType);
}
if (expr instanceof LiteralExpressionSegment) {
LiteralExpressionSegment index = (LiteralExpressionSegment) expr;
- return new IndexOrderByItemSegment(index.getStartIndex(), index.getStopIndex(), Integer.parseInt(index.getLiterals().toString()), orderDirection, nullsOrderDirection);
+ return new IndexOrderByItemSegment(index.getStartIndex(), index.getStopIndex(), Integer.parseInt(index.getLiterals().toString()), orderDirection, nullsOrderType);
}
if (expr instanceof ExpressionSegment) {
return new ExpressionOrderByItemSegment(ctx.aExpr().getStart().getStartIndex(),
- ctx.aExpr().getStop().getStopIndex(), getOriginalText(ctx.aExpr()), orderDirection, nullsOrderDirection, (ExpressionSegment) expr);
+ ctx.aExpr().getStop().getStopIndex(), getOriginalText(ctx.aExpr()), orderDirection, nullsOrderType, (ExpressionSegment) expr);
}
- return new ExpressionOrderByItemSegment(ctx.aExpr().getStart().getStartIndex(), ctx.aExpr().getStop().getStopIndex(), getOriginalText(ctx.aExpr()), orderDirection, nullsOrderDirection);
+ return new ExpressionOrderByItemSegment(ctx.aExpr().getStart().getStartIndex(), ctx.aExpr().getStop().getStopIndex(), getOriginalText(ctx.aExpr()), orderDirection, nullsOrderType);
}
- private NullsOrderDirection generateNullsOrderDirection(final NullsOrderContext ctx, final OrderDirection orderDirection) {
+ private NullsOrderType generateNullsOrderType(final NullsOrderContext ctx, final OrderDirection orderDirection) {
if (null == ctx) {
- return OrderDirection.ASC.equals(orderDirection) ? NullsOrderDirection.LAST : NullsOrderDirection.FIRST;
+ return OrderDirection.ASC.equals(orderDirection) ? NullsOrderType.LAST : NullsOrderType.FIRST;
}
- return null == ctx.FIRST() ? NullsOrderDirection.LAST : NullsOrderDirection.FIRST;
+ return null == ctx.FIRST() ? NullsOrderType.LAST : NullsOrderType.FIRST;
}
private OrderDirection generateOrderDirection(final AscDescContext ctx) {
@@ -961,16 +961,16 @@ public abstract class PostgreSQLStatementSQLVisitor extends PostgreSQLStatementP
if (null != ctx.aExpr()) {
ASTNode astNode = visit(ctx.aExpr());
if (astNode instanceof ColumnSegment) {
- return new ColumnOrderByItemSegment((ColumnSegment) astNode, OrderDirection.ASC, NullsOrderDirection.LAST);
+ return new ColumnOrderByItemSegment((ColumnSegment) astNode, OrderDirection.ASC, NullsOrderType.LAST);
}
if (astNode instanceof LiteralExpressionSegment) {
LiteralExpressionSegment index = (LiteralExpressionSegment) astNode;
return new IndexOrderByItemSegment(index.getStartIndex(), index.getStopIndex(),
- Integer.parseInt(index.getLiterals().toString()), OrderDirection.ASC, NullsOrderDirection.LAST);
+ Integer.parseInt(index.getLiterals().toString()), OrderDirection.ASC, NullsOrderType.LAST);
}
- return new ExpressionOrderByItemSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(ctx), OrderDirection.ASC, NullsOrderDirection.LAST);
+ return new ExpressionOrderByItemSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(ctx), OrderDirection.ASC, NullsOrderType.LAST);
}
- return new ExpressionOrderByItemSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(ctx), OrderDirection.ASC, NullsOrderDirection.LAST);
+ return new ExpressionOrderByItemSegment(ctx.start.getStartIndex(), ctx.stop.getStopIndex(), getOriginalText(ctx), OrderDirection.ASC, NullsOrderType.LAST);
}
@Override
diff --git a/sql-parser/dialect/sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/impl/SQL92DMLStatementSQLVisitor.java b/sql-parser/dialect/sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/impl/SQL92DMLStatementSQLVisitor.java
index 4bee93ddc7c..39e730296dd 100644
--- a/sql-parser/dialect/sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/impl/SQL92DMLStatementSQLVisitor.java
+++ b/sql-parser/dialect/sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/impl/SQL92DMLStatementSQLVisitor.java
@@ -54,7 +54,7 @@ import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.TableRe
import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.TableReferencesContext;
import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.UpdateContext;
import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.WhereClauseContext;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.JoinType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.JoinType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.AssignmentSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.ColumnAssignmentSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.InsertValuesSegment;
diff --git a/sql-parser/dialect/sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/impl/SQL92StatementSQLVisitor.java b/sql-parser/dialect/sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/impl/SQL92StatementSQLVisitor.java
index 7a66f7f3343..991816db5d5 100644
--- a/sql-parser/dialect/sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/impl/SQL92StatementSQLVisitor.java
+++ b/sql-parser/dialect/sql92/src/main/java/org/apache/shardingsphere/sql/parser/sql92/visitor/statement/impl/SQL92StatementSQLVisitor.java
@@ -58,10 +58,10 @@ import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.StringL
import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.TableNameContext;
import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.TableNamesContext;
import org.apache.shardingsphere.sql.parser.autogen.SQL92StatementParser.UnreservedWordContext;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BetweenExpression;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression;
@@ -535,13 +535,13 @@ public abstract class SQL92StatementSQLVisitor extends SQL92StatementBaseVisitor
@Override
public final ASTNode visitOrderByItem(final OrderByItemContext ctx) {
OrderDirection orderDirection = null != ctx.DESC() ? OrderDirection.DESC : OrderDirection.ASC;
- NullsOrderDirection nullsOrderDirection = OrderDirection.ASC.equals(orderDirection) ? NullsOrderDirection.FIRST : NullsOrderDirection.LAST;
+ NullsOrderType nullsOrderType = OrderDirection.ASC.equals(orderDirection) ? NullsOrderType.FIRST : NullsOrderType.LAST;
if (null != ctx.columnName()) {
ColumnSegment column = (ColumnSegment) visit(ctx.columnName());
- return new ColumnOrderByItemSegment(column, orderDirection, nullsOrderDirection);
+ return new ColumnOrderByItemSegment(column, orderDirection, nullsOrderType);
}
return new IndexOrderByItemSegment(ctx.numberLiterals().getStart().getStartIndex(), ctx.numberLiterals().getStop().getStopIndex(),
- SQLUtil.getExactlyNumber(ctx.numberLiterals().getText(), 10).intValue(), orderDirection, nullsOrderDirection);
+ SQLUtil.getExactlyNumber(ctx.numberLiterals().getText(), 10).intValue(), orderDirection, nullsOrderType);
}
@Override
diff --git a/sql-parser/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerStatementSQLVisitor.java b/sql-parser/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerStatementSQLVisitor.java
index 149c7c6583e..706d65eb973 100644
--- a/sql-parser/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerStatementSQLVisitor.java
+++ b/sql-parser/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerStatementSQLVisitor.java
@@ -105,11 +105,11 @@ import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.Upd
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.ViewNameContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.WhereClauseContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.WithClauseContext;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.JoinType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.JoinType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.ConstraintSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexNameSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
@@ -654,17 +654,17 @@ public abstract class SQLServerStatementSQLVisitor extends SQLServerStatementBas
@Override
public final ASTNode visitOrderByItem(final OrderByItemContext ctx) {
OrderDirection orderDirection = null != ctx.DESC() ? OrderDirection.DESC : OrderDirection.ASC;
- NullsOrderDirection nullsOrderDirection = OrderDirection.ASC.equals(orderDirection) ? NullsOrderDirection.FIRST : NullsOrderDirection.LAST;
+ NullsOrderType nullsOrderType = OrderDirection.ASC.equals(orderDirection) ? NullsOrderType.FIRST : NullsOrderType.LAST;
if (null != ctx.columnName()) {
ColumnSegment column = (ColumnSegment) visit(ctx.columnName());
- return new ColumnOrderByItemSegment(column, orderDirection, nullsOrderDirection);
+ return new ColumnOrderByItemSegment(column, orderDirection, nullsOrderType);
}
if (null != ctx.numberLiterals()) {
return new IndexOrderByItemSegment(ctx.numberLiterals().getStart().getStartIndex(), ctx.numberLiterals().getStop().getStopIndex(),
- SQLUtil.getExactlyNumber(ctx.numberLiterals().getText(), 10).intValue(), orderDirection, NullsOrderDirection.FIRST);
+ SQLUtil.getExactlyNumber(ctx.numberLiterals().getText(), 10).intValue(), orderDirection, NullsOrderType.FIRST);
}
return new ExpressionOrderByItemSegment(ctx.expr().getStart().getStartIndex(), ctx.expr().getStop().getStopIndex(), getOriginalText(ctx.expr()),
- orderDirection, nullsOrderDirection, (ExpressionSegment) visit(ctx.expr()));
+ orderDirection, nullsOrderType, (ExpressionSegment) visit(ctx.expr()));
}
@Override
diff --git a/sql-parser/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerTCLStatementSQLVisitor.java b/sql-parser/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerTCLStatementSQLVisitor.java
index dc97887ffb5..e3034d2869e 100644
--- a/sql-parser/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerTCLStatementSQLVisitor.java
+++ b/sql-parser/dialect/sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerTCLStatementSQLVisitor.java
@@ -31,7 +31,7 @@ import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.Rol
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.SavepointContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.SetImplicitTransactionsContext;
import org.apache.shardingsphere.sql.parser.autogen.SQLServerStatementParser.SetTransactionContext;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.TransactionIsolationLevel;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.TransactionIsolationLevel;
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.tcl.SQLServerBeginDistributedTransactionStatement;
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.tcl.SQLServerBeginTransactionStatement;
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.sqlserver.tcl.SQLServerCommitStatement;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/AggregationType.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/AggregationType.java
similarity index 95%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/AggregationType.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/AggregationType.java
index 7a06e3c2a04..1f0b4fd41bf 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/AggregationType.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/AggregationType.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import java.util.Arrays;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/CombineType.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/CombineType.java
similarity index 93%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/CombineType.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/CombineType.java
index f6d31ed4c7c..ff077cf6bf4 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/CombineType.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/CombineType.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
/**
* Combine type.
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/DirectionType.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/DirectionType.java
similarity index 97%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/DirectionType.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/DirectionType.java
index 9df3f72ad71..522dd9ce09a 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/DirectionType.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/DirectionType.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/JoinType.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/JoinType.java
similarity index 93%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/JoinType.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/JoinType.java
index d4a79d4a43c..b714ce63a29 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/JoinType.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/JoinType.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
/**
* Join type enum.
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/LogicalOperator.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/LogicalOperator.java
similarity index 96%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/LogicalOperator.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/LogicalOperator.java
index be8b6f25562..4a01e668726 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/LogicalOperator.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/LogicalOperator.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import java.util.HashMap;
import java.util.Map;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/NullsOrderDirection.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/NullsOrderType.java
similarity index 82%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/NullsOrderDirection.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/NullsOrderType.java
index 372bc908df9..1236b577c04 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/NullsOrderDirection.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/NullsOrderType.java
@@ -15,20 +15,20 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
/**
- * Nulls order direction.
+ * Nulls order type.
*/
-public enum NullsOrderDirection {
+public enum NullsOrderType {
/**
- * Nulls first direction.
+ * Nulls first.
*/
FIRST,
/**
- * Nulls last direction.
+ * Nulls last.
*/
LAST
}
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/OperationScope.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/OperationScope.java
similarity index 94%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/OperationScope.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/OperationScope.java
index 643526aed97..d3aacbcd51c 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/OperationScope.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/OperationScope.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/OrderDirection.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/OrderDirection.java
similarity index 93%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/OrderDirection.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/OrderDirection.java
index 0bc795e7e22..1de04948ec1 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/OrderDirection.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/OrderDirection.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
/**
* Order direction.
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/ParameterMarkerType.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/ParameterMarkerType.java
similarity index 94%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/ParameterMarkerType.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/ParameterMarkerType.java
index 68cc580a916..4c879d7362b 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/ParameterMarkerType.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/ParameterMarkerType.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/Paren.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/Paren.java
similarity index 96%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/Paren.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/Paren.java
index d97deadf571..828eb6a9325 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/Paren.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/Paren.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import java.util.Arrays;
import lombok.Getter;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/QuoteCharacter.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/QuoteCharacter.java
similarity index 96%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/QuoteCharacter.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/QuoteCharacter.java
index 72efbccf04d..4646a7516e1 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/QuoteCharacter.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/QuoteCharacter.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import com.google.common.base.Strings;
import lombok.Getter;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/SubqueryType.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/SubqueryType.java
similarity index 93%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/SubqueryType.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/SubqueryType.java
index 3ea2b477022..00a07321f49 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/SubqueryType.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/SubqueryType.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
/**
* Subquery type enum.
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/TransactionAccessType.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/TransactionAccessType.java
similarity index 94%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/TransactionAccessType.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/TransactionAccessType.java
index e55969b5eaf..779c61fef44 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/TransactionAccessType.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/TransactionAccessType.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/TransactionIsolationLevel.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/TransactionIsolationLevel.java
similarity index 94%
rename from sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/TransactionIsolationLevel.java
rename to sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/TransactionIsolationLevel.java
index 886551f9b81..5afe26a4863 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/TransactionIsolationLevel.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/enums/TransactionIsolationLevel.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/ddl/cursor/DirectionSegment.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/ddl/cursor/DirectionSegment.java
index a7b2e4984ba..641fa09c68c 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/ddl/cursor/DirectionSegment.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/ddl/cursor/DirectionSegment.java
@@ -21,7 +21,7 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.DirectionType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.DirectionType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment;
import java.util.Optional;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/combine/CombineSegment.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/combine/CombineSegment.java
index 6fb1f262a12..1dd37d7f9a4 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/combine/CombineSegment.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/combine/CombineSegment.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.combine;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.CombineType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.CombineType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment;
import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/simple/ParameterMarkerExpressionSegment.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/simple/ParameterMarkerExpressionSegment.java
index 42df9cee6e6..6fb877043c5 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/simple/ParameterMarkerExpressionSegment.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/simple/ParameterMarkerExpressionSegment.java
@@ -22,7 +22,7 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.AliasAvailable;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.AliasSegment;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/subquery/SubquerySegment.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/subquery/SubquerySegment.java
index e2bf3addab0..7a6b6a4a487 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/subquery/SubquerySegment.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/subquery/SubquerySegment.java
@@ -21,7 +21,7 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.SubqueryType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.SubqueryType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/item/AggregationDistinctProjectionSegment.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/item/AggregationDistinctProjectionSegment.java
index f8b96b7be83..86eb568d501 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/item/AggregationDistinctProjectionSegment.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/item/AggregationDistinctProjectionSegment.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item;
import lombok.Getter;
import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
import org.apache.shardingsphere.sql.parser.sql.common.util.SQLUtil;
/**
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/item/AggregationProjectionSegment.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/item/AggregationProjectionSegment.java
index b65ca5410a5..22068881b75 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/item/AggregationProjectionSegment.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/item/AggregationProjectionSegment.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.AliasAvailable;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.AliasSegment;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/ColumnOrderByItemSegment.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/ColumnOrderByItemSegment.java
index 8d05e424306..f9ba9eb8a4f 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/ColumnOrderByItemSegment.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/ColumnOrderByItemSegment.java
@@ -19,8 +19,8 @@ package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item;
import lombok.Getter;
import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
/**
@@ -32,8 +32,8 @@ public final class ColumnOrderByItemSegment extends TextOrderByItemSegment {
private final ColumnSegment column;
- public ColumnOrderByItemSegment(final ColumnSegment column, final OrderDirection orderDirection, final NullsOrderDirection nullsOrderDirection) {
- super(column.getStartIndex(), column.getStopIndex(), orderDirection, nullsOrderDirection);
+ public ColumnOrderByItemSegment(final ColumnSegment column, final OrderDirection orderDirection, final NullsOrderType nullsOrderType) {
+ super(column.getStartIndex(), column.getStopIndex(), orderDirection, nullsOrderType);
this.column = column;
}
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/ExpressionOrderByItemSegment.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/ExpressionOrderByItemSegment.java
index e1dd746ac7f..362f6b76bf6 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/ExpressionOrderByItemSegment.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/ExpressionOrderByItemSegment.java
@@ -19,8 +19,8 @@ package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item;
import lombok.Getter;
import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment;
/**
@@ -34,15 +34,15 @@ public final class ExpressionOrderByItemSegment extends TextOrderByItemSegment {
private final ExpressionSegment expr;
- public ExpressionOrderByItemSegment(final int startIndex, final int stopIndex, final String expression, final OrderDirection orderDirection, final NullsOrderDirection nullsOrderDirection) {
- super(startIndex, stopIndex, orderDirection, nullsOrderDirection);
+ public ExpressionOrderByItemSegment(final int startIndex, final int stopIndex, final String expression, final OrderDirection orderDirection, final NullsOrderType nullsOrderType) {
+ super(startIndex, stopIndex, orderDirection, nullsOrderType);
this.expression = expression;
this.expr = null;
}
- public ExpressionOrderByItemSegment(final int startIndex, final int stopIndex, final String expression, final OrderDirection orderDirection, final NullsOrderDirection nullsOrderDirection,
+ public ExpressionOrderByItemSegment(final int startIndex, final int stopIndex, final String expression, final OrderDirection orderDirection, final NullsOrderType nullsOrderType,
final ExpressionSegment expr) {
- super(startIndex, stopIndex, orderDirection, nullsOrderDirection);
+ super(startIndex, stopIndex, orderDirection, nullsOrderType);
this.expression = expression;
this.expr = expr;
}
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/IndexOrderByItemSegment.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/IndexOrderByItemSegment.java
index 0ef100e659b..f18e45574d3 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/IndexOrderByItemSegment.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/IndexOrderByItemSegment.java
@@ -19,8 +19,8 @@ package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item;
import lombok.Getter;
import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
/**
* Order by item segment for index.
@@ -31,8 +31,8 @@ public final class IndexOrderByItemSegment extends OrderByItemSegment {
private final int columnIndex;
- public IndexOrderByItemSegment(final int startIndex, final int stopIndex, final int columnIndex, final OrderDirection orderDirection, final NullsOrderDirection nullsOrderDirection) {
- super(startIndex, stopIndex, orderDirection, nullsOrderDirection);
+ public IndexOrderByItemSegment(final int startIndex, final int stopIndex, final int columnIndex, final OrderDirection orderDirection, final NullsOrderType nullsOrderType) {
+ super(startIndex, stopIndex, orderDirection, nullsOrderType);
this.columnIndex = columnIndex;
}
}
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/OrderByItemSegment.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/OrderByItemSegment.java
index 848f042dd5f..5a706f15634 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/OrderByItemSegment.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/OrderByItemSegment.java
@@ -20,8 +20,8 @@ package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment;
/**
@@ -38,5 +38,5 @@ public abstract class OrderByItemSegment implements SQLSegment {
private final OrderDirection orderDirection;
- private final NullsOrderDirection nullsOrderDirection;
+ private final NullsOrderType nullsOrderType;
}
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/TextOrderByItemSegment.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/TextOrderByItemSegment.java
index b53f78a3e8f..8c71fd03b68 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/TextOrderByItemSegment.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/order/item/TextOrderByItemSegment.java
@@ -18,8 +18,8 @@
package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item;
import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.NullsOrderDirection;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.NullsOrderType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection;
/**
* Order by item segment for text.
@@ -27,8 +27,8 @@ import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
@ToString
public abstract class TextOrderByItemSegment extends OrderByItemSegment {
- protected TextOrderByItemSegment(final int startIndex, final int stopIndex, final OrderDirection orderDirection, final NullsOrderDirection nullsOrderDirection) {
- super(startIndex, stopIndex, orderDirection, nullsOrderDirection);
+ protected TextOrderByItemSegment(final int startIndex, final int stopIndex, final OrderDirection orderDirection, final NullsOrderType nullsOrderType) {
+ super(startIndex, stopIndex, orderDirection, nullsOrderType);
}
/**
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/tcl/SetTransactionStatement.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/tcl/SetTransactionStatement.java
index c72ed90e8b1..602d38f278b 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/tcl/SetTransactionStatement.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/tcl/SetTransactionStatement.java
@@ -20,9 +20,9 @@ package org.apache.shardingsphere.sql.parser.sql.common.statement.tcl;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.OperationScope;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.TransactionAccessType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.TransactionIsolationLevel;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.OperationScope;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.TransactionAccessType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.TransactionIsolationLevel;
import org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
/**
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/ExpressionExtractUtil.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/ExpressionExtractUtil.java
index 16630d75371..fc3ad412f9a 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/ExpressionExtractUtil.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/ExpressionExtractUtil.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sql.parser.sql.common.util;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.LogicalOperator;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.LogicalOperator;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.FunctionSegment;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/SQLUtil.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/SQLUtil.java
index 8d5e3b2107a..7cb80883975 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/SQLUtil.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/SQLUtil.java
@@ -23,7 +23,7 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.infra.util.exception.external.sql.type.generic.UnsupportedSQLOperationException;
import org.apache.shardingsphere.sql.parser.api.visitor.ASTNode;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.Paren;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.Paren;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.CommonExpressionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.LiteralExpressionSegment;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/SubqueryExtractUtil.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/SubqueryExtractUtil.java
index 8aafb6a62a6..1c28bb0bbbf 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/SubqueryExtractUtil.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/SubqueryExtractUtil.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sql.parser.sql.common.util;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.SubqueryType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.SubqueryType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BetweenExpression;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExistsSubqueryExpression;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/value/identifier/IdentifierValue.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/value/identifier/IdentifierValue.java
index e4ffbbe4a8e..0576974a862 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/value/identifier/IdentifierValue.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/value/identifier/IdentifierValue.java
@@ -21,7 +21,7 @@ import com.google.common.base.Strings;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import org.apache.shardingsphere.sql.parser.sql.common.util.SQLUtil;
import org.apache.shardingsphere.sql.parser.sql.common.value.ValueASTNode;
diff --git a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/value/parametermarker/ParameterMarkerValue.java b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/value/parametermarker/ParameterMarkerValue.java
index 220563a7ef0..e6a1550a6fb 100644
--- a/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/value/parametermarker/ParameterMarkerValue.java
+++ b/sql-parser/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/value/parametermarker/ParameterMarkerValue.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sql.parser.sql.common.value.parametermarker;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import org.apache.shardingsphere.sql.parser.sql.common.value.ValueASTNode;
/**
diff --git a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/AggregationTypeTest.java b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/AggregationTypeTest.java
similarity index 95%
rename from sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/AggregationTypeTest.java
rename to sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/AggregationTypeTest.java
index 1eef4dbd7bc..4020408b030 100644
--- a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/AggregationTypeTest.java
+++ b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/AggregationTypeTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import org.junit.Test;
diff --git a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/DirectionTypeTest.java b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/DirectionTypeTest.java
similarity index 96%
rename from sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/DirectionTypeTest.java
rename to sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/DirectionTypeTest.java
index 8799347256c..6449449344d 100644
--- a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/DirectionTypeTest.java
+++ b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/DirectionTypeTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import org.junit.Test;
diff --git a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/LogicalOperatorTest.java b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/LogicalOperatorTest.java
similarity index 97%
rename from sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/LogicalOperatorTest.java
rename to sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/LogicalOperatorTest.java
index 071e7f7ff2a..0b7fe4b54d2 100644
--- a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/LogicalOperatorTest.java
+++ b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/LogicalOperatorTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import org.junit.Test;
diff --git a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/ParenTest.java b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/ParenTest.java
similarity index 96%
rename from sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/ParenTest.java
rename to sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/ParenTest.java
index 4bbd580cccb..e4892ab2a56 100644
--- a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/ParenTest.java
+++ b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/ParenTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import org.junit.Test;
diff --git a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/QuoteCharacterTest.java b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/QuoteCharacterTest.java
similarity index 97%
rename from sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/QuoteCharacterTest.java
rename to sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/QuoteCharacterTest.java
index 2f6da37b3b6..c63137a6cab 100644
--- a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/constant/QuoteCharacterTest.java
+++ b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/enums/QuoteCharacterTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sql.parser.sql.common.constant;
+package org.apache.shardingsphere.sql.parser.sql.common.enums;
import org.junit.Test;
diff --git a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/extractor/TableExtractorTest.java b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/extractor/TableExtractorTest.java
index adde21c8de2..ccf693d4e69 100644
--- a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/extractor/TableExtractorTest.java
+++ b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/extractor/TableExtractorTest.java
@@ -28,7 +28,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.Optional;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.routine.RoutineBodySegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.routine.ValidStatementSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.AssignmentSegment;
diff --git a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SubqueryExtractUtilTest.java b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SubqueryExtractUtilTest.java
index 5fa0d28c108..2bfbfc111c8 100644
--- a/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SubqueryExtractUtilTest.java
+++ b/sql-parser/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SubqueryExtractUtilTest.java
@@ -17,8 +17,8 @@
package org.apache.shardingsphere.sql.parser.sql.common.util;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.AggregationType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.CombineType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.AggregationType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.CombineType;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.combine.CombineSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression;
diff --git a/test/fixture/src/main/java/org/apache/shardingsphere/test/fixture/database/type/MockedDatabaseType.java b/test/fixture/src/main/java/org/apache/shardingsphere/test/fixture/database/type/MockedDatabaseType.java
index f0c2f6e8d29..3b554e579ec 100644
--- a/test/fixture/src/main/java/org/apache/shardingsphere/test/fixture/database/type/MockedDatabaseType.java
+++ b/test/fixture/src/main/java/org/apache/shardingsphere/test/fixture/database/type/MockedDatabaseType.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.test.fixture.database.type;
import org.apache.shardingsphere.infra.database.metadata.DataSourceMetaData;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.QuoteCharacter;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.QuoteCharacter;
import java.util.Collection;
import java.util.Collections;
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/orderby/OrderByItemAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/orderby/OrderByItemAssert.java
index 4b14cdd7f9e..09f9476c2e2 100644
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/orderby/OrderByItemAssert.java
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/orderby/OrderByItemAssert.java
@@ -86,7 +86,7 @@ public final class OrderByItemAssert {
private static void assertOrderInfo(final SQLCaseAssertContext assertContext, final OrderByItemSegment actual, final ExpectedOrderByItem expected, final String type) {
assertThat(assertContext.getText(String.format("%s item order direction assertion error: ", type)),
- null != actual.getOrderDirection() ? actual.getOrderDirection().name() : actual.getNullsOrderDirection().name(), is(expected.getOrderDirection()));
+ null != actual.getOrderDirection() ? actual.getOrderDirection().name() : actual.getNullsOrderType().name(), is(expected.getOrderDirection()));
}
private static void assertColumnOrderByItem(final SQLCaseAssertContext assertContext,
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/jaxb/sql/loader/SQLCasesLoader.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/jaxb/sql/loader/SQLCasesLoader.java
index 7bbc5852ce0..951830c2f3d 100644
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/jaxb/sql/loader/SQLCasesLoader.java
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/jaxb/sql/loader/SQLCasesLoader.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.loader;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
-import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
+import org.apache.shardingsphere.sql.parser.sql.common.enums.ParameterMarkerType;
import org.apache.shardingsphere.test.sql.parser.internal.jaxb.Case;
import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCase;
import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;