This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch dev-1.1.2
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/dev-1.1.2 by this push:
     new 32f95c269a [fix](sort)the sort expr nullable info is wrong in some 
case (#12003)
32f95c269a is described below

commit 32f95c269aa77b455e2118fdd2298459dc727733
Author: starocean999 <[email protected]>
AuthorDate: Wed Aug 24 14:26:09 2022 +0800

    [fix](sort)the sort expr nullable info is wrong in some case (#12003)
---
 fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java
index e7b6432ea0..543273c7ff 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/SortInfo.java
@@ -228,6 +228,11 @@ public class SortInfo {
      */
     public ExprSubstitutionMap createMaterializedOrderExprs(
             TupleDescriptor sortTupleDesc, Analyzer analyzer) {
+        // the sort node exprs may come from the child outer join node
+        // we need change the slots to nullable from all outer join nullable 
side temporarily
+        // then the sort node expr would have correct nullable info
+        // after create the output tuple we need revert the change by call 
analyzer.changeSlotsToNotNullable(slots)
+        List<SlotDescriptor> slots = 
analyzer.changeSlotToNullableOfOuterJoinedTuples();
         ExprSubstitutionMap substOrderBy = new ExprSubstitutionMap();
         for (Expr origOrderingExpr : orderingExprs_) {
             // TODO(zc): support materialized order exprs
@@ -251,6 +256,7 @@ public class SortInfo {
                 materializedOrderingExprs_.add(origOrderingExpr);
             }
         }
+        analyzer.changeSlotsToNotNullable(slots);
         return substOrderBy;
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to