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

PhysicalCrossProduct represents a cross product between two tables. More...

Inheritance diagram for duckdb::PhysicalCrossProduct:
Collaboration diagram for duckdb::PhysicalCrossProduct:

Public Member Functions

 PhysicalCrossProduct (PhysicalPlan &physical_plan, vector< LogicalType > types, PhysicalOperator &left, PhysicalOperator &right, idx_t estimated_cardinality)
unique_ptr< OperatorState > GetOperatorState (ExecutionContext &context) const override
OrderPreservationType OperatorOrder () const override
 The influence the operator has on order (insertion order means no influence).
bool ParallelOperator () const override
unique_ptr< GlobalSinkState > GetGlobalSinkState (ClientContext &context) const override
SinkResultType Sink (ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override
bool IsSink () const override
bool ParallelSink () const override
bool SinkOrderDependent () const override
void BuildPipelines (Pipeline &current, MetaPipeline &meta_pipeline) override
vector< const_reference< PhysicalOperator > > GetSources () const override
Public Member Functions inherited from duckdb::CachingPhysicalOperator
 CachingPhysicalOperator (PhysicalPlan &physical_plan, PhysicalOperatorType type, vector< LogicalType > types, idx_t estimated_cardinality)
OperatorResultType Execute (ExecutionContext &context, DataChunk &input, DataChunk &chunk, GlobalOperatorState &gstate, OperatorState &state) const final
OperatorFinalizeResultType FinalExecute (ExecutionContext &context, DataChunk &chunk, GlobalOperatorState &gstate, OperatorState &state) const final
bool RequiresFinalExecute () const final
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
virtual vector< const_reference< PhysicalOperator > > GetChildren () const
const vector< LogicalType > & GetTypes () const
 Return a vector of the types that will be returned by this operator.
virtual bool Equals (const PhysicalOperator &other) const
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< GlobalOperatorState > GetGlobalOperatorState (ClientContext &context) const
virtual OperatorFinalResultType OperatorFinalize (Pipeline &pipeline, Event &event, ClientContext &context, OperatorFinalizeInput &input) const
virtual bool RequiresOperatorFinalize () const
virtual unique_ptr< LocalSourceState > GetLocalSourceState (ExecutionContext &context, GlobalSourceState &gstate) const
virtual unique_ptr< GlobalSourceState > GetGlobalSourceState (ClientContext &context) const
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 IsSource () 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 GetProgress (ClientContext &context, GlobalSourceState &gstate) const
 Returns the current progress percentage, or a negative value if progress bars are not supported.
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 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 OperatorPartitionInfo RequiredPartitionInfo () const
bool AllSourcesSupportBatchIndex () const
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Attributes

static constexpr const PhysicalOperatorType TYPE = PhysicalOperatorType::CROSS_PRODUCT
Static Public Attributes inherited from duckdb::CachingPhysicalOperator
static constexpr const idx_t CACHE_THRESHOLD = 64
Static Public Attributes inherited from duckdb::PhysicalOperator
static constexpr const PhysicalOperatorType TYPE = PhysicalOperatorType::INVALID

Protected Member Functions

OperatorResultType ExecuteInternal (ExecutionContext &context, DataChunk &input, DataChunk &chunk, GlobalOperatorState &gstate, OperatorState &state) const override
 Child classes need to implement the ExecuteInternal method instead of the Execute.
Protected Member Functions inherited from duckdb::PhysicalOperator
virtual SourceResultType GetDataInternal (ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const

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.
Public Attributes inherited from duckdb::CachingPhysicalOperator
bool caching_supported
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.

Detailed Description

PhysicalCrossProduct represents a cross product between two tables.

Constructor & Destructor Documentation

◆ PhysicalCrossProduct()

duckdb::PhysicalCrossProduct::PhysicalCrossProduct ( PhysicalPlan & physical_plan,
vector< LogicalType > types,
PhysicalOperator & left,
PhysicalOperator & right,
idx_t estimated_cardinality )
183914 : CachingPhysicalOperator(physical_plan, PhysicalOperatorType::CROSS_PRODUCT, std::move(types),
183916 children.push_back(left);
183917 children.push_back(right);
183918}
vector< LogicalType > types
The return types.
Definition duckdb.hpp:22152
idx_t estimated_cardinality
The estimated cardinality.
Definition duckdb.hpp:22154
ArenaLinkedList< reference< PhysicalOperator > > children
The child operators.
Definition duckdb.hpp:22148

Member Function Documentation

◆ GetOperatorState()

unique_ptr< OperatorState > duckdb::PhysicalCrossProduct::GetOperatorState ( ExecutionContext & context) const
overridevirtual

Reimplemented from duckdb::PhysicalOperator.

184028 {
184029 auto &sink = sink_state->Cast<CrossProductGlobalState>();
184030 return make_uniq<CrossProductOperatorState>(sink.rhs_materialized);
184031}
unique_ptr< GlobalSinkState > sink_state
The global sink state.
Definition duckdb.hpp:22157

◆ OperatorOrder()

OrderPreservationType duckdb::PhysicalCrossProduct::OperatorOrder ( ) const
inlineoverridevirtual

The influence the operator has on order (insertion order means no influence).

Reimplemented from duckdb::PhysicalOperator.

183447 {
183448 return OrderPreservationType::NO_ORDER;
183449 }

◆ ParallelOperator()

bool duckdb::PhysicalCrossProduct::ParallelOperator ( ) const
inlineoverridevirtual

Reimplemented from duckdb::PhysicalOperator.

183450 {
183451 return true;
183452 }

◆ ExecuteInternal()

OperatorResultType duckdb::PhysicalCrossProduct::ExecuteInternal ( ExecutionContext & context,
DataChunk & input,
DataChunk & chunk,
GlobalOperatorState & gstate,
OperatorState & state ) const
overrideprotectedvirtual

Child classes need to implement the ExecuteInternal method instead of the Execute.

Implements duckdb::CachingPhysicalOperator.

184034 {
184035 auto &state = state_p.Cast<CrossProductOperatorState>();
184036 return state.executor.Execute(input, chunk);
184037}

◆ GetGlobalSinkState()

unique_ptr< GlobalSinkState > duckdb::PhysicalCrossProduct::GetGlobalSinkState ( ClientContext & context) const
overridevirtual

Reimplemented from duckdb::PhysicalOperator.

183935 {
183936 return make_uniq<CrossProductGlobalState>(context, *this);
183937}

◆ Sink()

SinkResultType duckdb::PhysicalCrossProduct::Sink ( ExecutionContext & context,
DataChunk & chunk,
OperatorSinkInput & input ) const
overridevirtual

The sink method is called constantly with new input, as long as new input is available. Note that this method CAN be called in parallel, proper locking is needed when accessing dat a inside the GlobalSinkState.

Reimplemented from duckdb::PhysicalOperator.

183939 {
183940 auto &sink = input.global_state.Cast<CrossProductGlobalState>();
183941 lock_guard<mutex> client_guard(sink.rhs_lock);
183942 sink.rhs_materialized.Append(sink.append_state, chunk);
183943 return SinkResultType::NEED_MORE_INPUT;
183944}

◆ IsSink()

bool duckdb::PhysicalCrossProduct::IsSink ( ) const
inlineoverridevirtual

Reimplemented from duckdb::PhysicalOperator.

183463 {
183464 return true;
183465 }

◆ ParallelSink()

bool duckdb::PhysicalCrossProduct::ParallelSink ( ) const
inlineoverridevirtual

Reimplemented from duckdb::PhysicalOperator.

183466 {
183467 return true;
183468 }

◆ SinkOrderDependent()

bool duckdb::PhysicalCrossProduct::SinkOrderDependent ( ) const
inlineoverridevirtual

Whether or not the sink operator depends on the order of the input chunks If this is set to true, we cannot do things like caching intermediate vectors

Reimplemented from duckdb::PhysicalOperator.

183469 {
183470 return false;
183471 }

◆ BuildPipelines()

void duckdb::PhysicalCrossProduct::BuildPipelines ( Pipeline & current,
MetaPipeline & meta_pipeline )
overridevirtual

Reimplemented from duckdb::PhysicalOperator.

184042 {
184043 PhysicalJoin::BuildJoinPipelines(current, meta_pipeline, *this);
184044}

◆ GetSources()

vector< const_reference< PhysicalOperator > > duckdb::PhysicalCrossProduct::GetSources ( ) const
overridevirtual

Reimplemented from duckdb::PhysicalOperator.

184046 {
184047 return children[0].get().GetSources();
184048}

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