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< BaseUnionData > GetUnionData (idx_t file_idx)
virtual DUCKDB_API unique_ptr< BaseStatistics > GetStatistics (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>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const
Public Member Functions inherited from duckdb::enable_shared_from_this< BaseFileReader >
shared_ptr< BaseFileReader > shared_from_this ()

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< MultiFileColumnDefinition > columns
 The set of columns for the current file.
MultiFileLocalColumnIds< MultiFileLocalColumnId > column_ids
 The column ids to read from the file.
vector< ColumnIndex > column_indexes
 The column indexes to read from the file.
unique_ptr< TableFilterSet > filters
 The set of table filters (adjusted to local indexes).
unordered_map< column_t, unique_ptr< Expression > > expression_map
unordered_map< column_t, LogicalType > cast_map
 The final types for various expressions - this is ONLY used if UseCastMap() is explicitly enabled.
unique_ptr< DeleteFilter > deletion_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 & operator= (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

Reimplemented in duckdb::CSVFileScan.

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.

Reimplemented in duckdb::DuckDBReader.

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.

Reimplemented in duckdb::DirectFileReader, and duckdb::DuckDBReader.

80384 {
80385 return nullptr;
80386}
Here is the caller graph for this function:

◆ PrepareReader()

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

Prepare reader for scanning.

Reimplemented in duckdb::CSVFileScan.

80395 {
80396}

◆ TryInitializeScan()

virtual bool duckdb::BaseFileReader::TryInitializeScan ( ClientContext & context,
GlobalTableFunctionState & gstate,
LocalTableFunctionState & lstate )
pure virtual

Try to initialize a scan over the reader - this is done while the global lock is held.

Implemented in duckdb::CSVFileScan, duckdb::DirectFileReader, and duckdb::DuckDBReader.

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

◆ Scan()

virtual AsyncResult duckdb::BaseFileReader::Scan ( ClientContext & context,
GlobalTableFunctionState & global_state,
LocalTableFunctionState & local_state,
DataChunk & chunk )
pure virtual

Scan a chunk from the read state.

Implemented in duckdb::CSVFileScan, duckdb::DirectFileReader, and duckdb::DuckDBReader.

◆ FinishFile()

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

Finish scanning a given file.

Reimplemented in duckdb::CSVFileScan, duckdb::DirectFileReader, and duckdb::DuckDBReader.

80398 {
80399}

◆ GetProgressInFile()

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

Get progress within a given file.

Reimplemented in duckdb::CSVFileScan, and duckdb::DuckDBReader.

80401 {
80402 return 0;
80403}
Here is the caller graph for this function:

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