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

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

commit 9c8510b99ae419e9ab5aa9a37de9edbcf7e62e7b
Author: HappenLee <[email protected]>
AuthorDate: Thu Jun 23 08:40:12 2022 +0800

    [fix][vectorized] Fix bug the of window function result not match plan 
nullable (#10340)
    
    Co-authored-by: lihaopeng <[email protected]>
---
 .../org/apache/doris/analysis/AggregateInfoBase.java   |  2 +-
 .../java/org/apache/doris/analysis/AnalyticInfo.java   | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/AggregateInfoBase.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/AggregateInfoBase.java
index ed016ef3f0..ad4dedd591 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/AggregateInfoBase.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/AggregateInfoBase.java
@@ -115,7 +115,7 @@ public abstract class AggregateInfoBase {
      * Also updates the appropriate substitution map, and creates and 
registers auxiliary
      * equality predicates between the grouping slots and the grouping exprs.
      */
-    private TupleDescriptor createTupleDesc(Analyzer analyzer, boolean 
isOutputTuple) {
+    protected TupleDescriptor createTupleDesc(Analyzer analyzer, boolean 
isOutputTuple) {
         TupleDescriptor result =
                 analyzer.getDescTbl().createTupleDescriptor(
                         tupleDebugName() + (isOutputTuple ? "-out" : 
"-intermed"));
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/AnalyticInfo.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/AnalyticInfo.java
index d1bf918576..ab3765ad29 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/AnalyticInfo.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/AnalyticInfo.java
@@ -105,6 +105,24 @@ public final class AnalyticInfo extends AggregateInfoBase {
         return result;
     }
 
+    /**
+     * Creates the intermediate and output tuple descriptors. If no agg expr 
has an
+     * intermediate type different from its output type, then only the output 
tuple
+     * descriptor is created and the intermediate tuple is set to the output 
tuple.
+     * TODO: Rethink we really need to use Analyticinfo be subclass of 
AggregateInfoBase,
+     * it seems only use the aggregateExprs
+     */
+    protected void createTupleDescs(Analyzer analyzer) {
+        // Create the intermediate tuple desc first, so that the tuple ids are 
increasing
+        // from bottom to top in the plan tree.
+        intermediateTupleDesc_ = createTupleDesc(analyzer, false);
+        if (requiresIntermediateTuple(aggregateExprs_, false)) {
+            outputTupleDesc_ = createTupleDesc(analyzer, true);
+        } else {
+            outputTupleDesc_ = intermediateTupleDesc_;
+        }
+    }
+
     /**
      * Returns the intersection of the partition exprs of all the
      * analytic functions.


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

Reply via email to