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

PhysicalOperator is the base class of the physical operators present in the execution plan. More...

#include <duckdb.hpp>

Inheritance diagram for duckdb::PhysicalOperator:
Collaboration diagram for duckdb::PhysicalOperator:

Public Member Functions

 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< 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 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 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

Static Public Member Functions

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

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::INVALID

Protected Member Functions

virtual SourceResultType GetDataInternal (ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const

Detailed Description

PhysicalOperator is the base class of the physical operators present in the execution plan.

Constructor & Destructor Documentation

◆ PhysicalOperator()

duckdb::PhysicalOperator::PhysicalOperator ( PhysicalPlan & physical_plan,
PhysicalOperatorType type,
vector< LogicalType > types,
idx_t estimated_cardinality )
201426 : children(physical_plan.ArenaRef()), type(type), types(std::move(types)),
201428}
vector< LogicalType > types
The return types.
Definition duckdb.hpp:22152
idx_t estimated_cardinality
The estimated cardinality.
Definition duckdb.hpp:22154
PhysicalOperatorType type
The physical operator type.
Definition duckdb.hpp:22150
ArenaLinkedList< reference< PhysicalOperator > > children
The child operators.
Definition duckdb.hpp:22148

◆ ~PhysicalOperator()

virtual duckdb::PhysicalOperator::~PhysicalOperator ( )
inlinevirtual
22140 {
22141 }

Member Function Documentation

◆ GetName()

string duckdb::PhysicalOperator::GetName ( ) const
virtual
201430 {
201431 return PhysicalOperatorToString(type);
201432}

◆ ParamsToString()

virtual InsertionOrderPreservingMap< string > duckdb::PhysicalOperator::ParamsToString ( ) const
inlinevirtual
22165 {
22166 return InsertionOrderPreservingMap<string>();
22167 }

◆ SetEstimatedCardinality()

void duckdb::PhysicalOperator::SetEstimatedCardinality ( InsertionOrderPreservingMap< string > & result,
idx_t estimated_cardinality )
static
201457 {
201458 result[RenderTreeNode::ESTIMATED_CARDINALITY] = StringUtil::Format("%llu", estimated_cardinality);
201459}
static string Format(const string fmt_str, ARGS... params)
Format a string using printf semantics.
Definition duckdb.hpp:4002

◆ ToString()

string duckdb::PhysicalOperator::ToString ( ExplainFormat format = ExplainFormat::DEFAULT) const
virtual
201434 {
201435 auto renderer = TreeRenderer::CreateRenderer(format);
201436 stringstream ss;
201437 auto tree = RenderTree::CreateRenderTree(*this);
201438 renderer->ToStream(*tree, ss);
201439 return ss.str();
201440}
std::basic_string< Char > format(const S &format_str, Args &&... args)
Definition duckdb.cpp:16295

◆ Print()

void duckdb::PhysicalOperator::Print ( ) const
201443 {
201444 Printer::Print(ToString());
201445}
static DUCKDB_API void Print(OutputStream stream, const string &str)
Print the object to the stream.
Definition duckdb.cpp:92556

◆ GetChildren()

vector< const_reference< PhysicalOperator > > duckdb::PhysicalOperator::GetChildren ( ) const
virtual
201448 {
201449 vector<const_reference<PhysicalOperator>> result;
201450 for (auto &child : children) {
201451 result.push_back(child.get());
201452 }
201453 return result;
201454}

◆ GetTypes()

const vector< LogicalType > & duckdb::PhysicalOperator::GetTypes ( ) const
inline

Return a vector of the types that will be returned by this operator.

22174 {
22175 return types;
22176 }
Here is the caller graph for this function:

◆ Equals()

virtual bool duckdb::PhysicalOperator::Equals ( const PhysicalOperator & other) const
inlinevirtual
22178 {
22179 return false;
22180 }

◆ EstimatedThreadCount()

idx_t duckdb::PhysicalOperator::EstimatedThreadCount ( ) const

Functions to help decide how to set up pipeline dependencies.

