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::PhysicalPositionalScan Class Reference

Represents a scan of a base table. More...

Inheritance diagram for duckdb::PhysicalPositionalScan:
Collaboration diagram for duckdb::PhysicalPositionalScan:

Public Member Functions

 PhysicalPositionalScan (PhysicalPlan &physical_plan, vector< LogicalType > types, PhysicalOperator &left, PhysicalOperator &right)
 Regular Table Scan.
bool Equals (const PhysicalOperator &other) const override
vector< const_reference< PhysicalOperator > > GetChildren () const override
unique_ptr< LocalSourceState > GetLocalSourceState (ExecutionContext &context, GlobalSourceState &gstate) const override
unique_ptr< GlobalSourceState > GetGlobalSourceState (ClientContext &context) const override
SourceResultType GetDataInternal (ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override
ProgressData GetProgress (ClientContext &context, GlobalSourceState &gstate) const override
 Returns the current progress percentage, or a negative value if progress bars are not supported.
bool IsSource () const override
Public Member Functions inherited from duckdb::PhysicalOperator
 PhysicalOperator (PhysicalPlan &physical_plan, PhysicalOperatorType type, vector< LogicalType > types, idx_t estimated_cardinality)
 PhysicalOperator (const PhysicalOperator &other)=delete
 Deleted copy constructors.
PhysicalOperator & operator= (const PhysicalOperator &)=delete
virtual string GetName () const
virtual InsertionOrderPreservingMap< string > ParamsToString () const
virtual string ToString (ExplainFormat format=ExplainFormat::DEFAULT) const
void Print () const
const vector< LogicalType > & GetTypes () const
 Return a vector of the types that will be returned by this operator.
idx_t EstimatedThreadCount () const
 Functions to help decide how to set up pipeline dependencies.
bool CanSaturateThreads (ClientContext &context) const
virtual void Verify ()
virtual unique_ptr< OperatorState > GetOperatorState (ExecutionContext &context) const
virtual unique_ptr< GlobalOperatorState > GetGlobalOperatorState (ClientContext &context) const
virtual OperatorResultType Execute (ExecutionContext &context, DataChunk &input, DataChunk &chunk, GlobalOperatorState &gstate, OperatorState &state) const
virtual OperatorFinalizeResultType FinalExecute (ExecutionContext &context, DataChunk &chunk, GlobalOperatorState &gstate, OperatorState &state) const
virtual OperatorFinalResultType OperatorFinalize (Pipeline &pipeline, Event &event, ClientContext &context, OperatorFinalizeInput &input) const
virtual bool ParallelOperator () const
virtual bool RequiresFinalExecute () const
virtual bool RequiresOperatorFinalize () const
virtual OrderPreservationType OperatorOrder () const
 The influence the operator has on order (insertion order means no influence).
SourceResultType GetData (ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const
virtual OperatorPartitionData GetPartitionData (ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate, LocalSourceState &lstate, const OperatorPartitionInfo &partition_info) const
virtual bool ParallelSource () const
virtual bool SupportsPartitioning (const OperatorPartitionInfo &partition_info) const
virtual OrderPreservationType SourceOrder () const
 The type of order emitted by the operator (as a source).
virtual ProgressData GetSinkProgress (ClientContext &context, GlobalSinkState &gstate, const ProgressData source_progress) const
 Returns the current progress percentage, or a negative value if progress bars are not supported.
virtual InsertionOrderPreservingMap< string > ExtraSourceParams (GlobalSourceState &gstate, LocalSourceState &lstate) const
virtual SinkResultType Sink (ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const
virtual SinkCombineResultType Combine (ExecutionContext &context, OperatorSinkCombineInput &input) const
virtual void PrepareFinalize (ClientContext &context, GlobalSinkState &sink_state) const
virtual SinkFinalizeType Finalize (Pipeline &pipeline, Event &event, ClientContext &context, OperatorSinkFinalizeInput &input) const
virtual SinkNextBatchType NextBatch (ExecutionContext &context, OperatorSinkNextBatchInput &input) const
virtual unique_ptr< LocalSinkState > GetLocalSinkState (ExecutionContext &context) const
virtual unique_ptr< GlobalSinkState > GetGlobalSinkState (ClientContext &context) const
virtual bool IsSink () const
virtual bool ParallelSink () const
virtual OperatorPartitionInfo RequiredPartitionInfo () const
virtual bool SinkOrderDependent () const
virtual vector< const_reference< PhysicalOperator > > GetSources () const
bool AllSourcesSupportBatchIndex () const
virtual void BuildPipelines (Pipeline &current, MetaPipeline &meta_pipeline)
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Public Attributes

vector< reference< PhysicalOperator > > child_tables
 The child table functions.
Public Attributes inherited from duckdb::PhysicalOperator
ArenaLinkedList< reference< PhysicalOperator > > children
 The child operators.
PhysicalOperatorType type
 The physical operator type.
vector< LogicalType > types
 The return types.
idx_t estimated_cardinality
 The estimated cardinality.
unique_ptr< GlobalSinkState > sink_state
 The global sink state.
unique_ptr< GlobalOperatorState > op_state
 The global operator state.
mutex lock
 Lock for (re)setting any of the operator states.

Static Public Attributes

static constexpr const PhysicalOperatorType TYPE = PhysicalOperatorType::POSITIONAL_SCAN
Static Public Attributes inherited from duckdb::PhysicalOperator
static constexpr const PhysicalOperatorType TYPE = PhysicalOperatorType::INVALID

Additional Inherited Members

Static Public Member Functions inherited from duckdb::PhysicalOperator
static void SetEstimatedCardinality (InsertionOrderPreservingMap< string > &result, idx_t estimated_cardinality)
static idx_t GetMaxThreadMemory (ClientContext &context)
 The maximum amount of memory the operator should use per thread.
static OperatorCachingMode SelectOperatorCachingMode (ExecutionContext &context)
 Whether operator caching is allowed in the current execution context.

Detailed Description

Represents a scan of a base table.

Constructor & Destructor Documentation

◆ PhysicalPositionalScan()

duckdb::PhysicalPositionalScan::PhysicalPositionalScan ( PhysicalPlan & physical_plan,
vector< LogicalType > types,
PhysicalOperator & left,
PhysicalOperator & right )

Regular Table Scan.

198482 : PhysicalOperator(physical_plan, PhysicalOperatorType::POSITIONAL_SCAN, std::move(types),
198483 MaxValue(left.estimated_cardinality, right.estimated_cardinality)) {
198484 // Manage the children ourselves
198485 if (left.type == PhysicalOperatorType::TABLE_SCAN) {
198486 child_tables.emplace_back(left);
198487 } else if (left.type == PhysicalOperatorType::POSITIONAL_SCAN) {
198488 auto &left_scan = left.Cast<PhysicalPositionalScan>();
198489 child_tables = std::move(left_scan.child_tables);
198490 } else {
198491 throw InternalException("Invalid left input for PhysicalPositionalScan");
198492 }
198493
198494 if (right.type == PhysicalOperatorType::TABLE_SCAN) {
198495 child_tables.emplace_back(right);
198496 } else if (right.type == PhysicalOperatorType::POSITIONAL_SCAN) {
198497 auto &right_scan = right.Cast<PhysicalPositionalScan>();
198498 auto &right_tables = right_scan.child_tables;
198499 child_tables.reserve(child_tables.size() + right_tables.size());
198500 std::move(right_tables.begin(), right_tables.end(), std::back_inserter(child_tables));
198501 } else {
198502 throw InternalException("Invalid right input for PhysicalPositionalScan");
198503 }
198504}
vector< LogicalType > types
The return types.
Definition duckdb.hpp:22152
PhysicalPositionalScan(PhysicalPlan &physical_plan, vector< LogicalType > types, PhysicalOperator &left, PhysicalOperator &right)
Regular Table Scan.
Definition duckdb.cpp:198480
vector< reference< PhysicalOperator > > child_tables
The child table functions.
Definition duckdb.cpp:99463

Member Function Documentation

◆ Equals()

bool duckdb::PhysicalPositionalScan::Equals ( const PhysicalOperator & other) const
overridevirtual

Reimplemented from duckdb::PhysicalOperator.

198664 {
198665 if (type != other_p.type) {
198666 return false;
198667 }
198668
198669 auto &other = other_p.Cast<PhysicalPositionalScan>();
198670 if (child_tables.size() != other.child_tables.size()) {
198671 return false;
198672 }
198673 for (size_t i = 0; i < child_tables.size(); ++i) {
198674 if (!child_tables[i].get().Equals(other.child_tables[i])) {
198675 return false;
198676 }
198677 }
198678
198679 return true;
198680}
PhysicalOperatorType type
The physical operator type.
Definition duckdb.hpp:22150
__host__ cudaTextureObject_t get() const noexcept

◆ GetChildren()

vector< const_reference< PhysicalOperator > > duckdb::PhysicalPositionalScan::GetChildren ( ) const
overridevirtual

Reimplemented from duckdb::PhysicalOperator.

198682 {
198683 auto result = PhysicalOperator::GetChildren();
198684 for (auto &entry : child_tables) {
198685 result.push_back(entry.get());
198686 }
198687 return result;
198688}

◆ GetLocalSourceState()

unique_ptr< LocalSourceState > duckdb::PhysicalPositionalScan::GetLocalSourceState ( ExecutionContext & context,
GlobalSourceState & gstate ) const
overridevirtual

Reimplemented from duckdb::PhysicalOperator.

198619 {
198620 return make_uniq<PositionalScanLocalSourceState>(context, gstate.Cast<PositionalScanGlobalSourceState>(), *this);
198621}

◆ GetGlobalSourceState()

unique_ptr< GlobalSourceState > duckdb::PhysicalPositionalScan::GetGlobalSourceState ( ClientContext & context) const
overridevirtual

Reimplemented from duckdb::PhysicalOperator.

198623 {
198624 return make_uniq<PositionalScanGlobalSourceState>(context, *this);
198625}

◆ GetDataInternal()

SourceResultType duckdb::PhysicalPositionalScan::GetDataInternal ( ExecutionContext & context,
DataChunk & chunk,
OperatorSourceInput & input ) const
overridevirtual

Reimplemented from duckdb::PhysicalOperator.

198628 {
198629 auto &lstate = input.local_state.Cast<PositionalScanLocalSourceState>();
198630
198631 // Find the longest source block
198632 idx_t count = 0;
198633 for (auto &scanner : lstate.scanners) {
198634 count = MaxValue(count, scanner->Refill(context));
198635 }
198636
198637 // All done?
198638 if (!count) {
198639 return SourceResultType::FINISHED;
198640 }
198641
198642 // Copy or reference the source columns
198643 idx_t col_offset = 0;
198644 for (auto &scanner : lstate.scanners) {
198645 col_offset += scanner->CopyData(context, output, count, col_offset);
198646 }
198647
198648 output.SetCardinality(count);
198649 return SourceResultType::HAVE_MORE_OUTPUT;
198650}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ GetProgress()

ProgressData duckdb::PhysicalPositionalScan::GetProgress ( ClientContext & context,
GlobalSourceState & gstate ) const
overridevirtual

Returns the current progress percentage, or a negative value if progress bars are not supported.

Reimplemented from duckdb::PhysicalOperator.

198652 {
198653 auto &gstate = gstate_p.Cast<PositionalScanGlobalSourceState>();
198654
198655 ProgressData res;
198656
198657 for (size_t t = 0; t < child_tables.size(); ++t) {
198658 res.Add(child_tables[t].get().GetProgress(context, *gstate.global_states[t]));
198659 }
198660
198661 return res;
198662}
ProgressData GetProgress(ClientContext &context, GlobalSourceState &gstate) const override
Returns the current progress percentage, or a negative value if progress bars are not supported.
Definition duckdb.cpp:198652
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsSource()

bool duckdb::PhysicalPositionalScan::IsSource ( ) const
inlineoverridevirtual

Reimplemented from duckdb::PhysicalOperator.

99478 {
99479 return true;
99480 }

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