@@ -164,6 +164,7 @@ See that file for comments on specific nodes and fields.
164164 <a href =" #ResolvedDifferentialPrivacyAggregateScan " >ResolvedDifferentialPrivacyAggregateScan</a >
165165 <a href =" #ResolvedAnalyticScan " >ResolvedAnalyticScan</a >
166166 <a href =" #ResolvedArrayScan " >ResolvedArrayScan</a >
167+ <a href =" #ResolvedBarrierScan " >ResolvedBarrierScan</a >
167168 <a href =" #ResolvedExecuteAsRoleScan " >ResolvedExecuteAsRoleScan</a >
168169 <a href =" #ResolvedFilterScan " >ResolvedFilterScan</a >
169170 <a href =" #ResolvedGroupRowsScan " >ResolvedGroupRowsScan</a >
@@ -739,8 +740,28 @@ class ResolvedNonScalarFunctionCallBase : public <a href="#ResolvedFunctionCallB
739740
740741<p ><pre ><code class =" lang-c++ " >
741742<font color =" brown " >// An aggregate function call. The signature always has mode AGGREGATE.
742- // This node only ever shows up as the outer function call in a
743- // ResolvedAggregateScan::aggregate_list.</font >
743+ //
744+ // FEATURE_V_1_4_MULTILEVEL_AGGREGATION enables multi-level aggregate
745+ // expressions (e.g. ' ; SUM(AVG(1 + X) GROUP BY key)' ; ). The GROUP BY modifier
746+ // within an aggregate function body indicates the presence of a multi-level
747+ // aggregate expression.
748+ //
749+ // ` group_by_aggregate_list ` can only be present if ` group_by_list ` is
750+ // present. ` group_by_list ` and ` group_by_aggregate_list ` are mutually
751+ // exclusive with ` having_modifier ` .
752+ //
753+ // If ` group_by_list ` is empty, then standard column visibility rules apply
754+ // (i.e. columns supplied by input scan to the enclosing AggregateScan are
755+ // visible to argument expressions and aggregate function modifiers, as are
756+ // correlated columns).
757+ //
758+ // If ` group_by_list ` is non-empty, the initial aggregation is applied first,
759+ // computing the aggregate and grouping columns in ` group_by_aggregate_list `
760+ // ` group_by_list ` . Only these computed columns (plus correlated columns)
761+ // are visible to argument expressions and aggregate function modifiers
762+ // (e.g. DISTINCT, IGNORE / RESPECT NULLS, LIMIT, ORDER BY). These
763+ // modifiers are applied on the output rows from the initial aggregation,
764+ // as input to the final aggregation.</font >
744765class ResolvedAggregateFunctionCall : public <a href =" #ResolvedNonScalarFunctionCallBase " >ResolvedNonScalarFunctionCallBase</a > {
745766 static const ResolvedNodeKind TYPE = RESOLVED_AGGREGATE_FUNCTION_CALL;
746767
@@ -768,6 +789,21 @@ class ResolvedAggregateFunctionCall : public <a href="#ResolvedNonScalarFunction
768789 // fully-resolved function body in context of the actual concrete
769790 // types of the arguments provided to the function call.</font >
770791 const std::shared_ptr< ; <a href =" #ResolvedFunctionCallInfo " >ResolvedFunctionCallInfo</a >> ;& ; function_call_info() const;
792+
793+ <font color =" brown " > // Group the stream of input values by columns in this list, and
794+ // compute the aggregates defined in ` group_by_aggregate_list ` .
795+ // Used only for multi-level aggregation, when
796+ // FEATURE_V_1_4_MULTILEVEL_AGGREGATION is enabled.</font >
797+ const std::vector< ; std::unique_ptr< ; const <a href =" #ResolvedComputedColumnBase " >ResolvedComputedColumnBase</a >> ;> ;& ; group_by_list() const;
798+ int group_by_list_size() const;
799+ const <a href =" #ResolvedComputedColumnBase " >ResolvedComputedColumnBase</a >* group_by_list(int i) const;
800+
801+ <font color =" brown " > // Aggregate columns to compute over the grouping keys defined in
802+ // ` group_by_list ` . Used only for multi-level aggregation, when
803+ // FEATURE_V_1_4_MULTILEVEL_AGGREGATION is enabled.</font >
804+ const std::vector< ; std::unique_ptr< ; const <a href =" #ResolvedComputedColumnBase " >ResolvedComputedColumnBase</a >> ;> ;& ; group_by_aggregate_list() const;
805+ int group_by_aggregate_list_size() const;
806+ const <a href =" #ResolvedComputedColumnBase " >ResolvedComputedColumnBase</a >* group_by_aggregate_list(int i) const;
771807};
772808</code ></pre ></p >
773809
@@ -3167,7 +3203,7 @@ class ResolvedCreateIndexStmt : public <a href="#ResolvedCreateStatement">Resolv
31673203// [ OPTIONS (name=value, ...)]
31683204//
31693205// CREATE [ OR REPLACE] [ TEMP|TEMPORARY|PUBLIC|PRIVATE] EXTERNAL SCHEMA
3170- // [ IF NOT EXISTS] < ; name> ; WITH CONNECTION < ; connection> ;
3206+ // [ IF NOT EXISTS] < ; name> ; [ WITH CONNECTION] < ; connection> ;
31713207// OPTIONS (name=value, ...)
31723208//
31733209// < ; option_list> ; contains engine-specific options associated with the schema</font >
@@ -3209,7 +3245,7 @@ class ResolvedCreateSchemaStmt : public <a href="#ResolvedCreateSchemaStmtBase">
32093245<p ><pre ><code class =" lang-c++ " >
32103246<font color =" brown " >// This statement:
32113247// CREATE [ OR REPLACE] [ TEMP|TEMPORARY|PUBLIC|PRIVATE] EXTERNAL SCHEMA
3212- // [ IF NOT EXISTS] < ; name> ; WITH CONNECTION < ; connection> ;
3248+ // [ IF NOT EXISTS] < ; name> ; [ WITH CONNECTION] < ; connection> ;
32133249// OPTIONS (name=value, ...)
32143250//
32153251// < ; connection> ; encapsulates engine-specific metadata used to connect
@@ -4457,9 +4493,9 @@ class ResolvedAnalyticFunctionGroup : public <a href="#ResolvedArgument">Resolve
44574493
44584494 const <a href =" #ResolvedWindowOrdering " >ResolvedWindowOrdering</a >* order_by() const;
44594495
4460- const std::vector< ; std::unique_ptr< ; const <a href =" #ResolvedComputedColumn " >ResolvedComputedColumn </a >> ;> ;& ; analytic_function_list() const;
4496+ const std::vector< ; std::unique_ptr< ; const <a href =" #ResolvedComputedColumnBase " >ResolvedComputedColumnBase </a >> ;> ;& ; analytic_function_list() const;
44614497 int analytic_function_list_size() const;
4462- const <a href =" #ResolvedComputedColumn " >ResolvedComputedColumn </a >* analytic_function_list(int i) const;
4498+ const <a href =" #ResolvedComputedColumnBase " >ResolvedComputedColumnBase </a >* analytic_function_list(int i) const;
44634499};
44644500</code ></pre ></p >
44654501
@@ -5230,7 +5266,7 @@ class ResolvedPrivilege : public <a href="#ResolvedArgument">ResolvedArgument</a
52305266<font color =" brown " >// Common superclass of GRANT/REVOKE statements.
52315267//
52325268// < ; privilege_list> ; is the list of privileges to be granted/revoked. ALL
5233- // PRIVILEGES should be granted/fromed if it is empty.
5269+ // PRIVILEGES should be granted/revoked if it is empty.
52345270// < ; object_type_list> ; is an optional list of string identifiers, e.g., TABLE,
52355271// VIEW, MATERIALIZED VIEW.
52365272// < ; name_path> ; is a vector of segments of the object identifier' ; s pathname.
@@ -7623,3 +7659,27 @@ class ResolvedIdentityColumnInfo : public <a href="#ResolvedArgument">ResolvedAr
76237659};
76247660</code ></pre ></p >
76257661
7662+ ### ResolvedBarrierScan
7663+ <a id =" ResolvedBarrierScan " ></a >
7664+
7665+ <p ><pre ><code class =" lang-c++ " >
7666+ <font color =" brown " >// ResolvedBarrierScan marks an optimization barrier during query planning.
7667+ // It wraps an ` input_scan ` and ensures ` input_scan ` is evaluated as if
7668+ // ` input_scan ` stands alone; plan transformations that may cause
7669+ // different observable side effects may not cross the optimization barrier.
7670+ //
7671+ // The output rows of a ResolvedBarrierScan are the same as those of the
7672+ // ` input_scan ` , propagating the ` is_ordered ` property of ` input_scan ` .
7673+ //
7674+ // The following optimizations are allowed:
7675+ // * Prune an unused column of a ResolvedBarrierScan.
7676+ // * Prune the whole ResolvedBarrierScan.
7677+ //
7678+ // This node does not have a corresponding syntax.</font >
7679+ class ResolvedBarrierScan : public <a href =" #ResolvedScan " >ResolvedScan</a > {
7680+ static const ResolvedNodeKind TYPE = RESOLVED_BARRIER_SCAN;
7681+
7682+ const <a href =" #ResolvedScan " >ResolvedScan</a >* input_scan() const;
7683+ };
7684+ </code ></pre ></p >
7685+
0 commit comments