dataroaring commented on code in PR #13410:
URL: https://github.com/apache/doris/pull/13410#discussion_r999365287
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java:
##########
@@ -4030,12 +4031,113 @@ public void replayRenamePartition(TableInfo tableInfo)
throws MetaNotFoundExcept
}
}
+ public void renameColumn(Database db, OlapTable table, String colName,
+ String newColName, boolean isReplay) throws DdlException {
+ if (table.getState() != OlapTableState.NORMAL) {
+ throw new DdlException("Table[" + table.getName() + "] is under "
+ table.getState());
+ }
+
+ if (colName.equalsIgnoreCase(newColName)) {
+ throw new DdlException("Same column name");
+ }
+
+ Map<Long, MaterializedIndexMeta> indexIdToMeta =
table.getIndexIdToMeta();
+ for (Map.Entry<Long, MaterializedIndexMeta> entry :
indexIdToMeta.entrySet()) {
+ // rename column is not implemented for table without column
unique id.
+ if (entry.getValue().getMaxColUniqueId() < 0) {
+ throw new DdlException("not implemented for table without
column unique id");
Review Comment:
same as above, users do not know what is column unique id, they know
property in create table statement.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]