This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 0347e8a3c60 branch-2.1: proper planning of shadow columns for load and
schema change concurrent execution (#49332) (#50710)
0347e8a3c60 is described below
commit 0347e8a3c608299fd36c02dd8d86170c5dd38c8e
Author: hui lai <[email protected]>
AuthorDate: Fri May 9 11:15:08 2025 +0800
branch-2.1: proper planning of shadow columns for load and schema change
concurrent execution (#49332) (#50710)
---
.../org/apache/doris/nereids/rules/analysis/BindSink.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java
index 693dc0dfc22..acb9663caac 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java
@@ -292,11 +292,15 @@ public class BindSink implements AnalysisRuleFactory {
Map<Expression, Expression> replaceMap = Maps.newHashMap();
NereidsParser expressionParser = new NereidsParser();
List<Column> materializedViewColumn = Lists.newArrayList();
+ List<Column> shadowColumns = Lists.newArrayList();
// generate slots not mentioned in sql, mv slots and shaded slots.
for (Column column : boundSink.getTargetTable().getFullSchema()) {
if (column.isMaterializedViewColumn()) {
materializedViewColumn.add(column);
continue;
+ } else if (Column.isShadowColumn(column.getName())) {
+ shadowColumns.add(column);
+ continue;
}
if (columnToChildOutput.containsKey(column)
// do not process explicitly use DEFAULT value here:
@@ -423,6 +427,15 @@ public class BindSink implements AnalysisRuleFactory {
columnToOutput.put(column.getName(), output);
}
}
+ for (Column column : shadowColumns) {
+ NamedExpression expression =
columnToOutput.get(column.getNonShadowName());
+ if (expression != null) {
+ Alias alias = (Alias) expression;
+ Expression newExpr =
TypeCoercionUtils.castIfNotSameType(alias.child(),
+ DataType.fromCatalogType(column.getType()));
+ columnToOutput.put(column.getName(), new Alias(newExpr,
column.getName()));
+ }
+ }
return columnToOutput;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]