201461 {
201462 idx_t result = 0;
201463 if (children.empty()) {
201464 // Terminal operator, e.g., base table, these decide the degree of parallelism of pipelines
201465 result = MaxValue<idx_t>(estimated_cardinality / (DEFAULT_ROW_GROUP_SIZE * 2), 1);
201466 } else if (type == PhysicalOperatorType::UNION) {
201467 // We can run union pipelines in parallel, so we sum up the thread count of the children
201468 for (auto &child : children) {
201469 result += child.get().EstimatedThreadCount();
201470 }
201471 } else {
201472 // For other operators we take the maximum of the children
201473 for (auto &child : children) {
201474 result = MaxValue(child.get().EstimatedThreadCount(), result);
201475 }
201476 }
201477 return result;
201478}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ CanSaturateThreads()

bool duckdb::PhysicalOperator::CanSaturateThreads ( ClientContext & context) const
201480 {
201481#ifdef DEBUG
201482 // In debug mode we always return true here so that the code that depends on it is well-tested
201483 return true;
201484#else
201485 const auto num_threads = NumericCast<idx_t>(TaskScheduler::GetScheduler(context).NumberOfThreads());
201486 return EstimatedThreadCount() >= num_threads;
201487#endif
201488}
idx_t EstimatedThreadCount() const
Functions to help decide how to set up pipeline dependencies.
Definition duckdb.cpp:201461

◆ Verify()

void duckdb::PhysicalOperator::Verify ( )
virtual
201682 {
201683#ifdef DEBUG
201684 auto sources = GetSources();
201685 D_ASSERT(!sources.empty());
201686 for (auto &child : children) {
201687 child.get().Verify();
201688 }
201689#endif
201690}

◆ GetOperatorState()

unique_ptr< OperatorState > duckdb::PhysicalOperator::GetOperatorState ( ExecutionContext & context) const
virtual
201494 {
201495 return make_uniq<OperatorState>();
201496}

◆ GetGlobalOperatorState()

unique_ptr< GlobalOperatorState > duckdb::PhysicalOperator::GetGlobalOperatorState ( ClientContext & context) const
virtual
201498 {
201499 return make_uniq<GlobalOperatorState>();
201500}

◆ Execute()

OperatorResultType duckdb::PhysicalOperator::Execute ( ExecutionContext & context,
DataChunk & input,
DataChunk & chunk,
GlobalOperatorState & gstate,
OperatorState & state ) const
virtual

Reimplemented in duckdb::CachingPhysicalOperator.

201503 {
201504 throw InternalException("Calling Execute on a node that is not an operator!");
201505}

◆ FinalExecute()

OperatorFinalizeResultType duckdb::PhysicalOperator::FinalExecute ( ExecutionContext & context,
DataChunk & chunk,
GlobalOperatorState & gstate,
OperatorState & state ) const
virtual

Reimplemented in duckdb::CachingPhysicalOperator.

201508 {
201509 throw InternalException("Calling FinalExecute on a node that is not an operator!");
201510}

◆ OperatorFinalize()

OperatorFinalResultType duckdb::PhysicalOperator::OperatorFinalize ( Pipeline & pipeline,
Event & event,
ClientContext & context,
OperatorFinalizeInput & input ) const
virtual
201513 {
201514 throw InternalException("Calling FinalExecute on a node that is not an operator!");
201515}

◆ ParallelOperator()

virtual bool duckdb::PhysicalOperator::ParallelOperator ( ) const
inlinevirtual
22199 {
22200 return false;
22201 }

◆ RequiresFinalExecute()

virtual bool duckdb::PhysicalOperator::RequiresFinalExecute ( ) const
inlinevirtual
22203 {
22204 return false;
22205 }

◆ RequiresOperatorFinalize()

virtual bool duckdb::PhysicalOperator::RequiresOperatorFinalize ( ) const
inlinevirtual
22207 {
22208 return false;
22209 }

◆ OperatorOrder()

virtual OrderPreservationType duckdb::PhysicalOperator::OperatorOrder ( ) const
inlinevirtual

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

Reimplemented in duckdb::PhysicalCrossProduct, duckdb::PhysicalJoin, duckdb::PhysicalStreamingLimit, duckdb::PhysicalStreamingWindow, and duckdb::PhysicalTableInOutFunction.

22212 {
22213 return OrderPreservationType::INSERTION_ORDER;
22214 }

◆ GetLocalSourceState()

unique_ptr< LocalSourceState > duckdb::PhysicalOperator::GetLocalSourceState ( ExecutionContext & context,
GlobalSourceState & gstate ) const
virtual
201522 {
201523 return make_uniq<LocalSourceState>();
201524}

◆ GetGlobalSourceState()

unique_ptr< GlobalSourceState > duckdb::PhysicalOperator::GetGlobalSourceState ( ClientContext & context) const
virtual
201526 {
201527 return make_uniq<GlobalSourceState>();
201528}

◆ GetDataInternal()

SourceResultType duckdb::PhysicalOperator::GetDataInternal ( ExecutionContext & context,
DataChunk & chunk,
OperatorSourceInput & input ) const
protectedvirtual

Reimplemented in duckdb::PhysicalCreateIndex.

201537 {
201538 throw InternalException("Calling GetDataInternal on a node that is not a source!");
201539}

◆ GetData()

SourceResultType duckdb::PhysicalOperator::GetData ( ExecutionContext & context,
DataChunk & chunk,
OperatorSourceInput & input ) const
201532 {
201533 return GetDataInternal(context, chunk, input);
201534}

◆ GetPartitionData()

OperatorPartitionData duckdb::PhysicalOperator::GetPartitionData ( ExecutionContext & context,
DataChunk & chunk,
GlobalSourceState & gstate,
LocalSourceState & lstate,
const OperatorPartitionInfo & partition_info ) const
virtual
201543 {
201544 throw InternalException("Calling GetPartitionData on a node that does not support it");
201545}

◆ IsSource()

virtual bool duckdb::PhysicalOperator::IsSource ( ) const
inlinevirtual

Reimplemented in duckdb::PhysicalHashJoin.

22233 {
22234 return false;
22235 }

◆ ParallelSource()

virtual bool duckdb::PhysicalOperator::ParallelSource ( ) const
inlinevirtual
22237 {
22238 return false;
22239 }

◆ SupportsPartitioning()

virtual bool duckdb::PhysicalOperator::SupportsPartitioning ( const OperatorPartitionInfo & partition_info) const
inlinevirtual
22241 {
22242 if (partition_info.AnyRequired()) {
22243 return false;
22244 }
22245 return true;
22246 }

◆ SourceOrder()

virtual OrderPreservationType duckdb::PhysicalOperator::SourceOrder ( ) const
inlinevirtual

The type of order emitted by the operator (as a source).

Reimplemented in duckdb::PhysicalDelimJoin, duckdb::PhysicalHashAggregate, duckdb::PhysicalJoin, duckdb::PhysicalOrder, duckdb::PhysicalPerfectHashAggregate, duckdb::PhysicalTableScan, duckdb::PhysicalTopN, and duckdb::PhysicalWindow.

22249 {
22250 return OrderPreservationType::INSERTION_ORDER;
22251 }
Here is the caller graph for this function:

◆ GetProgress()

ProgressData duckdb::PhysicalOperator::GetProgress ( ClientContext & context,
GlobalSourceState & gstate ) const
virtual

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

Reimplemented in duckdb::PhysicalHashAggregate, duckdb::PhysicalHashJoin, duckdb::PhysicalIEJoin, duckdb::PhysicalOrder, duckdb::PhysicalPositionalScan, duckdb::PhysicalTableScan, and duckdb::PhysicalWindow.

201547 {
201548 ProgressData res;
201549 res.SetInvalid();
201550 return res;
201551}

◆ GetSinkProgress()

virtual ProgressData duckdb::PhysicalOperator::GetSinkProgress ( ClientContext & context,
GlobalSinkState & gstate,
const ProgressData source_progress ) const
inlinevirtual

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

Reimplemented in duckdb::PhysicalOrder, and duckdb::PhysicalWindow.

22258 {
22259 return source_progress;
22260 }

◆ ExtraSourceParams()

virtual InsertionOrderPreservingMap< string > duckdb::PhysicalOperator::ExtraSourceParams ( GlobalSourceState & gstate,
LocalSourceState & lstate ) const
inlinevirtual
22263 {
22264 return InsertionOrderPreservingMap<string>();
22265 }

◆ Sink()

