This is an automated email from the ASF dual-hosted git repository.

terrymanu 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 d92729c4fef Support more Doris SQL parsing (ALTER WORKLOAD GROUP, 
quota with unit) (#39333)
d92729c4fef is described below

commit d92729c4fef24f159956843d301986822f18142a
Author: divyank sameer shah <[email protected]>
AuthorDate: Wed Aug 19 19:01:50 2026 +0200

    Support more Doris SQL parsing (ALTER WORKLOAD GROUP, quota with unit) 
(#39333)
    
    * Support more Doris SQL parsing for #31481
    
    LAG, BITXOR and most of the ALTER DATABASE variants listed in the
    issue already parsed correctly and had test coverage, so this only
    closes the two remaining gaps.
    
    Add a new grammar rule for ALTER WORKLOAD GROUP name PROPERTIES(...),
    modeled on the existing ALTER STORAGE POLICY rule, along with the
    statement and segment classes and visitor logic to build it.
    
    Extend the ALTER DATABASE ... SET DATA QUOTA clause to accept size
    literals like 100G by reusing the grammar's existing fileSizeLiteral
    rule instead of a bare number, and convert the K/M/G/T suffix to
    bytes in the visitor.
    
    Added sql-case and expected assertion XML for both, plus a regression
    case for the existing quota without unit. Verified against the full
    parser IT suite across all dialects with no failures.
    
    * Give DATA quota its own unit grammar, separate from replica and 
transaction
    
    The previous commit let all three quota types (data, replica, transaction)
    reuse the same size literal, which only understood uppercase single letter
    K, M, G and T suffixes. Real Doris only lets DATA QUOTA take a unit at all,
    and it accepts a wider set case insensitively: B, K, KB, M, MB, G, GB, T,
    TB, P and PB. Replica and transaction quotas take plain integers only.
    
    Add a dedicated lexer token for the data quota literal and split the
    grammar so replica and transaction quota values go back to a bare number
    while data quota routes through the new literal plus the existing one for
    backward compatibility. Convert the suffix to bytes in the visitor.
    
    Added cases for the two letter units, petabyte, lowercase, and bare byte
    forms, and checked directly that replica and transaction quotas with a
    unit suffix now fail to parse as expected.
    
    * Stop the data quota literal from hijacking ordinary identifiers
    
    The dedicated lexer token added for data quota units competed globally
    with the identifier token, since ANTLR lexer rules are not scoped to a
    parser context. Anything shaped like a digit-leading identifier, such
    as a column named 1GB, stopped parsing anywhere in a query, not just
    inside the quota clause.
    
    Drop that token and have the quota rule accept the identifier token
    directly instead, the same way it already matched before this feature
    was added. The unit suffix is parsed out of the token text in the
    visitor rather than carved out at the lexer level, so nothing about
    how identifiers are tokenized changes.
    
    Also tightened the value conversion itself: a quota value that is not
    a number followed by a recognized unit now raises a clear parsing
    error instead of quietly falling through or throwing a raw number
    format exception.
    
    Added a regression case for a digit-leading column reference and
    reran the full parser test suite across every dialect with no
    failures.
    
    * Reject out of range and malformed quota values instead of wrapping them
    
    Multiplying the unit suffix could overflow silently. A data quota of
    99999999999P produced -6918654927547924480, the same kind of misleading
    numeric value the earlier grammar mixup produced. Multiply through
    Math.multiplyExact and report an out of range parsing error instead.
    
    Quota values were also passed straight to Long.parseLong, so a decimal
    such as 1.5 or a value wider than a long escaped as a raw
    NumberFormatException rather than a parsing error. Both quota paths now
    validate the token first and raise SQLParsingException, matching how
    show database and show table already handle non integer ids.
    
    Cover the conversions, the out of range values, the malformed values and
    the replica and transaction boundary in the Doris visitor test, and add
    the unit suffixed replica and transaction statements to the unsupported
    case list.
    
    * Run the Doris unsupported SQL cases
    
    The unsupported case list already carried a Doris entry, but no Doris
    runner existed, so those cases were never executed. Other dialects such
    as PostgreSQL, SQL92, SQLServer and Firebird already have one.
    
    Adding the runner puts the previously orphaned case and the two unit
    suffixed replica and transaction statements under CI, so the quota type
    boundary is guarded by a test rather than by manual checking.
    
    * Apply project formatting to the quota helper separators
    
    * Cover the workload keyword still working as an identifier
    
    Adding the WORKLOAD keyword token means the word stops lexing as a
    plain identifier unless it is also registered as an unambiguous
    identifier keyword. It is registered, but nothing guarded that, and
    DorisPlayKeywordIdentifierTest exists because the PLAY keyword hit
    exactly this problem.
    
    ---------
    
    Co-authored-by: Liang Zhang <[email protected]>
---
 .../src/main/antlr4/imports/doris/DDLStatement.g4  | 20 +++++-
 .../src/main/antlr4/imports/doris/DorisKeyword.g4  |  2 +
 .../statement/type/DorisDDLStatementVisitor.java   | 83 ++++++++++++++++++++--
 .../type/DorisAlterDatabaseQuotaValueTest.java     | 41 +++++++++++
 .../workloadgroup/WorkloadGroupNameSegment.java    | 46 ++++++++++++
 .../ddl/DorisAlterWorkloadGroupStatement.java      | 41 +++++++++++
 .../ddl/dialect/doris/DorisDDLStatementAssert.java |  5 ++
 .../DorisAlterWorkloadGroupStatementAssert.java    | 77 ++++++++++++++++++++
 .../cases/parser/jaxb/RootSQLParserTestCases.java  |  4 ++
 .../workloadgroup/ExpectedWorkloadGroupName.java   | 34 +++++++++
 .../DorisAlterWorkloadGroupStatementTestCase.java  | 43 +++++++++++
 .../src/main/resources/case/ddl/alter-database.xml |  5 ++
 .../resources/case/ddl/alter-workload-group.xml    | 41 +++++++++++
 .../parser/src/main/resources/case/dml/select.xml  | 18 +++++
 .../resources/sql/supported/ddl/alter-database.xml |  5 ++
 .../sql/supported/ddl/alter-workload-group.xml     | 23 ++++++
 .../main/resources/sql/supported/dml/select.xml    |  2 +
 .../main/resources/sql/unsupported/unsupported.xml |  2 +
 .../doris/InternalUnsupportedDorisParserIT.java    | 25 +++++++
 19 files changed, 511 insertions(+), 6 deletions(-)

diff --git 
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DDLStatement.g4 
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DDLStatement.g4
index ec521a74c48..163e3636309 100644
--- 
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DDLStatement.g4
+++ 
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DDLStatement.g4
@@ -32,6 +32,9 @@ alterStatement
     | alterCatalog
     | alterStoragePolicy
     | alterColocateGroup
+    // DORIS ADDED BEGIN
+    | alterWorkloadGroup
+    // DORIS ADDED END
     ;
 
 createTable
@@ -173,6 +176,12 @@ alterColocateGroup
     : ALTER COLOCATE GROUP (databaseName DOT_)? identifier SET LP_ properties 
RP_
     ;
 
+// DORIS ADDED BEGIN
+alterWorkloadGroup
+    : ALTER WORKLOAD GROUP identifier propertiesClause
+    ;
+// DORIS ADDED END
+
 tableConstraintDef
     : keyOrIndex indexName? indexTypeClause? keyListWithExpression indexOption*
     | FULLTEXT keyOrIndex? indexName? keyListWithExpression 
fulltextIndexOption*
@@ -317,10 +326,19 @@ createDatabase
 alterDatabase
     : ALTER (DATABASE | SCHEMA) databaseName? alterDatabaseSpecification_*
     | ALTER (DATABASE | SCHEMA) databaseName RENAME identifier
-    | ALTER (DATABASE | SCHEMA) databaseName SET (DATA | REPLICA | 
TRANSACTION) QUOTA NUMBER_
+    // DORIS CHANGED BEGIN
+    | ALTER (DATABASE | SCHEMA) databaseName SET DATA QUOTA dataQuotaValue
+    | ALTER (DATABASE | SCHEMA) databaseName SET (REPLICA | TRANSACTION) QUOTA 
NUMBER_
+    // DORIS CHANGED END
     | ALTER (DATABASE | SCHEMA) databaseName SET PROPERTIES LP_ properties RP_
     ;
 
+// DORIS ADDED BEGIN
+dataQuotaValue
+    : FILESIZE_LITERAL | NUMBER_ | IDENTIFIER_
+    ;
+// DORIS ADDED END
+
 createDatabaseSpecification_
     : defaultCharset
     | defaultCollation
diff --git 
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DorisKeyword.g4 
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DorisKeyword.g4
index 120f6094333..691c00da3b4 100644
--- 
a/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DorisKeyword.g4
+++ 
b/parser/sql/engine/dialect/doris/src/main/antlr4/imports/doris/DorisKeyword.g4
@@ -3352,9 +3352,11 @@ WORK
     : W O R K
     ;
 
+// DORIS ADDED BEGIN
 WORKLOAD
     : W O R K L O A D
     ;
+// DORIS ADDED END
 
 WRAPPER
     : W R A P P E R
diff --git 
a/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDDLStatementVisitor.java
 
b/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDDLStatementVisitor.java
index 6d44e2a89c5..4d45d80ac61 100644
--- 
a/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDDLStatementVisitor.java
+++ 
b/parser/sql/engine/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisDDLStatementVisitor.java
@@ -21,6 +21,7 @@ import com.google.common.base.Preconditions;
 import org.antlr.v4.runtime.ParserRuleContext;
 import org.antlr.v4.runtime.RuleContext;
 import org.antlr.v4.runtime.misc.Interval;
+import org.antlr.v4.runtime.tree.TerminalNode;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
 import org.apache.shardingsphere.sql.parser.api.ASTNode;
 import 
org.apache.shardingsphere.sql.parser.api.visitor.statement.type.DDLStatementVisitor;
@@ -54,6 +55,7 @@ import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AlterTa
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AlterTablespaceInnodbContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AlterTablespaceNdbContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AlterViewContext;
+import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.AlterWorkloadGroupContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.BeginStatementContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.BinlogDescriptionContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.BuildIndexContext;
@@ -87,6 +89,7 @@ import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateT
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateTablespaceContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateTriggerContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.CreateViewContext;
+import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DataQuotaValueContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DeallocateContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DistributedbyClauseContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.DorisDropFunctionContext;
@@ -154,6 +157,7 @@ import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.Truncat
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.ValidStatementContext;
 import 
org.apache.shardingsphere.sql.parser.autogen.DorisStatementParser.WhileStatementContext;
 import 
org.apache.shardingsphere.sql.parser.engine.doris.visitor.statement.DorisStatementVisitor;
+import 
org.apache.shardingsphere.sql.parser.engine.exception.SQLParsingException;
 import 
org.apache.shardingsphere.sql.parser.statement.core.enums.AlgorithmOption;
 import 
org.apache.shardingsphere.sql.parser.statement.core.enums.LockTableOption;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dal.PartitionSegment;
@@ -216,6 +220,7 @@ import 
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.table.Ren
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.table.ReplaceTableDefinitionSegment;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.tablespace.TablespaceSegment;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.view.ViewColumnSegment;
+import 
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.workloadgroup.WorkloadGroupNameSegment;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dml.column.ColumnSegment;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.ExpressionSegment;
 import 
org.apache.shardingsphere.sql.parser.statement.core.segment.dml.expr.simple.SimpleExpressionSegment;
@@ -271,6 +276,7 @@ import 
org.apache.shardingsphere.sql.parser.statement.core.value.collection.Coll
 import 
org.apache.shardingsphere.sql.parser.statement.core.value.identifier.IdentifierValue;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisAlterColocateGroupStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisAlterStoragePolicyStatement;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisAlterWorkloadGroupStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisCreateFunctionStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisCreateJobStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisCreateStreamingJobStatement;
@@ -362,15 +368,16 @@ public final class DorisDDLStatementVisitor extends 
DorisStatementVisitor implem
         if (null != ctx.RENAME() && null != ctx.identifier()) {
             result.setRenameDatabaseName(new 
IdentifierValue(ctx.identifier().getText()).getValue());
         }
-        if (null != ctx.QUOTA() && null != ctx.NUMBER_()) {
-            if (null != ctx.DATA()) {
-                result.setQuotaType("DATA");
-            } else if (null != ctx.REPLICA()) {
+        if (null != ctx.QUOTA() && null != ctx.DATA() && null != 
ctx.dataQuotaValue()) {
+            result.setQuotaType("DATA");
+            result.setQuotaValue(getDataQuotaValue(ctx.dataQuotaValue()));
+        } else if (null != ctx.QUOTA() && null != ctx.NUMBER_()) {
+            if (null != ctx.REPLICA()) {
                 result.setQuotaType("REPLICA");
             } else if (null != ctx.TRANSACTION()) {
                 result.setQuotaType("TRANSACTION");
             }
-            result.setQuotaValue(Long.parseLong(ctx.NUMBER_().getText()));
+            result.setQuotaValue(parseQuotaNumber(ctx.NUMBER_()));
         }
         if (null != ctx.PROPERTIES() && null != ctx.properties()) {
             PropertiesSegment propertiesSegment = new 
PropertiesSegment(ctx.properties().getStart().getStartIndex(), 
ctx.properties().getStop().getStopIndex());
@@ -385,6 +392,64 @@ public final class DorisDDLStatementVisitor extends 
DorisStatementVisitor implem
         return result;
     }
     
+    private long getDataQuotaValue(final DataQuotaValueContext ctx) {
+        if (null != ctx.NUMBER_()) {
+            return parseQuotaNumber(ctx.NUMBER_());
+        }
+        TerminalNode token = null != ctx.FILESIZE_LITERAL() ? 
ctx.FILESIZE_LITERAL() : ctx.IDENTIFIER_();
+        String text = token.getText();
+        int unitIndex = 0;
+        while (unitIndex < text.length() && 
Character.isDigit(text.charAt(unitIndex))) {
+            unitIndex++;
+        }
+        long unitBytes = 0 == unitIndex ? 0L : 
getDataQuotaUnitBytes(text.substring(unitIndex));
+        if (0L == unitBytes) {
+            throw new SQLParsingException(String.format("Expected data quota 
value, got: %s", text), text, token.getSymbol().getLine());
+        }
+        try {
+            return Math.multiplyExact(Long.parseLong(text.substring(0, 
unitIndex)), unitBytes);
+        } catch (final ArithmeticException | NumberFormatException ex) {
+            throw new SQLParsingException(String.format("Data quota value out 
of range: %s", text), text, token.getSymbol().getLine());
+        }
+    }
+    
+    private long getDataQuotaUnitBytes(final String unit) {
+        switch (unit.toUpperCase()) {
+            case "":
+            case "B":
+                return 1L;
+            case "K":
+            case "KB":
+                return 1024L;
+            case "M":
+            case "MB":
+                return 1024L * 1024L;
+            case "G":
+            case "GB":
+                return 1024L * 1024L * 1024L;
+            case "T":
+            case "TB":
+                return 1024L * 1024L * 1024L * 1024L;
+            case "P":
+            case "PB":
+                return 1024L * 1024L * 1024L * 1024L * 1024L;
+            default:
+                return 0L;
+        }
+    }
+    
+    private long parseQuotaNumber(final TerminalNode token) {
+        String text = token.getText();
+        if (!text.chars().allMatch(Character::isDigit)) {
+            throw new SQLParsingException(String.format("Expected integer 
quota value, got: %s", text), text, token.getSymbol().getLine());
+        }
+        try {
+            return Long.parseLong(text);
+        } catch (final NumberFormatException ex) {
+            throw new SQLParsingException(String.format("Quota value out of 
range: %s", text), text, token.getSymbol().getLine());
+        }
+    }
+    
     @Override
     public ASTNode visitDropDatabase(final DropDatabaseContext ctx) {
         DropDatabaseStatement result = new 
DropDatabaseStatement(getDatabaseType(), new 
IdentifierValue(ctx.databaseName().getText()).getValue(), null != 
ctx.ifExists());
@@ -1522,6 +1587,14 @@ public final class DorisDDLStatementVisitor extends 
DorisStatementVisitor implem
         return new DorisAlterColocateGroupStatement(getDatabaseType(), 
groupSegment, propertiesSegment);
     }
     
+    @Override
+    public ASTNode visitAlterWorkloadGroup(final AlterWorkloadGroupContext 
ctx) {
+        IdentifierValue identifier = (IdentifierValue) visit(ctx.identifier());
+        WorkloadGroupNameSegment workloadGroupNameSegment = new 
WorkloadGroupNameSegment(ctx.identifier().getStart().getStartIndex(), 
ctx.identifier().getStop().getStopIndex(), identifier);
+        PropertiesSegment propertiesSegment = 
extractPropertiesSegment(ctx.propertiesClause());
+        return new DorisAlterWorkloadGroupStatement(getDatabaseType(), 
workloadGroupNameSegment, propertiesSegment);
+    }
+    
     private PropertiesSegment extractPropertiesSegment(final 
PropertiesClauseContext ctx) {
         PropertiesSegment result = new 
PropertiesSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex());
         for (PropertyContext each : ctx.properties().property()) {
diff --git 
a/parser/sql/engine/dialect/doris/src/test/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisAlterDatabaseQuotaValueTest.java
 
b/parser/sql/engine/dialect/doris/src/test/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisAlterDatabaseQuotaValueTest.java
new file mode 100644
index 00000000000..e11b61c1ce3
--- /dev/null
+++ 
b/parser/sql/engine/dialect/doris/src/test/java/org/apache/shardingsphere/sql/parser/engine/doris/visitor/statement/type/DorisAlterDatabaseQuotaValueTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package 
org.apache.shardingsphere.sql.parser.engine.doris.visitor.statement.type;
+
+import org.apache.shardingsphere.sql.parser.engine.api.CacheOption;
+import org.apache.shardingsphere.sql.parser.engine.api.SQLParserEngine;
+import 
org.apache.shardingsphere.sql.parser.engine.api.SQLStatementVisitorEngine;
+import 
org.apache.shardingsphere.sql.parser.engine.exception.SQLParsingException;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+class DorisAlterDatabaseQuotaValueTest {
+    
+    @ParameterizedTest(name = "{0}")
+    @ValueSource(strings = {"ALTER DATABASE db SET DATA QUOTA 99999999999P", 
"ALTER DATABASE db SET DATA QUOTA 99999999999999999999999",
+            "ALTER DATABASE db SET DATA QUOTA foo", "ALTER DATABASE db SET 
DATA QUOTA 1XB", "ALTER DATABASE db SET DATA QUOTA 1.5",
+            "ALTER DATABASE db SET REPLICA QUOTA 1.5", "ALTER DATABASE db SET 
TRANSACTION QUOTA 2.75"})
+    void assertInvalidQuotaValueRejected(final String sql) {
+        CacheOption cacheOption = new CacheOption(128, 1024L);
+        SQLParserEngine parserEngine = new SQLParserEngine("Doris", 
cacheOption);
+        SQLStatementVisitorEngine visitorEngine = new 
SQLStatementVisitorEngine("Doris");
+        assertThrows(SQLParsingException.class, () -> 
visitorEngine.visit(parserEngine.parse(sql, false)));
+    }
+}
diff --git 
a/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/ddl/workloadgroup/WorkloadGroupNameSegment.java
 
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/ddl/workloadgroup/WorkloadGroupNameSegment.java
new file mode 100644
index 00000000000..ca1aa031993
--- /dev/null
+++ 
b/parser/sql/statement/core/src/main/java/org/apache/shardingsphere/sql/parser/statement/core/segment/ddl/workloadgroup/WorkloadGroupNameSegment.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package 
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.workloadgroup;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.sql.parser.statement.core.segment.SQLSegment;
+import 
org.apache.shardingsphere.sql.parser.statement.core.value.identifier.IdentifierValue;
+
+/**
+ * Workload group name segment.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class WorkloadGroupNameSegment implements SQLSegment {
+    
+    private final int startIndex;
+    
+    private final int stopIndex;
+    
+    private final IdentifierValue identifier;
+    
+    /**
+     * Get workload group name.
+     *
+     * @return workload group name
+     */
+    public String getName() {
+        return identifier.getValue();
+    }
+}
diff --git 
a/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/ddl/DorisAlterWorkloadGroupStatement.java
 
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/ddl/DorisAlterWorkloadGroupStatement.java
new file mode 100644
index 00000000000..73446112283
--- /dev/null
+++ 
b/parser/sql/statement/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/statement/doris/ddl/DorisAlterWorkloadGroupStatement.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser.statement.doris.ddl;
+
+import lombok.Getter;
+import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
+import 
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property.PropertiesSegment;
+import 
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.workloadgroup.WorkloadGroupNameSegment;
+import 
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.DDLStatement;
+
+/**
+ * Alter workload group statement for Doris.
+ */
+@Getter
+public final class DorisAlterWorkloadGroupStatement extends DDLStatement {
+    
+    private final WorkloadGroupNameSegment workloadGroupName;
+    
+    private final PropertiesSegment properties;
+    
+    public DorisAlterWorkloadGroupStatement(final DatabaseType databaseType, 
final WorkloadGroupNameSegment workloadGroupName, final PropertiesSegment 
properties) {
+        super(databaseType);
+        this.workloadGroupName = workloadGroupName;
+        this.properties = properties;
+    }
+}
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisDDLStatementAssert.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisDDLStatementAssert.java
index 081f89db54d..d1e86cc31f9 100644
--- 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisDDLStatementAssert.java
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/DorisDDLStatementAssert.java
@@ -22,6 +22,7 @@ import lombok.NoArgsConstructor;
 import 
org.apache.shardingsphere.sql.parser.statement.core.statement.type.ddl.DDLStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisAlterColocateGroupStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisAlterStoragePolicyStatement;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisAlterWorkloadGroupStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisCreateFunctionStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisDropFunctionStatement;
 import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisCancelMaterializedViewTaskStatement;
@@ -39,9 +40,11 @@ import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisCreateSyncJ
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.doris.type.DorisAlterColocateGroupStatementAssert;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.doris.type.DorisAlterStoragePolicyStatementAssert;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.doris.type.DorisAlterWorkloadGroupStatementAssert;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.SQLParserTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisAlterColocateGroupStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisAlterStoragePolicyStatementTestCase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisAlterWorkloadGroupStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisCreateJobStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisDropFunctionStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisCancelMaterializedViewTaskStatementTestCase;
@@ -91,6 +94,8 @@ public final class DorisDDLStatementAssert {
             DorisCreateJobStatementAssert.assertIs(assertContext, 
(DorisCreateJobStatement) actual, (DorisCreateJobStatementTestCase) expected);
         } else if (actual instanceof DorisAlterColocateGroupStatement) {
             DorisAlterColocateGroupStatementAssert.assertIs(assertContext, 
(DorisAlterColocateGroupStatement) actual, 
(DorisAlterColocateGroupStatementTestCase) expected);
+        } else if (actual instanceof DorisAlterWorkloadGroupStatement) {
+            DorisAlterWorkloadGroupStatementAssert.assertIs(assertContext, 
(DorisAlterWorkloadGroupStatement) actual, 
(DorisAlterWorkloadGroupStatementTestCase) expected);
         } else if (actual instanceof DorisPauseJobStatement) {
             DorisPauseJobStatementAssert.assertIs(assertContext, 
(DorisPauseJobStatement) actual, (DorisPauseJobStatementTestCase) expected);
         } else if (actual instanceof DorisDropJobStatement) {
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/type/DorisAlterWorkloadGroupStatementAssert.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/type/DorisAlterWorkloadGroupStatementAssert.java
new file mode 100644
index 00000000000..81915908c2d
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/ddl/dialect/doris/type/DorisAlterWorkloadGroupStatementAssert.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.ddl.dialect.doris.type;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import 
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property.PropertiesSegment;
+import 
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.property.PropertySegment;
+import 
org.apache.shardingsphere.sql.parser.statement.core.segment.ddl.workloadgroup.WorkloadGroupNameSegment;
+import 
org.apache.shardingsphere.sql.parser.statement.doris.ddl.DorisAlterWorkloadGroupStatement;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.catalog.ExpectedCatalogProperty;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisAlterWorkloadGroupStatementTestCase;
+
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Alter workload group statement assert for Doris.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DorisAlterWorkloadGroupStatementAssert {
+    
+    /**
+     * Assert alter workload group statement is correct with expected parser 
result.
+     *
+     * @param assertContext assert context
+     * @param actual actual alter workload group statement
+     * @param expected expected alter workload group statement test case
+     */
+    public static void assertIs(final SQLCaseAssertContext assertContext, 
final DorisAlterWorkloadGroupStatement actual, final 
DorisAlterWorkloadGroupStatementTestCase expected) {
+        assertWorkloadGroupName(assertContext, actual, expected);
+        assertProperties(assertContext, actual, expected);
+    }
+    
+    private static void assertWorkloadGroupName(final SQLCaseAssertContext 
assertContext, final DorisAlterWorkloadGroupStatement actual, final 
DorisAlterWorkloadGroupStatementTestCase expected) {
+        if (null != expected.getWorkloadGroupName()) {
+            WorkloadGroupNameSegment actualSegment = 
actual.getWorkloadGroupName();
+            assertThat(assertContext.getText("Workload group name assertion 
error: "), actualSegment.getName(), 
is(expected.getWorkloadGroupName().getName()));
+            SQLSegmentAssert.assertIs(assertContext, actualSegment, 
expected.getWorkloadGroupName());
+        }
+    }
+    
+    private static void assertProperties(final SQLCaseAssertContext 
assertContext, final DorisAlterWorkloadGroupStatement actual, final 
DorisAlterWorkloadGroupStatementTestCase expected) {
+        if (null == expected.getProperties()) {
+            return;
+        }
+        PropertiesSegment actualProperties = actual.getProperties();
+        SQLSegmentAssert.assertIs(assertContext, actualProperties, 
expected.getProperties());
+        assertThat(assertContext.getText("Properties size assertion error: "), 
actualProperties.getProperties().size(), 
is(expected.getProperties().getProperties().size()));
+        for (int i = 0; i < expected.getProperties().getProperties().size(); 
i++) {
+            assertProperty(assertContext, 
actualProperties.getProperties().get(i), 
expected.getProperties().getProperties().get(i));
+        }
+    }
+    
+    private static void assertProperty(final SQLCaseAssertContext 
assertContext, final PropertySegment actual, final ExpectedCatalogProperty 
expected) {
+        assertThat(assertContext.getText(String.format("Property key '%s' 
assertion error: ", expected.getKey())), actual.getKey(), 
is(expected.getKey()));
+        assertThat(assertContext.getText(String.format("Property value for key 
'%s' assertion error: ", expected.getKey())), actual.getValue(), 
is(expected.getValue()));
+        SQLSegmentAssert.assertIs(assertContext, actual, expected);
+    }
+}
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
index 5400b91a367..de01892d8dd 100644
--- 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/RootSQLParserTestCases.java
@@ -155,6 +155,7 @@ import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.s
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisAlterColocateGroupStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisAlterJobStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisAlterStoragePolicyStatementTestCase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisAlterWorkloadGroupStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisCancelMaterializedViewTaskStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisCancelTaskStatementTestCase;
 import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris.DorisCreateJobStatementTestCase;
@@ -1024,6 +1025,9 @@ public final class RootSQLParserTestCases {
     @XmlElement(name = "alter-colocate-group")
     private final List<DorisAlterColocateGroupStatementTestCase> 
alterColocateGroupTestCases = new LinkedList<>();
     
+    @XmlElement(name = "alter-workload-group")
+    private final List<DorisAlterWorkloadGroupStatementTestCase> 
alterWorkloadGroupTestCases = new LinkedList<>();
+    
     @XmlElement(name = "drop-package")
     private final List<OracleDropPackageStatementTestCase> 
dropPackageTestCases = new LinkedList<>();
     
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/workloadgroup/ExpectedWorkloadGroupName.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/workloadgroup/ExpectedWorkloadGroupName.java
new file mode 100644
index 00000000000..dd9f2a14514
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/workloadgroup/ExpectedWorkloadGroupName.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.workloadgroup;
+
+import lombok.Getter;
+import lombok.Setter;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.AbstractExpectedIdentifierSQLSegment;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+
+/**
+ * Expected workload group name.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class ExpectedWorkloadGroupName extends 
AbstractExpectedIdentifierSQLSegment {
+}
diff --git 
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/dialect/doris/DorisAlterWorkloadGroupStatementTestCase.java
 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/dialect/doris/DorisAlterWorkloadGroupStatementTestCase.java
new file mode 100644
index 00000000000..6f50132fc27
--- /dev/null
+++ 
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/statement/ddl/dialect/doris/DorisAlterWorkloadGroupStatementTestCase.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.statement.ddl.dialect.doris;
+
+import lombok.Getter;
+import lombok.Setter;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.SQLParserTestCase;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.catalog.ExpectedCatalogProperties;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.workloadgroup.ExpectedWorkloadGroupName;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * Alter workload group statement test case for Doris.
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@Getter
+@Setter
+public final class DorisAlterWorkloadGroupStatementTestCase extends 
SQLParserTestCase {
+    
+    @XmlElement(name = "workload-group-name")
+    private ExpectedWorkloadGroupName workloadGroupName;
+    
+    @XmlElement(name = "properties")
+    private ExpectedCatalogProperties properties;
+}
diff --git a/test/it/parser/src/main/resources/case/ddl/alter-database.xml 
b/test/it/parser/src/main/resources/case/ddl/alter-database.xml
index fba0c237234..2eb4c0bae3d 100644
--- a/test/it/parser/src/main/resources/case/ddl/alter-database.xml
+++ b/test/it/parser/src/main/resources/case/ddl/alter-database.xml
@@ -100,6 +100,11 @@
     <alter-database sql-case-id="alter_schema_set_managedlocation" />
     <alter-database sql-case-id="alter_database_set_lc_messages" />
     <alter-database sql-case-id="alter_database_set_data_quota" 
database-name="example_db" quota-type="DATA" quota-value="10995116277760" />
+    <alter-database sql-case-id="alter_database_set_data_quota_with_unit" 
database-name="example_db" quota-type="DATA" quota-value="107374182400" />
+    <alter-database 
sql-case-id="alter_database_set_data_quota_with_two_letter_unit" 
database-name="example_db" quota-type="DATA" quota-value="1073741824" />
+    <alter-database 
sql-case-id="alter_database_set_data_quota_with_petabyte_unit" 
database-name="example_db" quota-type="DATA" quota-value="1125899906842624" />
+    <alter-database 
sql-case-id="alter_database_set_data_quota_with_lowercase_unit" 
database-name="example_db" quota-type="DATA" quota-value="107374182400" />
+    <alter-database sql-case-id="alter_database_set_data_quota_with_byte_unit" 
database-name="example_db" quota-type="DATA" quota-value="500" />
     <alter-database sql-case-id="alter_database_set_replica_quota" 
database-name="test_db" quota-type="REPLICA" quota-value="1024" />
     <alter-database sql-case-id="alter_database_set_transaction_quota" 
database-name="prod_db" quota-type="TRANSACTION" quota-value="1000" />
     <alter-database sql-case-id="alter_database_rename_doris" 
database-name="old_db" rename-database-name="new_db" />
diff --git 
a/test/it/parser/src/main/resources/case/ddl/alter-workload-group.xml 
b/test/it/parser/src/main/resources/case/ddl/alter-workload-group.xml
new file mode 100644
index 00000000000..d18bb18fc15
--- /dev/null
+++ b/test/it/parser/src/main/resources/case/ddl/alter-workload-group.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<sql-parser-test-cases>
+    <alter-workload-group sql-case-id="alter_workload_group_max_cpu_percent">
+        <workload-group-name name="g2" start-index="21" stop-index="22" />
+        <properties start-index="24" stop-index="60">
+            <property key="max_cpu_percent" value="10%" start-index="35" 
stop-index="59" />
+        </properties>
+    </alter-workload-group>
+
+    <alter-workload-group 
sql-case-id="alter_workload_group_read_bytes_per_second">
+        <workload-group-name name="g2" start-index="21" stop-index="22" />
+        <properties start-index="24" stop-index="72">
+            <property key="read_bytes_per_second" value="104857600" 
start-index="35" stop-index="71" />
+        </properties>
+    </alter-workload-group>
+
+    <alter-workload-group 
sql-case-id="alter_workload_group_multiple_properties">
+        <workload-group-name name="g3" start-index="21" stop-index="22" />
+        <properties start-index="24" stop-index="79">
+            <property key="cpu_share" value="1024" start-index="35" 
stop-index="54" />
+            <property key="memory_limit" value="30%" start-index="57" 
stop-index="78" />
+        </properties>
+    </alter-workload-group>
+</sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/case/dml/select.xml 
b/test/it/parser/src/main/resources/case/dml/select.xml
index a86a731d429..49041a94d41 100644
--- a/test/it/parser/src/main/resources/case/dml/select.xml
+++ b/test/it/parser/src/main/resources/case/dml/select.xml
@@ -239,6 +239,24 @@
         </from>
     </select>
 
+    <select sql-case-id="select_digit_leading_column_doris">
+        <projections start-index="7" stop-index="9">
+            <column-projection name="1GB" start-index="7" stop-index="9" />
+        </projections>
+        <from>
+            <simple-table name="t" start-index="16" stop-index="16" />
+        </from>
+    </select>
+
+    <select sql-case-id="select_workload_keyword_column_doris">
+        <projections start-index="7" stop-index="14">
+            <column-projection name="workload" start-index="7" stop-index="14" 
/>
+        </projections>
+        <from>
+            <simple-table name="t" start-index="21" stop-index="21" />
+        </from>
+    </select>
+
     <select sql-case-id="select_with_default_str">
         <projections start-index="7" stop-index="7">
             <shorthand-projection start-index="7" stop-index="7" />
diff --git 
a/test/it/parser/src/main/resources/sql/supported/ddl/alter-database.xml 
b/test/it/parser/src/main/resources/sql/supported/ddl/alter-database.xml
index 12fd6f3a434..f7f383b1ebf 100644
--- a/test/it/parser/src/main/resources/sql/supported/ddl/alter-database.xml
+++ b/test/it/parser/src/main/resources/sql/supported/ddl/alter-database.xml
@@ -100,6 +100,11 @@
     <sql-case id="alter_schema_set_managedlocation" value="ALTER SCHEMA 
test_db SET MANAGEDLOCATION 
'hdfs://namenode:8020/user/hive/managed/another_test_db';" db-types="Hive" />
     <sql-case id="alter_database_set_lc_messages" value="ALTER DATABASE 
&quot;regression&quot; SET lc_messages TO 'C'" db-types="PostgreSQL" />
     <sql-case id="alter_database_set_data_quota" value="ALTER DATABASE 
example_db SET DATA QUOTA 10995116277760" db-types="Doris" />
+    <sql-case id="alter_database_set_data_quota_with_unit" value="ALTER 
DATABASE example_db SET DATA QUOTA 100G" db-types="Doris" />
+    <sql-case id="alter_database_set_data_quota_with_two_letter_unit" 
value="ALTER DATABASE example_db SET DATA QUOTA 1GB" db-types="Doris" />
+    <sql-case id="alter_database_set_data_quota_with_petabyte_unit" 
value="ALTER DATABASE example_db SET DATA QUOTA 1P" db-types="Doris" />
+    <sql-case id="alter_database_set_data_quota_with_lowercase_unit" 
value="ALTER DATABASE example_db SET DATA QUOTA 100g" db-types="Doris" />
+    <sql-case id="alter_database_set_data_quota_with_byte_unit" value="ALTER 
DATABASE example_db SET DATA QUOTA 500B" db-types="Doris" />
     <sql-case id="alter_database_set_replica_quota" value="ALTER DATABASE 
test_db SET REPLICA QUOTA 1024" db-types="Doris" />
     <sql-case id="alter_database_set_transaction_quota" value="ALTER DATABASE 
prod_db SET TRANSACTION QUOTA 1000" db-types="Doris" />
     <sql-case id="alter_database_rename_doris" value="ALTER DATABASE old_db 
RENAME new_db" db-types="Doris" />
diff --git 
a/test/it/parser/src/main/resources/sql/supported/ddl/alter-workload-group.xml 
b/test/it/parser/src/main/resources/sql/supported/ddl/alter-workload-group.xml
new file mode 100644
index 00000000000..f55e0ea11d0
--- /dev/null
+++ 
b/test/it/parser/src/main/resources/sql/supported/ddl/alter-workload-group.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<sql-cases>
+    <sql-case id="alter_workload_group_max_cpu_percent" value="ALTER WORKLOAD 
GROUP g2 PROPERTIES(&quot;max_cpu_percent&quot; = &quot;10%&quot;)" 
db-types="Doris" />
+    <sql-case id="alter_workload_group_read_bytes_per_second" value="ALTER 
WORKLOAD GROUP g2 PROPERTIES(&quot;read_bytes_per_second&quot; = 
&quot;104857600&quot;)" db-types="Doris" />
+    <sql-case id="alter_workload_group_multiple_properties" value="ALTER 
WORKLOAD GROUP g3 PROPERTIES(&quot;cpu_share&quot; = &quot;1024&quot;, 
&quot;memory_limit&quot; = &quot;30%&quot;)" db-types="Doris" />
+</sql-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dml/select.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/select.xml
index 4a3ff4998a0..14085a24476 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/select.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/select.xml
@@ -25,6 +25,8 @@
     <sql-case id="select_with_latin1" value="select _latin1'B' collate 
latin1_bin in (_latin1'a',_latin1'b')" db-types="MySQL" />
     <sql-case id="select_with_default_str" value="select * from t1 where str 
&lt;&gt; default(str)" db-types="MySQL" />
     <sql-case id="select_three_part_column_doris" value="SELECT db1.t1.c1 FROM 
db1.t1" db-types="Doris" />
+    <sql-case id="select_digit_leading_column_doris" value="SELECT 1GB FROM t" 
db-types="Doris" />
+    <sql-case id="select_workload_keyword_column_doris" value="SELECT workload 
FROM t" db-types="Doris" />
     <sql-case id="select_subquery_excpet" value="select * from (select * from 
t1 except all select * from t1 limit 2) a" db-types="MySQL" />
     <sql-case id="select_point_function_with_in" value="SELECT point(1,1) IN 
('1',1,'1') AS res" db-types="MySQL" />
     <sql-case id="select_with_in" value="SELECT b, b IN ('20161213'), b in 
('20161213', 0) FROM t2" db-types="MySQL" />
diff --git a/test/it/parser/src/main/resources/sql/unsupported/unsupported.xml 
b/test/it/parser/src/main/resources/sql/unsupported/unsupported.xml
index 77b9c5767cd..8725fc3f086 100644
--- a/test/it/parser/src/main/resources/sql/unsupported/unsupported.xml
+++ b/test/it/parser/src/main/resources/sql/unsupported/unsupported.xml
@@ -29,6 +29,8 @@
     <sql-case id="create_temp_table" value="create temp table old_oids as 
select relname, oid as oldoid, relfilenode as oldfilenode from pg_class where 
relname like 'at_partitioned%'" db-types="PostgreSQL" />
     <sql-case id="select_case_when" value="select relname,c.oid = oldoid as 
orig_oid,case relfilenode when 0 then 'none' when c.oid then 'own' when 
oldfilenode then 'orig' else 'OTHER' end as storage, obj_description(c.oid, 
'pg_class') as desc from pg_class c left join old_oids using (relname) where 
relname like 'at_partitioned%' order by relname" db-types="PostgreSQL" />
     <sql-case id="unsupported_select_json_value_on_error_for_doris" 
value="SELECT JSON_VALUE('{&quot;price&quot;: &quot;49.95&quot;}', '$.price' 
RETURNING DECIMAL(4,1) null on empty default 0 on error)" db-types="Doris" />
+    <sql-case 
id="unsupported_alter_database_set_replica_quota_with_unit_for_doris" 
value="ALTER DATABASE example_db SET REPLICA QUOTA 1G" db-types="Doris" />
+    <sql-case 
id="unsupported_alter_database_set_transaction_quota_with_unit_for_doris" 
value="ALTER DATABASE example_db SET TRANSACTION QUOTA 1G" db-types="Doris" />
     <sql-case id="select_like" value="select conname, obj_description(oid, 
'pg_constraint') as desc from pg_constraint where conname like 
'at_partitioned%' order by conname" db-types="PostgreSQL" />
     <sql-case id="select_keyword" value="select relname,c.oid = oldoid as 
orig_oid,case relfilenode when 0 then 'none' when c.oid then 'own' when 
oldfilenode then 'orig' else 'OTHER' end as storage, obj_description(c.oid, 
'pg_class') as desc from pg_class c left join old_oids using (relname) where 
relname like 'at_partitioned%' order by relname" db-types="PostgreSQL" />
     <sql-case id="unsupported_date_literal_for_clickhouse" value="SELECT DATE 
'2024-01-01'" db-types="ClickHouse" />
diff --git 
a/test/it/parser/src/test/java/org/apache/shardingsphere/test/it/sql/parser/doris/InternalUnsupportedDorisParserIT.java
 
b/test/it/parser/src/test/java/org/apache/shardingsphere/test/it/sql/parser/doris/InternalUnsupportedDorisParserIT.java
new file mode 100644
index 00000000000..86ae26c987a
--- /dev/null
+++ 
b/test/it/parser/src/test/java/org/apache/shardingsphere/test/it/sql/parser/doris/InternalUnsupportedDorisParserIT.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.test.it.sql.parser.doris;
+
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.InternalSQLParserITSettings;
+import 
org.apache.shardingsphere.test.it.sql.parser.internal.InternalUnsupportedSQLParserIT;
+
+@InternalSQLParserITSettings("Doris")
+class InternalUnsupportedDorisParserIT extends InternalUnsupportedSQLParserIT {
+}

Reply via email to