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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to