This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch branch-3.0 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push: new 67de0c16504 branch-3.0: [fix](nereids) proper planning of shadow columns for load and schema change concurrent execution #49332 (#49338) 67de0c16504 is described below commit 67de0c16504202064cf1c835caead64e6b46c57b Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> AuthorDate: Sat Mar 22 17:03:05 2025 +0800 branch-3.0: [fix](nereids) proper planning of shadow columns for load and schema change concurrent execution #49332 (#49338) Cherry-picked from #49332 Co-authored-by: hui lai <lai...@selectdb.com> Co-authored-by: starocean999 <40539150+starocean...@users.noreply.github.com> --- .../apache/doris/nereids/rules/analysis/BindSink.java | 13 +++++++++++++ .../cloud/test_cloud_mow_new_tablet_compaction.out | Bin 206 -> 206 bytes .../cloud/test_cloud_mow_new_tablet_compaction.groovy | 4 ++-- 3 files changed, 15 insertions(+), 2 deletions(-) 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 7e6e9820e5d..189cc939a7a 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 @@ -293,6 +293,7 @@ public class BindSink implements AnalysisRuleFactory { NereidsParser expressionParser = new NereidsParser(); List<Column> generatedColumns = Lists.newArrayList(); 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.getGeneratedColumnInfo() != null) { @@ -301,6 +302,9 @@ public class BindSink implements AnalysisRuleFactory { } else 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: @@ -444,6 +448,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; } diff --git a/regression-test/data/fault_injection_p0/cloud/test_cloud_mow_new_tablet_compaction.out b/regression-test/data/fault_injection_p0/cloud/test_cloud_mow_new_tablet_compaction.out index 4f02f6683a2..94fefb2f2f3 100644 Binary files a/regression-test/data/fault_injection_p0/cloud/test_cloud_mow_new_tablet_compaction.out and b/regression-test/data/fault_injection_p0/cloud/test_cloud_mow_new_tablet_compaction.out differ diff --git a/regression-test/suites/fault_injection_p0/cloud/test_cloud_mow_new_tablet_compaction.groovy b/regression-test/suites/fault_injection_p0/cloud/test_cloud_mow_new_tablet_compaction.groovy index 467e9fddb43..ea510c03176 100644 --- a/regression-test/suites/fault_injection_p0/cloud/test_cloud_mow_new_tablet_compaction.groovy +++ b/regression-test/suites/fault_injection_p0/cloud/test_cloud_mow_new_tablet_compaction.groovy @@ -92,10 +92,10 @@ suite("test_cloud_mow_new_tablet_compaction", "nonConcurrent") { def threads = [] threads << Thread.start { sql "insert into ${table1} values(1,99,99,99),(3,99,99,99);"} ++end_ver - Thread.sleep(200) + Thread.sleep(2000) threads << Thread.start { sql "insert into ${table1} values(5,88,88,88),(1,88,88,88);" } ++end_ver - Thread.sleep(200) + Thread.sleep(2000) threads << Thread.start { sql "insert into ${table1} values(3,77,77,77),(5,77,77,77);" } ++end_ver Thread.sleep(2000) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org