MCPcopy Create free account
hub / github.com/apache/arrow / Store

Method Store

cpp/src/arrow/acero/asof_join_node.cc:308–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306 }
307
308 void Store(const std::shared_ptr<RecordBatch>& batch, row_index_t row, OnType time,
309 DEBUG_ADD(ByType key, OnType for_time)) {
310 DEBUG_SYNC(node_, "memo ", index_, " store: for_time=", for_time, " row=", row,
311 " time=", time, " key=", key, DEBUG_MANIP(std::endl));
312 if (no_future_ || entries_.count(key) == 0) {
313 auto& e = entries_[key];
314 // that we can do this assignment optionally, is why we
315 // can get away with using shared_ptr above (the batch
316 // shouldn't change that often)
317 if (e.batch != batch) e.batch = batch;
318 e.row = row;
319 e.time = time;
320 } else {
321 future_entries_[key].emplace(time, batch, row);
322 }
323 // Maintain distinct times:
324 // If no times are currently maintained then the given time is distinct and hence
325 // pushed. Otherwise, the invariant is that the latest time is at the back. If no
326 // future times are maintained, then only one time is maintained, and hence it is
327 // overwritten with the given time. Otherwise, the given time must be no less than the
328 // latest time, due to time ordering, so it is pushed back only if it is distinct.
329 if (times_.empty() || (!no_future_ && times_.back() != time)) {
330 times_.push_back(time);
331 } else {
332 times_.back() = time;
333 }
334 // `time` is the most advanced seen yet - `UpdateTime(time)` would work but not needed
335 current_time_ = time;
336 }
337
338 std::optional<const Entry*> GetEntryForKey(ByType key) const {
339 auto e = entries_.find(key);

Callers 1

AdvanceAndMemoizeMethod · 0.80

Calls 4

backMethod · 0.80
push_backMethod · 0.80
countMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected