You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ja...@apache.org on 2023/06/07 07:11:14 UTC
[doris] branch master updated: [fix](Nereids): union output can be Alias (#20532)
This is an automated email from the ASF dual-hosted git repository.
jakevin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 6b325a8458 [fix](Nereids): union output can be Alias<Slot> (#20532)
6b325a8458 is described below
commit 6b325a84581b4e1ee205b2a689f336baba6e3785
Author: jakevin <ja...@gmail.com>
AuthorDate: Wed Jun 7 15:11:07 2023 +0800
[fix](Nereids): union output can be Alias<Slot> (#20532)
---
.../doris/nereids/rules/rewrite/logical/AdjustNullable.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/logical/AdjustNullable.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/logical/AdjustNullable.java
index abf7940caa..f6d9d9eb04 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/logical/AdjustNullable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/logical/AdjustNullable.java
@@ -19,6 +19,7 @@ package org.apache.doris.nereids.rules.rewrite.logical;
import org.apache.doris.nereids.jobs.JobContext;
import org.apache.doris.nereids.properties.OrderKey;
+import org.apache.doris.nereids.trees.expressions.Alias;
import org.apache.doris.nereids.trees.expressions.ExprId;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.NamedExpression;
@@ -146,11 +147,12 @@ public class AdjustNullable extends DefaultPlanRewriter<Void> implements CustomR
List<NamedExpression> outputs = setOperation.getOutputs();
List<NamedExpression> newOutputs = Lists.newArrayListWithCapacity(outputs.size());
for (int i = 0; i < inputNullable.size(); i++) {
- SlotReference slotReference = (SlotReference) outputs.get(i);
+ NamedExpression ne = outputs.get(i);
+ Slot slot = ne instanceof Alias ? (Slot) ((Alias) ne).child() : (Slot) ne;
if (inputNullable.get(i)) {
- slotReference = slotReference.withNullable(true);
+ slot = slot.withNullable(true);
}
- newOutputs.add(slotReference);
+ newOutputs.add(ne instanceof Alias ? (NamedExpression) ne.withChildren(slot) : slot);
}
return setOperation.withNewOutputs(newOutputs).recomputeLogicalProperties();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org