You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/09/10 10:58:00 UTC

[GitHub] [incubator-doris] Youngwb commented on a change in pull request #4582: [Feature] Support alter table syntax for sequence column

Youngwb commented on a change in pull request #4582:
URL: https://github.com/apache/incubator-doris/pull/4582#discussion_r486247695



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/AlterTableStmt.java
##########
@@ -79,11 +82,28 @@ public void analyze(Analyzer analyzer) throws UserException {
     public void rewriteAlterClause(OlapTable table) throws UserException {
         List<AlterClause> clauses = new ArrayList<>();
         for (AlterClause alterClause : ops) {
-            if (alterClause instanceof EnableFeatureClause
-                    && ((EnableFeatureClause) alterClause).getFeature() == EnableFeatureClause.Features.BATCH_DELETE) {
+            if (alterClause instanceof EnableFeatureClause) {
+                EnableFeatureClause.Features alterFeature  = ((EnableFeatureClause) alterClause).getFeature();
+                if (alterFeature == null || alterFeature == EnableFeatureClause.Features.UNKNOWN) {
+                    throw new AnalysisException("unknown feature for alter clause");
+                }
                 if (table.getKeysType() != KeysType.UNIQUE_KEYS) {
-                    throw new AnalysisException("Batch delete only supported in unique tables.");
+                    throw new AnalysisException("enable feature only supported in unique tables now.");

Review comment:
       sequence column also only support UNIQUE_KEYS, and I add "now" in the exception for current  implementation, i think if we have feature for other tables in the future, we can change this check




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org