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::BaseFileReader Class Referenceabstract
Inheritance diagram for duckdb::BaseFileReader:
Collaboration diagram for duckdb::BaseFileReader:

Public Member Functions

 BaseFileReader (OpenFileInfo file_p)
 
const vector< MultiFileColumnDefinition > & GetColumns () const
 
const string & GetFileName () const
 
virtual bool UseCastMap () const
 
virtual void AddVirtualColumn (column_t virtual_column_id)
 Adds a virtual column to be projected at the end.
 
virtual DUCKDB_API shared_ptr< BaseUnionDataGetUnionData (idx_t file_idx)
 
virtual DUCKDB_API unique_ptr< BaseStatisticsGetStatistics (ClientContext &context, const string &name)
 Get statistics for a specific column.
 
virtual DUCKDB_API void PrepareReader (ClientContext &context, GlobalTableFunctionState &)
 Prepare reader for scanning.
 
virtual bool TryInitializeScan (ClientContext &context, GlobalTableFunctionState &gstate, LocalTableFunctionState &lstate)=0
 Try to initialize a scan over the reader - this is done while the global lock is held.
 
virtual void PrepareScan (ClientContext &context, GlobalTableFunctionState &gstate, LocalTableFunctionState &lstate)
 Prepare a scan - called after TryInitializeScan succeeds - this is done without any lock held.
 
virtual AsyncResult Scan (ClientContext &context, GlobalTableFunctionState &global_state, LocalTableFunctionState &local_state, DataChunk &chunk)=0
 Scan a chunk from the read state.
 
virtual DUCKDB_API void FinishFile (ClientContext &context, GlobalTableFunctionState &gstate)
 Finish scanning a given file.
 
virtual DUCKDB_API double GetProgressInFile (ClientContext &context)
 Get progress within a given file.
 
virtual string GetReaderType () const =0
 
template<class TARGET >
TARGETCast ()
 
template<class TARGET >
const TARGETCast () const
 
- Public Member Functions inherited from duckdb::enable_shared_from_this< BaseFileReader >
shared_ptr< BaseFileReadershared_from_this ()
 
shared_ptr< BaseFileReader constshared_from_this () const
 

Public Attributes

OpenFileInfo file
 The file we are reading.
 
optional_idx file_list_idx
 (Optionally) The file index (generated by the multi file reader)
 
vector< MultiFileColumnDefinitioncolumns
 The set of columns for the current file.
 
MultiFileLocalColumnIds< MultiFileLocalColumnIdcolumn_ids
 The column ids to read from the file.
 
vector< ColumnIndexcolumn_indexes
 The column indexes to read from the file.
 
unique_ptr< TableFilterSetfilters
 The set of table filters (adjusted to local indexes)
 
unordered_map< column_t, unique_ptr< Expression > > expression_map
 
unordered_map< column_t, LogicalTypecast_map
 The final types for various expressions - this is ONLY used if UseCastMap() is explicitly enabled.
 
unique_ptr< DeleteFilterdeletion_filter
 (Optionally) The deletion filter (generated by the multi file reader)
 

Additional Inherited Members

- Protected Member Functions inherited from duckdb::enable_shared_from_this< BaseFileReader >
 enable_shared_from_this (enable_shared_from_this const &) noexcept
 
enable_shared_from_thisoperator= (enable_shared_from_this const &) noexcept
 

Detailed Description

Parent class of single-file readers - this must be inherited from for readers implementing the MultiFileReader interface

Constructor & Destructor Documentation

◆ BaseFileReader()

duckdb::BaseFileReader::BaseFileReader ( OpenFileInfo  file_p)
inlineexplicit
80249 : file(std::move(file_p)) {
80250 }
OpenFileInfo file
The file we are reading.
Definition duckdb.cpp:80254

Member Function Documentation

◆ GetColumns()

const vector< MultiFileColumnDefinition > & duckdb::BaseFileReader::GetColumns ( ) const
inline
80275 {
80276 return columns;
80277 }
vector< MultiFileColumnDefinition > columns
The set of columns for the current file.
Definition duckdb.cpp:80258

◆ GetFileName()

const string & duckdb::BaseFileReader::GetFileName ( ) const
inline
80278 {
80279 return file.path;
80280 }

◆ UseCastMap()

virtual bool duckdb::BaseFileReader::UseCastMap ( ) const
inlinevirtual

Whether or not to push casts into the cast map

80281 {
80283 return false;
80284 }

◆ AddVirtualColumn()

virtual void duckdb::BaseFileReader::AddVirtualColumn ( column_t  virtual_column_id)
inlinevirtual

Adds a virtual column to be projected at the end.

80286 {
80287 throw InternalException("Reader %s does not support AddVirtualColumn", GetReaderType());
80288 }

◆ GetUnionData()

shared_ptr< BaseUnionData > duckdb::BaseFileReader::GetUnionData ( idx_t  file_idx)
virtual
80388 {
80389 throw NotImplementedException("Union by name not supported for reader of type %s", GetReaderType());
80390}

◆ GetStatistics()

unique_ptr< BaseStatistics > duckdb::BaseFileReader::GetStatistics ( ClientContext context,
const string &  name 
)
virtual

Get statistics for a specific column.

80384 {
80385 return nullptr;
80386}

◆ PrepareReader()

void duckdb::BaseFileReader::PrepareReader ( ClientContext context,
GlobalTableFunctionState  
)
virtual

Prepare reader for scanning.

80395 {
80396}

◆ PrepareScan()

void duckdb::BaseFileReader::PrepareScan ( ClientContext context,
GlobalTableFunctionState gstate,
LocalTableFunctionState lstate 
)
virtual

Prepare a scan - called after TryInitializeScan succeeds - this is done without any lock held.

80392 {
80393}

◆ FinishFile()

void duckdb::BaseFileReader::FinishFile ( ClientContext context,
GlobalTableFunctionState gstate 
)
virtual

Finish scanning a given file.

80398 {
80399}

◆ GetProgressInFile()

double duckdb::BaseFileReader::GetProgressInFile ( ClientContext context)
virtual

Get progress within a given file.

80401 {
80402 return 0;
80403}

◆ Cast() [1/2]

template<class TARGET >
TARGET & duckdb::BaseFileReader::Cast ( )
inline
80314 {
80315 DynamicCastCheck<TARGET>(this);
80316 return reinterpret_cast<TARGET &>(*this);
80317 }

◆ Cast() [2/2]

template<class TARGET >
const TARGET & duckdb::BaseFileReader::Cast ( ) const
inline
80319 {
80320 DynamicCastCheck<TARGET>(this);
80321 return reinterpret_cast<const TARGET &>(*this);
80322 }

Member Data Documentation

◆ expression_map

unordered_map<column_t, unique_ptr<Expression> > duckdb::BaseFileReader::expression_map

Expression to execute for a given column (BEFORE executing the filter) NOTE: this is only set when we have filters - it can be ignored for readers that don't have filter pushdown


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