Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::PositionalTableScanner Class Reference
Collaboration diagram for duckdb::PositionalTableScanner:

Public Member Functions

 PositionalTableScanner (ExecutionContext &context, PhysicalOperator &table_p, GlobalSourceState &gstate_p)
idx_t Refill (ExecutionContext &context)
idx_t CopyData (ExecutionContext &context, DataChunk &output, const idx_t count, const idx_t col_offset)
ProgressData GetProgress (ClientContext &context)

Public Attributes

PhysicalOperator & table
GlobalSourceState & global_state
unique_ptr< LocalSourceState > local_state
DataChunk source
idx_t source_offset
bool exhausted

Constructor & Destructor Documentation

◆ PositionalTableScanner()

duckdb::PositionalTableScanner::PositionalTableScanner ( ExecutionContext & context,
PhysicalOperator & table_p,
GlobalSourceState & gstate_p )
inline
198524 : table(table_p), global_state(gstate_p), source_offset(0), exhausted(false) {
198525 local_state = table.GetLocalSourceState(context, gstate_p);
198526 source.Initialize(Allocator::Get(context.client), table.types);
198527 }

Member Function Documentation

◆ Refill()

idx_t duckdb::PositionalTableScanner::Refill ( ExecutionContext & context)
inline
198529 {
198530 if (source_offset >= source.size()) {
198531 if (!exhausted) {
198532 source.Reset();
198533
198534 InterruptState interrupt_state;
198535 OperatorSourceInput source_input {global_state, *local_state, interrupt_state};
198536 auto source_result = SourceResultType::HAVE_MORE_OUTPUT;
198537 while (source_result == SourceResultType::HAVE_MORE_OUTPUT && source.size() == 0) {
198538 // TODO: this could as well just be propagated further, but for now iterating it is
198539 source_result = table.GetData(context, source, source_input);
198540 if (source_result == SourceResultType::BLOCKED) {
198541 throw NotImplementedException(
198542 "Unexpected interrupt from table Source in PositionalTableScanner refill");
198543 }
198544 }
198545 }
198546 source_offset = 0;
198547 }
198548
198549 const auto available = source.size() - source_offset;
198550 if (!available) {
198551 if (!exhausted) {
198552 source.Reset();
198553 for (idx_t i = 0; i < source.ColumnCount(); ++i) {
198554 auto &vec = source.data[i];
198555 vec.SetVectorType(VectorType::CONSTANT_VECTOR);
198556 ConstantVector::SetNull(vec, true);
198557 }
198558 exhausted = true;
198559 }
198560 }
198561
198562 return available;
198563 }
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ CopyData()

idx_t duckdb::PositionalTableScanner::CopyData ( ExecutionContext & context,
DataChunk & output,
const idx_t count,
const idx_t col_offset )
inline
198565 {
198566 if (!source_offset && (source.size() >= count || exhausted)) {
198567 // Fast track: aligned and has enough data
198568 for (idx_t i = 0; i < source.ColumnCount(); ++i) {
198569 output.data[col_offset + i].Reference(source.data[i]);
198570 }
198571 source_offset += count;
198572 } else {
198573 // Copy data
198574 for (idx_t target_offset = 0; target_offset < count;) {
198575 const auto needed = count - target_offset;
198576 const auto available = exhausted ? needed : (source.size() - source_offset);
198577 const auto copy_size = MinValue(needed, available);
198578 const auto source_count = source_offset + copy_size;
198579 for (idx_t i = 0; i < source.ColumnCount(); ++i) {
198580 VectorOperations::Copy(source.data[i], output.data[col_offset + i], source_count, source_offset,
198581 target_offset);
198582 }
198583 target_offset += copy_size;
198584 source_offset += copy_size;
198585 Refill(context);
198586 }
198587 }
198588
198589 return source.ColumnCount();
198590 }

◆ GetProgress()

ProgressData duckdb::PositionalTableScanner::GetProgress ( ClientContext & context)
inline
198592 {
198593 return table.GetProgress(context, global_state);
198594 }

The documentation for this class was generated from the following file: