257311 {
257312 auto &gpeer = sink.global_state.Cast<WindowPeerGlobalState>();
257313 auto &lpeer = sink.local_state.Cast<WindowPeerLocalState>();
257314 auto rdata = FlatVector::GetData<double>(result);
257315
257316 if (gpeer.use_framing) {
257317 auto frame_begin = FlatVector::GetData<const idx_t>(lpeer.bounds.data[FRAME_BEGIN]);
257318 auto frame_end = FlatVector::GetData<const idx_t>(lpeer.bounds.data[FRAME_END]);
257319 if (gpeer.token_tree) {
257320 for (
idx_t i = 0; i < count; ++i, ++row_idx) {
257321 const auto peer_end = gpeer.token_tree->PeerEnd(frame_begin[i], frame_end[i], row_idx);
257322 rdata[i] = CumeDist(frame_begin[i], frame_end[i], peer_end);
257323 }
257324 } else {
257325 auto peer_end = FlatVector::GetData<const idx_t>(lpeer.bounds.data[PEER_END]);
257326 for (
idx_t i = 0; i < count; ++i, ++row_idx) {
257327
257328 const auto frame_peer_end = MinValue(peer_end[i], frame_end[i]);
257329 rdata[i] = CumeDist(frame_begin[i], frame_end[i], frame_peer_end);
257330 }
257331 }
257332 return;
257333 }
257334
257335 auto partition_begin = FlatVector::GetData<const idx_t>(lpeer.bounds.data[PARTITION_BEGIN]);
257336 auto partition_end = FlatVector::GetData<const idx_t>(lpeer.bounds.data[PARTITION_END]);
257337 auto peer_end = FlatVector::GetData<const idx_t>(lpeer.bounds.data[PEER_END]);
257338 for (
idx_t i = 0; i < count; ++i, ++row_idx) {
257339 rdata[i] = CumeDist(partition_begin[i], partition_end[i], peer_end[i]);
257340 }
257341}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237