Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Lchangliang committed May 27, 2024
1 parent adbd05e commit 1fa4302
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,8 @@ private boolean processModifyColumn(ModifyColumnClause alterClause, OlapTable ol
for (Column column : schema) {
String columnName = column.getName();
if (column.isMaterializedViewColumn()) {
columnName = CreateMaterializedViewStmt.mvColumnBreaker(columnName);
columnName = MaterializedIndexMeta.normalizeName(
CreateMaterializedViewStmt.mvColumnBreaker(columnName));
}
if (columnName.equalsIgnoreCase(modColumn.getName())) {
otherIndexIds.add(entry.getKey());
Expand All @@ -691,7 +692,8 @@ private boolean processModifyColumn(ModifyColumnClause alterClause, OlapTable ol
Column col = otherIndexSchema.get(i);
String columnName = col.getName();
if (col.isMaterializedViewColumn()) {
columnName = CreateMaterializedViewStmt.mvColumnBreaker(columnName);
columnName = MaterializedIndexMeta.normalizeName(
CreateMaterializedViewStmt.mvColumnBreaker(columnName));
}
if (!columnName.equalsIgnoreCase(modColumn.getName())) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,10 +671,9 @@ public static String mvColumnBuilder(Optional<String> functionName, String sourc

public static String mvColumnBreaker(String name) {
if (name.startsWith(MATERIALIZED_VIEW_AGGREGATE_NAME_PREFIX)) {
// mva_SUM__`k2` -> k2
String columnName = name.substring(name.indexOf(MATERIALIZED_VIEW_AGGREGATE_NAME_LINK)
+ MATERIALIZED_VIEW_AGGREGATE_NAME_LINK.length());
return mvColumnBreaker(columnName.substring(1, columnName.length() - 1));
// mva_SUM__`k2` -> `k2`;
return mvColumnBreaker(name.substring(name.indexOf(MATERIALIZED_VIEW_AGGREGATE_NAME_LINK)
+ MATERIALIZED_VIEW_AGGREGATE_NAME_LINK.length()));
} else if (name.startsWith(MATERIALIZED_VIEW_NAME_PREFIX)) {
// mv_k2 -> k2
return mvColumnBreaker(name.substring(MATERIALIZED_VIEW_NAME_PREFIX.length()));
Expand Down

0 comments on commit 1fa4302

Please sign in to comment.