|
|
static constexpr idx_t | ROWS_PER_THREAD = 4 |
◆ CSVIterator()
| duckdb::CSVIterator::CSVIterator |
( |
| ) |
|
168905 : buffer_size(0),
is_set(
false) {
168906}
bool is_set
Definition duckdb.cpp:166117
◆ Print()
| void duckdb::CSVIterator::Print |
( |
| ) |
const |
168918 {
168919#ifndef DUCKDB_DISABLE_PRINT
168921 std::cout <<
"Is set: " <<
is_set <<
'\n';
168922#endif
168923}
CSVBoundary boundary
The original setting.
Definition duckdb.cpp:166114
◆ Next()
Moves the boundary to the next one to be scanned, if there are no next boundaries, it returns False Otherwise, if there are boundaries, it returns True
168941 {
168943 return false;
168944 }
168945 const auto bytes_per_thread = BytesPerThread(reader_options);
168946
168947
168948 first_one = false;
168950
168951 auto buffer = buffer_manager.GetBuffer(
boundary.buffer_idx);
168952 if (buffer->is_last_buffer &&
boundary.buffer_pos + bytes_per_thread > buffer->actual_size) {
168953
168954 return false;
168955 }
else if (
boundary.buffer_pos + bytes_per_thread >= buffer->actual_size) {
168956
168957
168960
168961 auto next_buffer = buffer_manager.GetBuffer(
boundary.buffer_idx);
168962 if (!next_buffer) {
168963 return false;
168964 }
168965
168966 } else {
168967
168968 boundary.buffer_pos += bytes_per_thread;
168969 }
168971 SetCurrentPositionToBoundary();
168972 return true;
168973}
◆ IsBoundarySet()
| bool duckdb::CSVIterator::IsBoundarySet |
( |
| ) |
const |
◆ GetEndPos()
| idx_t duckdb::CSVIterator::GetEndPos |
( |
| ) |
const |
◆ GetBufferIdx()
| idx_t duckdb::CSVIterator::GetBufferIdx |
( |
| ) |
const |
168982 {
168983 return pos.buffer_idx;
168984}
◆ GetBoundaryIdx()
| idx_t duckdb::CSVIterator::GetBoundaryIdx |
( |
| ) |
const |
◆ SetCurrentPositionToBoundary()
| void duckdb::CSVIterator::SetCurrentPositionToBoundary |
( |
| ) |
|
168990 {
168991 pos.buffer_idx =
boundary.buffer_idx;
168992 pos.buffer_pos =
boundary.buffer_pos;
168993}
◆ SetCurrentBoundaryToPosition()
| void duckdb::CSVIterator::SetCurrentBoundaryToPosition |
( |
bool | single_threaded, |
|
|
const CSVReaderOptions & | reader_options ) |
168995 {
168996 if (single_threaded) {
168998 return;
168999 }
169000 const auto bytes_per_thread = BytesPerThread(reader_options);
169001
169002 boundary.buffer_idx = pos.buffer_idx;
169003 if (pos.buffer_pos == 0) {
169004 boundary.end_pos = bytes_per_thread;
169005 } else {
169006 boundary.end_pos = ((pos.buffer_pos + bytes_per_thread - 1) / bytes_per_thread) * bytes_per_thread;
169007 }
169008
169011}
◆ SetStart()
| void duckdb::CSVIterator::SetStart |
( |
idx_t | pos | ) |
|
◆ SetEnd()
| void duckdb::CSVIterator::SetEnd |
( |
idx_t | pos | ) |
|
◆ GetGlobalCurrentPos()
| idx_t duckdb::CSVIterator::GetGlobalCurrentPos |
( |
| ) |
const |
169027 {
169028 return pos.buffer_pos + buffer_size * pos.buffer_idx;
169029}
◆ CheckIfDone()
| void duckdb::CSVIterator::CheckIfDone |
( |
| ) |
|
Checks if we are done with this iterator.
169021 {
169023 done = true;
169024 }
169025}
bool IsBoundarySet() const
If boundary is set.
Definition duckdb.cpp:168975
◆ BytesPerThread()
168925 {
168926 const idx_t buffer_size = reader_options.buffer_size_option.GetValue();
168927 const idx_t max_row_size = reader_options.maximum_line_size.GetValue();
168929 if (bytes_per_thread < max_row_size) {
168930
168931 return max_row_size;
168932 }
168933 if (bytes_per_thread == 0) {
168934
168935
168936 return 1;
168937 }
168938 return bytes_per_thread;
168939}
static constexpr idx_t ROWS_PER_BUFFER
By default, we use CSV_BUFFER_SIZE to allocate each buffer.
Definition duckdb.hpp:45985
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
◆ is_set
| bool duckdb::CSVIterator::is_set |
|
private |
Sometimes life knows no boundaries. The boundaries don't have to be set for single-threaded execution.
The documentation for this struct was generated from the following file: