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::PhysicalRightDelimJoin Class Reference
Inheritance diagram for duckdb::PhysicalRightDelimJoin:
Collaboration diagram for duckdb::PhysicalRightDelimJoin:

Public Member Functions

 PhysicalRightDelimJoin (PhysicalPlan &physical_plan, PhysicalPlanGenerator &planner, vector< LogicalType > types, PhysicalOperator &original_join, PhysicalOperator &distinct, const vector< const_reference< PhysicalOperator > > &delim_scans, idx_t estimated_cardinality, optional_idx delim_idx)
unique_ptr< GlobalSinkState > GetGlobalSinkState (ClientContext &context) const override
unique_ptr< LocalSinkState > GetLocalSinkState (ExecutionContext &context) const override
SinkResultType Sink (ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override
SinkCombineResultType Combine (ExecutionContext &context, OperatorSinkCombineInput &input) const override
void PrepareFinalize (ClientContext &context, GlobalSinkState &sink_state) const override
SinkFinalizeType Finalize (Pipeline &pipeline, Event &event, ClientContext &context, OperatorSinkFinalizeInput &input) const override
void BuildPipelines (Pipeline &current, MetaPipeline &meta_pipeline) override
Public Member Functions inherited from duckdb::PhysicalDelimJoin
 PhysicalDelimJoin (PhysicalPlan &physical_plan, PhysicalOperatorType type, vector< LogicalType > types, PhysicalOperator &original_join, PhysicalOperator &distinct, const vector< const_reference< PhysicalOperator > > &delim_scans, idx_t estimated_cardinality, optional_idx delim_idx)
vector< const_reference< PhysicalOperator > > GetChildren () const override
bool IsSink () const override
bool ParallelSink () const override
OrderPreservationType SourceOrder () const override
 The type of order emitted by the operator (as a source).
bool SinkOrderDependent () const override
InsertionOrderPreservingMap< string > ParamsToString () 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 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.
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< 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).
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 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 SinkNextBatchType NextBatch (ExecutionContext &context, OperatorSinkNextBatchInput &input) const
virtual OperatorPartitionInfo RequiredPartitionInfo () const
virtual vector< const_reference< PhysicalOperator > > GetSources () 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::RIGHT_DELIM_JOIN
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.
Public Attributes inherited from duckdb::PhysicalDelimJoin
PhysicalOperator & join
PhysicalHashAggregate & distinct
vector< const_reference< PhysicalOperator > > delim_scans
optional_idx delim_idx
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.
Protected Member Functions inherited from duckdb::PhysicalOperator
virtual SourceResultType GetDataInternal (ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const

Detailed Description

PhysicalRightDelimJoin represents a join where the RHS will be duplicate eliminated and pushed into a PhysicalColumnDataScan in the LHS.

Constructor & Destructor Documentation

◆ PhysicalRightDelimJoin()

duckdb::PhysicalRightDelimJoin::PhysicalRightDelimJoin ( PhysicalPlan & physical_plan,
PhysicalPlanGenerator & planner,
vector< LogicalType > types,
PhysicalOperator & original_join,
PhysicalOperator & distinct,
const vector< const_reference< PhysicalOperator > > & delim_scans,
idx_t estimated_cardinality,
optional_idx delim_idx )
190414 : PhysicalDelimJoin(physical_plan, PhysicalOperatorType::RIGHT_DELIM_JOIN, std::move(types), original_join,
190415 distinct, delim_scans, estimated_cardinality, delim_idx) {
190416 D_ASSERT(join.children.size() == 2);
190417 // now for the original join
190418 // we take its right child, this is the side that we will duplicate eliminate
190419 children.push_back(join.children[1]);
190420
190421 // we replace it with a PhysicalDummyScan, which contains no data, just the types, it won't be scanned anyway
190422 join.children[1] = planner.Make<PhysicalDummyScan>(children[0].get().GetTypes(), estimated_cardinality);
190423}
vector< LogicalType > types
The return types.
Definition duckdb.hpp:22152
const vector< LogicalType > & GetTypes() const
Return a vector of the types that will be returned by this operator.
Definition duckdb.hpp:22174
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

◆ GetGlobalSinkState()

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

Reimplemented from duckdb::PhysicalOperator.

190436 {
190437 auto state = make_uniq<RightDelimJoinGlobalState>();
190438 join.sink_state = join.GetGlobalSinkState(context);
190439 distinct.sink_state = distinct.GetGlobalSinkState(context);
190440 if (delim_scans.size() > 1) {
190441 PhysicalHashAggregate::SetMultiScan(*distinct.sink_state);
190442 }
190443 return std::move(state);
190444}
static void SetMultiScan(GlobalSinkState &state)
Definition duckdb.cpp:160199

◆ GetLocalSinkState()

unique_ptr< LocalSinkState > duckdb::PhysicalRightDelimJoin::GetLocalSinkState ( ExecutionContext & context) const
overridevirtual

Reimplemented from duckdb::PhysicalOperator.

190446 {
190447 auto state = make_uniq<RightDelimJoinLocalState>();
190448 state->join_state = join.GetLocalSinkState(context);
190449 state->distinct_state = distinct.GetLocalSinkState(context);
190450 return std::move(state);
190451}

◆ Sink()

SinkResultType duckdb::PhysicalRightDelimJoin::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.

190454 {
190455 auto &lstate = input.local_state.Cast<RightDelimJoinLocalState>();
190456
190457 OperatorSinkInput join_sink_input {*join.sink_state, *lstate.join_state, input.interrupt_state};
190458 join.Sink(context, chunk, join_sink_input);
190459
190460 OperatorSinkInput distinct_sink_input {*distinct.sink_state, *lstate.distinct_state, input.interrupt_state};
190461 distinct.Sink(context, chunk, distinct_sink_input);
190462
190463 return SinkResultType::NEED_MORE_INPUT;
190464}

◆ Combine()

SinkCombineResultType duckdb::PhysicalRightDelimJoin::Combine ( ExecutionContext & context,
OperatorSinkCombineInput & input ) const
overridevirtual

The combine is called when a single thread has completed execution of its part of the pipeline, it is the final time that a specific LocalSinkState is accessible. This method can be called in parallel while other Sink() or Combine() calls are active on the same GlobalSinkState.

Reimplemented from duckdb::PhysicalOperator.

190467 {
190468 auto &lstate = input.local_state.Cast<RightDelimJoinLocalState>();
190469
190470 OperatorSinkCombineInput join_combine_input {*join.sink_state, *lstate.join_state, input.interrupt_state};
190471 join.Combine(context, join_combine_input);
190472
190473 OperatorSinkCombineInput distinct_combine_input {*distinct.sink_state, *lstate.distinct_state,
190474 input.interrupt_state};
190475 distinct.Combine(context, distinct_combine_input);
190476
190477 return SinkCombineResultType::FINISHED;
190478}

◆ PrepareFinalize()

void duckdb::PhysicalRightDelimJoin::PrepareFinalize ( ClientContext & context,
GlobalSinkState & sink_state ) const
overridevirtual

(optional) function that will be called before Finalize For now, its only use is to to communicate memory usage in multi-join pipelines through TemporaryMemoryManager

Reimplemented from duckdb::PhysicalOperator.

190480 {
190481 join.PrepareFinalize(context, *join.sink_state);
190482 distinct.PrepareFinalize(context, *distinct.sink_state);
190483}

◆ Finalize()

SinkFinalizeType duckdb::PhysicalRightDelimJoin::Finalize ( Pipeline & pipeline,
Event & event,
ClientContext & context,
OperatorSinkFinalizeInput & input ) const
overridevirtual

The finalize is called when ALL threads are finished execution. It is called only once per pipeline, and is entirely single threaded. If Finalize returns SinkResultType::Finished, the sink is marked as finished

Reimplemented from duckdb::PhysicalOperator.

190486 {
190487 OperatorSinkFinalizeInput join_finalize_input {*join.sink_state, input.interrupt_state};
190488 join.Finalize(pipeline, event, client, join_finalize_input);
190489
190490 OperatorSinkFinalizeInput distinct_finalize_input {*distinct.sink_state, input.interrupt_state};
190491 distinct.Finalize(pipeline, event, client, distinct_finalize_input);
190492
190493 return SinkFinalizeType::READY;
190494}

◆ BuildPipelines()

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

Reimplemented from duckdb::PhysicalOperator.

190499 {
190500 op_state.reset();
190501 sink_state.reset();
190502
190503 auto &child_meta_pipeline = meta_pipeline.CreateChildMetaPipeline(current, *this);
190504 child_meta_pipeline.Build(children[0]);
190505
190506 D_ASSERT(type == PhysicalOperatorType::RIGHT_DELIM_JOIN);
190507 // recurse into the actual join
190508 // any pipelines in there depend on the main pipeline
190509 // any scan of the duplicate eliminated data on the LHS depends on this pipeline
190510 // we add an entry to the mapping of (PhysicalOperator*) -> (Pipeline*)
190511 auto &state = meta_pipeline.GetState();
190512 for (auto &delim_scan : delim_scans) {
190513 state.delim_join_dependencies.insert(
190514 make_pair(delim_scan, reference<Pipeline>(*child_meta_pipeline.GetBasePipeline())));
190515 }
190516
190517 // Build join pipelines without building the RHS (already built in the Sink of this op)
190518 PhysicalJoin::BuildJoinPipelines(current, meta_pipeline, join, false);
190519}
unique_ptr< GlobalOperatorState > op_state
The global operator state.
Definition duckdb.hpp:22159
unique_ptr< GlobalSinkState > sink_state
The global sink state.
Definition duckdb.hpp:22157
PhysicalOperatorType type
The physical operator type.
Definition duckdb.hpp:22150

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