SinkResultType duckdb::PhysicalOperator::Sink ( ExecutionContext & context,
DataChunk & chunk,
OperatorSinkInput & input ) const
virtual

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 in duckdb::PhysicalArrowCollector, duckdb::PhysicalAsOfJoin, duckdb::PhysicalBatchCollector, duckdb::PhysicalBatchCopyToFile, duckdb::PhysicalBatchInsert, duckdb::PhysicalBlockwiseNLJoin, duckdb::PhysicalBufferedBatchCollector, duckdb::PhysicalBufferedCollector, duckdb::PhysicalCopyToFile, duckdb::PhysicalCreateIndex, duckdb::PhysicalCreateType, duckdb::PhysicalCrossProduct, duckdb::PhysicalCTE, duckdb::PhysicalDelete, duckdb::PhysicalExplainAnalyze, duckdb::PhysicalExport, duckdb::PhysicalHashAggregate, duckdb::PhysicalHashJoin, duckdb::PhysicalIEJoin, duckdb::PhysicalInsert, duckdb::PhysicalLeftDelimJoin, duckdb::PhysicalLimit, duckdb::PhysicalLimitPercent, duckdb::PhysicalMaterializedCollector, duckdb::PhysicalMergeInto, duckdb::PhysicalNestedLoopJoin, duckdb::PhysicalOrder, duckdb::PhysicalPartitionedAggregate, duckdb::PhysicalPerfectHashAggregate, duckdb::PhysicalPiecewiseMergeJoin, duckdb::PhysicalPositionalJoin, duckdb::PhysicalRecursiveCTE, duckdb::PhysicalReservoirSample, duckdb::PhysicalRightDelimJoin, duckdb::PhysicalSetVariable, duckdb::PhysicalTopN, duckdb::PhysicalUngroupedAggregate, duckdb::PhysicalUpdate, duckdb::PhysicalVacuum, and duckdb::PhysicalWindow.

201558 {
201559 throw InternalException("Calling Sink on a node that is not a sink!");
201560}

◆ Combine()

◆ PrepareFinalize()

void duckdb::PhysicalOperator::PrepareFinalize ( ClientContext & context,
GlobalSinkState & sink_state ) const
virtual

