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

PhysicalReset represents a RESET operation (e.g. RESET a = 42). More...

Inheritance diagram for duckdb::PhysicalReset:
Collaboration diagram for duckdb::PhysicalReset:

Public Member Functions

 PhysicalReset (PhysicalPlan &physical_plan, const std::string &name_p, SetScope scope_p, idx_t estimated_cardinality)
SourceResultType GetDataInternal (ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override
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
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 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

Public Attributes

const String name
const SetScope scope
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::RESET
Static Public Attributes inherited from duckdb::PhysicalOperator
static constexpr const PhysicalOperatorType TYPE = PhysicalOperatorType::INVALID

Private Member Functions

void ResetExtensionVariable (ExecutionContext &context, DBConfig &config, ExtensionOption &extension_option) 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.

Detailed Description

PhysicalReset represents a RESET operation (e.g. RESET a = 42).

Constructor & Destructor Documentation

◆ PhysicalReset()

duckdb::PhysicalReset::PhysicalReset ( PhysicalPlan & physical_plan,
const std::string & name_p,
SetScope scope_p,
idx_t estimated_cardinality )
inline
179350 : PhysicalOperator(physical_plan, PhysicalOperatorType::RESET, {LogicalType::BOOLEAN}, estimated_cardinality),
179351 name(physical_plan.ArenaRef().MakeString(name_p)), scope(scope_p) {
179352 }
idx_t estimated_cardinality
The estimated cardinality.
Definition duckdb.hpp:22154

Member Function Documentation

◆ GetDataInternal()

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

Reimplemented from duckdb::PhysicalOperator.

179451 {
179452 if (scope == SetScope::VARIABLE) {
179453 auto &client_config = ClientConfig::GetConfig(context.client);
179454 client_config.ResetUserVariable(name);
179455 return SourceResultType::FINISHED;
179456 }
179457 auto &config = DBConfig::GetConfig(context.client);
179458 config.CheckLock(name);
179459 auto option = DBConfig::GetOptionByName(name);
179460 if (!option) {
179461 // check if this is an extra extension variable
179462 ExtensionOption extension_option;
179463 if (!config.TryGetExtensionOption(name, extension_option)) {
179464 auto extension_name = Catalog::AutoloadExtensionByConfigName(context.client, name);
179465 if (!config.TryGetExtensionOption(name, extension_option)) {
179466 throw InvalidInputException("Extension parameter %s was not found after autoloading", name);
179467 }
179468 }
179469 ResetExtensionVariable(context, config, extension_option);
179470 return SourceResultType::FINISHED;
179471 }
179472
179473 // Transform scope
179474 SetScope variable_scope = PhysicalSet::GetSettingScope(*option, scope);
179475
179476 if (option->default_value) {
179477 if (option->set_callback) {
179478 SettingCallbackInfo info(context.client, variable_scope);
179479 auto parameter_type = DBConfig::ParseLogicalType(option->parameter_type);
179480 Value reset_val = Value(option->default_value).CastAs(context.client, parameter_type);
179481 option->set_callback(info, reset_val);
179482 }
179483 auto setting_index = option->setting_idx.GetIndex();
179484 if (variable_scope == SetScope::SESSION) {
179485 auto &client_config = ClientConfig::GetConfig(context.client);
179486 client_config.user_settings.ClearSetting(setting_index);
179487 } else {
179488 config.ResetGenericOption(setting_index);
179489 }
179490 return SourceResultType::FINISHED;
179491 }
179492 switch (variable_scope) {
179493 case SetScope::GLOBAL: {
179494 if (!option->set_global) {
179495 throw CatalogException("option \"%s\" cannot be reset globally", name.ToStdString());
179496 }
179497 auto &db = DatabaseInstance::GetDatabase(context.client);
179498 config.ResetOption(&db, *option);
179499 break;
179500 }
179501 case SetScope::SESSION:
179502 if (!option->reset_local) {
179503 throw CatalogException("option \"%s\" cannot be reset locally", name.ToStdString());
179504 }
179505 option->reset_local(context.client);
179506 break;
179507 default:
179508 throw InternalException("Unsupported SetScope for variable");
179509 }
179510
179511 return SourceResultType::FINISHED;
179512}
static String AutoloadExtensionByConfigName(ClientContext &context, const String &configuration_name)
Autoload the extension required for configuration_name or throw a CatalogException.
Definition duckdb.cpp:7659
db
static DUCKDB_API optional_ptr< const ConfigurationOption > GetOptionByName(const String &name)
Fetch an option by name. Returns a pointer to the option, or nullptr if none exists.
Definition duckdb.cpp:274813

◆ IsSource()

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

Reimplemented from duckdb::PhysicalOperator.

179359 {
179360 return true;
179361 }

◆ ResetExtensionVariable()

void duckdb::PhysicalReset::ResetExtensionVariable ( ExecutionContext & context,
DBConfig & config,
ExtensionOption & extension_option ) const
private
179437 {
179438 if (extension_option.set_function) {
179439 extension_option.set_function(context.client, scope, extension_option.default_value);
179440 }
179441 if (scope == SetScope::GLOBAL) {
179442 config.ResetOption(extension_option);
179443 } else {
179444 auto &client_config = ClientConfig::GetConfig(context.client);
179445 auto setting_index = extension_option.setting_index.GetIndex();
179446 client_config.user_settings.SetUserSetting(setting_index, extension_option.default_value);
179447 }
179448}

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