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/08/18 02:35:04 UTC

[GitHub] [incubator-doris] yangzhg commented on a change in pull request #4310: Support batch delete [part 1]

yangzhg commented on a change in pull request #4310:
URL: https://github.com/apache/incubator-doris/pull/4310#discussion_r471878551



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/AlterTableStmt.java
##########
@@ -70,6 +76,50 @@ 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 (table.getKeysType() != KeysType.UNIQUE_KEYS) {
+                    throw new AnalysisException("Batch delete only support in unique tables.");
+                }
+                // has rollup table
+                if (table.getVisibleIndex().size() > 1) {
+                    for (MaterializedIndex idx : table.getVisibleIndex()) {
+                        if (idx.getId() == table.getBaseIndexId()) {

Review comment:
       add  a column to rollup index it will add to base table automaticlly, if add a column here it will duplicated




----------------------------------------------------------------
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