(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 in duckdb::PhysicalHashJoin, duckdb::PhysicalLeftDelimJoin, and duckdb::PhysicalRightDelimJoin.

201568 {
201569}

◆ Finalize()

◆ NextBatch()

SinkNextBatchType duckdb::PhysicalOperator::NextBatch ( ExecutionContext & context,
OperatorSinkNextBatchInput & input ) const
virtual

For sinks with RequiresBatchIndex set to true, when a new batch starts being processed this method is called This allows flushing of the current batch (e.g. to disk)

Reimplemented in duckdb::PhysicalBatchCopyToFile, duckdb::PhysicalBatchInsert, duckdb::PhysicalBufferedBatchCollector, and duckdb::PhysicalPartitionedAggregate.

201576 {
201577 return SinkNextBatchType::READY;
201578}

◆ GetLocalSinkState()

unique_ptr< LocalSinkState > duckdb::PhysicalOperator::GetLocalSinkState ( ExecutionContext & context) const
virtual

Reimplemented in duckdb::PhysicalCreateIndex.

201580 {
201581 return make_uniq<LocalSinkState>();
201582}

◆ GetGlobalSinkState()

unique_ptr< GlobalSinkState > duckdb::PhysicalOperator::GetGlobalSinkState ( ClientContext & context) const
virtual

Reimplemented in duckdb::PhysicalCreateIndex.

201584 {
201585 return make_uniq<GlobalSinkState>();
201586}

◆ GetMaxThreadMemory()

idx_t duckdb::PhysicalOperator::GetMaxThreadMemory ( ClientContext & context)
static

The maximum amount of memory the operator should use per thread.

201588 {
201589 // Memory usage per thread should scale with max mem / num threads
201590 // We take 1/4th of this, to be conservative
201591 auto max_memory = BufferManager::GetBufferManager(context).GetQueryMaxMemory();
201592 auto num_threads = NumericCast<idx_t>(TaskScheduler::GetScheduler(context).NumberOfThreads());
201593 return (max_memory / num_threads) / 4;
201594}

◆ SelectOperatorCachingMode()

OperatorCachingMode duckdb::PhysicalOperator::SelectOperatorCachingMode ( ExecutionContext & context)
static

Whether operator caching is allowed in the current execution context.

201596 {
201597 if (!context.client.config.enable_caching_operators) {
201598 return OperatorCachingMode::NONE;
201599 } else if (!context.pipeline) {
201600 return OperatorCachingMode::NONE;
201601 } else if (!context.pipeline->GetSink()) {
201602 return OperatorCachingMode::NONE;
201603 } else {
201604 auto partition_info = context.pipeline->GetSink()->RequiredPartitionInfo();
201605 if (partition_info.AnyRequired()) {
201606 return OperatorCachingMode::PARTITIONED;
201607 }
201608 }
201609 if (context.pipeline->IsOrderDependent()) {
201610 return OperatorCachingMode::ORDERED;
201611 }
201612
201613 return OperatorCachingMode::UNORDERED;
201614}
Here is the caller graph for this function:

◆ IsSink()

virtual bool duckdb::PhysicalOperator::IsSink ( ) const
inlinevirtual
22299 {
22300 return false;
22301 }

◆ ParallelSink()

virtual bool duckdb::PhysicalOperator::ParallelSink ( ) const
inlinevirtual
22303 {
22304 return false;
22305 }

◆ RequiredPartitionInfo()

virtual OperatorPartitionInfo duckdb::PhysicalOperator::RequiredPartitionInfo ( ) const
inlinevirtual
22307 {
22308 return OperatorPartitionInfo::NoPartitionInfo();
22309 }

◆ SinkOrderDependent()

virtual bool duckdb::PhysicalOperator::SinkOrderDependent ( ) const
inlinevirtual

◆ GetSources()

vector< const_reference< PhysicalOperator > > duckdb::PhysicalOperator::GetSources ( ) const
virtual
201651 {
201652 vector<const_reference<PhysicalOperator>> result;
201653 if (!IsSink() && children.empty()) {
201654 // Operator is a source.
201655 result.push_back(*this);
201656 return result;
201657 }
201658
201659 if (children.size() != 1) {
201660 throw InternalException("Operator not supported in GetSource");
201661 }
201662
201663 if (IsSink()) {
201664 result.push_back(*this);
201665 return result;
201666 }
201667
201668 // Recurse into the child.
201669 return children[0].get().GetSources();
201670}

◆ AllSourcesSupportBatchIndex()

bool duckdb::PhysicalOperator::AllSourcesSupportBatchIndex ( ) const
201672 {
201673 auto sources = GetSources();
201674 for (auto &source : sources) {
201675 if (!source.get().SupportsPartitioning(OperatorPartitionInfo::BatchIndex())) {
201676 return false;
201677 }
201678 }
201679 return true;
201680}

◆ BuildPipelines()

void duckdb::PhysicalOperator::BuildPipelines ( Pipeline & current,
MetaPipeline & meta_pipeline )
virtual
201619 {
201620 op_state.reset();
201621
201622 auto &state = meta_pipeline.GetState();
201623 if (!IsSink() && children.empty()) {
201624 // Operator is a source.
201625 state.SetPipelineSource(current, *this);
201626 return;
201627 }
201628
201629 if (children.size() != 1) {
201630 throw InternalException("Operator not supported in BuildPipelines");
201631 }
201632
201633 if (IsSink()) {
201634 // Operator is a sink.
201635 sink_state.reset();
201636
201637 // It becomes the data source of the current pipeline.
201638 state.SetPipelineSource(current, *this);
201639
201640 // Create a new pipeline starting at the child.
201641 auto &child_meta_pipeline = meta_pipeline.CreateChildMetaPipeline(current, *this);
201642 child_meta_pipeline.Build(children[0].get());
201643 return;
201644 }
201645
201646 // Recurse into the child.
201647 state.AddPipelineOperator(current, *this);
201648 children[0].get().BuildPipelines(current, meta_pipeline);
201649}
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
__host__ cudaTextureObject_t get() const noexcept

◆ Cast() [1/2]

template<class TARGET>
TARGET & duckdb::PhysicalOperator::Cast ( )
inline
22326 {
22327 if (TARGET::TYPE != PhysicalOperatorType::INVALID && type != TARGET::TYPE) {
22328 throw InternalException("Failed to cast physical operator to type - physical operator type mismatch");
22329 }
22330 return reinterpret_cast<TARGET &>(*this);
22331 }

◆ Cast() [2/2]

template<class TARGET>
const TARGET & duckdb::PhysicalOperator::Cast ( ) const
inline
22334 {
22335 if (TARGET::TYPE != PhysicalOperatorType::INVALID && type != TARGET::TYPE) {
22336 throw InternalException("Failed to cast physical operator to type - physical operator type mismatch");
22337 }
22338 return reinterpret_cast<const TARGET &>(*this);
22339 }

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