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

Scanner used to skip lines in a CSV File. More...

Inheritance diagram for duckdb::SkipScanner:
Collaboration diagram for duckdb::SkipScanner:

Public Member Functions

 SkipScanner (shared_ptr< CSVBufferManager > buffer_manager, const shared_ptr< CSVStateMachine > &state_machine, shared_ptr< CSVErrorHandler > error_handler, idx_t rows_to_skip)
SkipResult & ParseChunk () override
 Parses data into an output_chunk.
SkipResult & GetResult () override
 Returns the result from the last Parse call. Shouts at you if you call it wrong.
Public Member Functions inherited from duckdb::BaseScanner
 BaseScanner (shared_ptr< CSVBufferManager > buffer_manager, shared_ptr< CSVStateMachine > state_machine, shared_ptr< CSVErrorHandler > error_handler, bool sniffing=false, shared_ptr< CSVFileScan > csv_file_scan=nullptr, const CSVIterator &iterator={})
void Print () const
bool FinishedFile () const
 Returns true if the scanner is finished.
CSVIterator & GetIterator ()
void SetIterator (const CSVIterator &it)
idx_t GetBoundaryIndex () const
idx_t GetLinesRead () const
CSVPosition GetIteratorPosition () const
CSVStateMachine & GetStateMachine () const

Private Member Functions

void Initialize () override
void FinalizeChunkProcess () override
 Finalizes the process of the chunk.

Private Attributes

SkipResult result

Additional Inherited Members

Static Public Member Functions inherited from duckdb::BaseScanner
static string RemoveSeparator (const char *value_ptr, const idx_t size, char thousands_separator)
 Removes thousands separator.
static CSVIterator SkipCSVRows (shared_ptr< CSVBufferManager > buffer_manager, const shared_ptr< CSVStateMachine > &state_machine, idx_t rows_to_skip)
static bool ContainsZeroByte (uint64_t v)
Public Attributes inherited from duckdb::BaseScanner
shared_ptr< CSVFileScan > csv_file_scan
bool sniffing = false
 If this scanner is being used for sniffing.
shared_ptr< CSVErrorHandler > error_handler
 The guy that handles errors.
shared_ptr< CSVStateMachine > state_machine
 Shared pointer to the state machine, this is used across multiple scanners.
CSVStates states
 States.
bool ever_quoted = false
 If the scanner ever entered a quoted state.
bool ever_escaped = false
 If the scanner ever entered an escaped state.
bool used_unstrictness = false
 If the scanner ever used advantage of the non-strict mode.
shared_ptr< CSVBufferManager > buffer_manager
 Shared pointer to the buffer_manager, this is shared across multiple scanners.
Protected Member Functions inherited from duckdb::BaseScanner
template<class T>
void Process (T &result)
 Process one chunk.
template<class T>
void ParseChunkInternal (T &result)
 Internal function for parse chunk.
Protected Attributes inherited from duckdb::BaseScanner
CSVIterator iterator
 Boundaries of this scanner.
shared_ptr< CSVBufferHandle > cur_buffer_handle
char * buffer_handle_ptr = nullptr
 Hold the current buffer ptr.
bool initialized = false
 If this scanner has been initialized.
idx_t lines_read = 0
 How many lines were read by this scanner.
idx_t bytes_read = 0

Detailed Description

Scanner used to skip lines in a CSV File.

Constructor & Destructor Documentation

◆ SkipScanner()

duckdb::SkipScanner::SkipScanner ( shared_ptr< CSVBufferManager > buffer_manager,
const shared_ptr< CSVStateMachine > & state_machine,
shared_ptr< CSVErrorHandler > error_handler,
idx_t rows_to_skip )
169090 : BaseScanner(std::move(buffer_manager), state_machine, std::move(error_handler)),
169091 result(states, *state_machine, rows_to_skip) {
169092}
shared_ptr< CSVStateMachine > state_machine
Shared pointer to the state machine, this is used across multiple scanners.
Definition duckdb.cpp:167295
CSVStates states
States.
Definition duckdb.cpp:167298
shared_ptr< CSVBufferManager > buffer_manager
Shared pointer to the buffer_manager, this is shared across multiple scanners.
Definition duckdb.cpp:167310
shared_ptr< CSVErrorHandler > error_handler
The guy that handles errors.
Definition duckdb.cpp:167292

Member Function Documentation

◆ ParseChunk()

SkipResult & duckdb::SkipScanner::ParseChunk ( )
overridevirtual

Parses data into an output_chunk.

Reimplemented from duckdb::BaseScanner.

169094 {
169095 ParseChunkInternal(result);
169096 return result;
169097}
void ParseChunkInternal(T &result)
Internal function for parse chunk.
Definition duckdb.cpp:167542
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetResult()

SkipResult & duckdb::SkipScanner::GetResult ( )
overridevirtual

Returns the result from the last Parse call. Shouts at you if you call it wrong.

Reimplemented from duckdb::BaseScanner.

169099 {
169100 return result;
169101}

◆ Initialize()

void duckdb::SkipScanner::Initialize ( )
overrideprivatevirtual

Internal Functions used to perform the parsing Initializes the scanner

Reimplemented from duckdb::BaseScanner.

169103 {
169104 states.Initialize();
169105}

◆ FinalizeChunkProcess()

void duckdb::SkipScanner::FinalizeChunkProcess ( )
overrideprivatevirtual

Finalizes the process of the chunk.

Reimplemented from duckdb::BaseScanner.

169107 {
169108 // We continue skipping until we skipped enough rows, or we have nothing else to read.
169109 while (!FinishedFile() && result.row_count < result.rows_to_skip) {
169110 cur_buffer_handle = buffer_manager->GetBuffer(++iterator.pos.buffer_idx);
169111 if (cur_buffer_handle) {
169112 iterator.pos.buffer_pos = 0;
169114 Process(result);
169115 }
169116 }
169117 // Skip Carriage Return
169118 if (state_machine->options.dialect_options.state_machine_options.new_line == NewLineIdentifier::CARRY_ON &&
169119 states.states[1] == CSVState::CARRIAGE_RETURN) {
169120 iterator.pos.buffer_pos++;
169121 }
169122 iterator.done = FinishedFile();
169123}
CSVIterator iterator
Boundaries of this scanner.
Definition duckdb.cpp:167323
void Process(T &result)
Process one chunk.
Definition duckdb.cpp:167343
bool FinishedFile() const
Returns true if the scanner is finished.
Definition duckdb.cpp:168380
shared_ptr< CSVBufferHandle > cur_buffer_handle
Definition duckdb.cpp:167327
char * buffer_handle_ptr
Hold the current buffer ptr.
Definition duckdb.cpp:167330
@ CARRIAGE_RETURN
State after encountering a record separator (i.e., ).
Definition duckdb.cpp:59182
Here is the call graph for this function:

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