162014 {
162018
162019 for (
idx_t expr_idx = 0; expr_idx < expressions.size(); expr_idx++) {
162020 auto &expr = *expressions[expr_idx];
162021 auto &wexpr = expr.Cast<BoundWindowExpression>();
162022 switch (expr.GetExpressionType()) {
162023 case ExpressionType::WINDOW_AGGREGATE:
162024 aggregate_states[expr_idx] = make_uniq<AggregateState>(context, wexpr, allocator);
162025 break;
162026 case ExpressionType::WINDOW_FIRST_VALUE:
162027 case ExpressionType::WINDOW_LAST_VALUE:
162028
162029 const_vectors[expr_idx] = make_uniq<Vector>(GetFirstValue(context, input, wexpr));
162030 break;
162031 case ExpressionType::WINDOW_PERCENT_RANK: {
162032 const_vectors[expr_idx] = make_uniq<Vector>(Value((
double)0));
162033 break;
162034 }
162035 case ExpressionType::WINDOW_RANK:
162036 case ExpressionType::WINDOW_RANK_DENSE: {
162037 const_vectors[expr_idx] = make_uniq<Vector>(Value((int64_t)1));
162038 break;
162039 }
162040 case ExpressionType::WINDOW_LAG:
162041 case ExpressionType::WINDOW_LEAD: {
162042 lead_lag_states[expr_idx] = make_uniq<LeadLagState>(context, wexpr);
162044 if (offset < 0) {
162046 }
162047 break;
162048 }
162049 default:
162050 break;
162051 }
162052 }
162056 }
162058 }
DUCKDB_API vector< LogicalType > GetTypes() const
Returns a list of types of the vectors of this data chunk.
Definition duckdb.cpp:116995
vector< unique_ptr< AggregateState > > aggregate_states
Aggregation states.
Definition duckdb.cpp:162073
DataChunk delayed
A buffer for delayed input.
Definition duckdb.cpp:162080
vector< unique_ptr< LeadLagState > > lead_lag_states
Lead/Lag states.
Definition duckdb.cpp:162076
DataChunk shifted
A buffer for shifting delayed input.
Definition duckdb.cpp:162082
vector< unique_ptr< Vector > > const_vectors
The values that are determined by the first row.
Definition duckdb.cpp:162071
idx_t lead_count
The number of rows ahead to buffer for LEAD.
Definition duckdb.cpp:162078
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237