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/02/11 13:45:35 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #2883: add column type check when create bitmap index using create index clause

morningman commented on a change in pull request #2883: add column type check when create bitmap index using create index clause
URL: https://github.com/apache/incubator-doris/pull/2883#discussion_r377640999
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/alter/Alter.java
 ##########
 @@ -200,12 +202,39 @@ public void processAlterTable(AlterTableStmt stmt) throws UserException {
                         }
                         Set<String> idxSet = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
                         idxSet.addAll(idx.getColumns());
-                            if (newColset.equals(idxSet)) {
-                                throw new AnalysisException("index for columns (" + String
-                                        .join(",", indexDef.getColumns()) + " ) already exist.");
+                        if (newColset.equals(idxSet)) {
+                            throw new AnalysisException("index for columns (" + String
+                                    .join(",", indexDef.getColumns()) + " ) already exist.");
+                        }
+                    }
+                    OlapTable olapTable = (OlapTable) table;
+                    for (String col : indexDef.getColumns()) {
+                        for (Column c : olapTable.getFullSchema()) {
 
 Review comment:
   You can just use `olapTable.getColumn()` to get the column, no need to iterate all columns

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


With regards,
Apache Git Services

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