kangpinghuang commented on a change in pull request #2573: implements create drop show index syntax for bitmap index [#2487] URL: https://github.com/apache/incubator-doris/pull/2573#discussion_r361606624
########## File path: fe/src/main/java/org/apache/doris/qe/ShowExecutor.java ########## @@ -639,6 +643,35 @@ private void handleShowColumn() throws AnalysisException { resultSet = new ShowResultSet(showStmt.getMetaData(), rows); } + // Show index statement. + private void handleShowIndex() throws AnalysisException { + ShowIndexStmt showStmt = (ShowIndexStmt) stmt; + List<List<String>> rows = Lists.newArrayList(); + Database db = ctx.getCatalog().getDb(showStmt.getDbName()); + if (db != null) { + db.readLock(); + try { + Table table = db.getTable(showStmt.getTableName().getTbl()); + if (table != null && table instanceof OlapTable) { + List<Index> indexes = ((OlapTable) table).getIndexes(); + for (Index index : indexes) { + rows.add(Lists.newArrayList(showStmt.getTableName().toString(), index.getIndexName(), + index.getColumns().stream().collect(Collectors.joining(",")), + index.getType().name(), index.getComment())); + } + } else { + ErrorReport.reportAnalysisException(ErrorCode.ERR_BAD_TABLE_ERROR, + db.getFullName() + "." + showStmt.getTableName().toString()); + } + } finally { + db.readUnlock(); + } + } else { + ErrorReport.reportAnalysisException(ErrorCode.ERR_BAD_TABLE_ERROR, showStmt.getTableName().toString()); Review comment: BAD_DB? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org