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::MultiFileFunction< OP > Class Template Reference
Inheritance diagram for duckdb::MultiFileFunction< OP >:
Collaboration diagram for duckdb::MultiFileFunction< OP >:

Public Member Functions

 MultiFileFunction (string name_p)
Public Member Functions inherited from duckdb::TableFunction
DUCKDB_API TableFunction (string name, const vector< LogicalType > &arguments, table_function_t function, table_function_bind_t bind=nullptr, table_function_init_global_t init_global=nullptr, table_function_init_local_t init_local=nullptr)
DUCKDB_API TableFunction (const vector< LogicalType > &arguments, table_function_t function, table_function_bind_t bind=nullptr, table_function_init_global_t init_global=nullptr, table_function_init_local_t init_local=nullptr)
DUCKDB_API TableFunction (string name, const vector< LogicalType > &arguments, std::nullptr_t function, table_function_bind_t bind=nullptr, table_function_init_global_t init_global=nullptr, table_function_init_local_t init_local=nullptr)
DUCKDB_API TableFunction (const vector< LogicalType > &arguments, std::nullptr_t function, table_function_bind_t bind=nullptr, table_function_init_global_t init_global=nullptr, table_function_init_local_t init_local=nullptr)
bool HasBindCallback () const
table_function_bind_t GetBindCallback () const
bool HasSerializationCallbacks () const
void SetSerializeCallback (table_function_serialize_t callback)
void SetDeserializeCallback (table_function_deserialize_t callback)
table_function_serialize_t GetSerializeCallback () const
table_function_deserialize_t GetDeserializeCallback () const
DUCKDB_API bool Equal (const TableFunction &rhs) const
DUCKDB_API bool operator== (const TableFunction &rhs) const
DUCKDB_API bool operator!= (const TableFunction &rhs) const
Public Member Functions inherited from duckdb::SimpleNamedParameterFunction
DUCKDB_API SimpleNamedParameterFunction (string name, vector< LogicalType > arguments, LogicalType varargs=LogicalType(LogicalTypeId::INVALID))
DUCKDB_API string ToString () const override
DUCKDB_API bool HasNamedParameters () const
Public Member Functions inherited from duckdb::SimpleFunction
DUCKDB_API SimpleFunction (string name, vector< LogicalType > arguments, LogicalType varargs=LogicalType(LogicalTypeId::INVALID))
DUCKDB_API bool HasVarArgs () const
Public Member Functions inherited from duckdb::Function
DUCKDB_API Function (string name)

Static Public Member Functions

static unique_ptr< FunctionData > MultiFileBindInternal (ClientContext &context, unique_ptr< MultiFileReader > multi_file_reader_p, shared_ptr< MultiFileList > multi_file_list_p, vector< LogicalType > &return_types, vector< string > &names, MultiFileOptions file_options_p, unique_ptr< BaseFileReaderOptions > options_p, unique_ptr< MultiFileReaderInterface > interface_p)
static unique_ptr< FunctionData > MultiFileBind (ClientContext &context, TableFunctionBindInput &input, vector< LogicalType > &return_types, vector< string > &names)
static unique_ptr< FunctionData > MultiFileBindCopy (ClientContext &context, CopyFromFunctionBindInput &input, vector< string > &expected_names, vector< LogicalType > &expected_types)
static unique_ptr< MultiFileList > MultiFileFilterPushdown (ClientContext &context, const MultiFileBindData &data, const vector< column_t > &column_ids, optional_ptr< TableFilterSet > filters)
static bool TryGetNextFile (MultiFileGlobalState &global_state, unique_lock< mutex > &parallel_lock)
static ReaderInitializeType InitializeReader (MultiFileReaderData &reader_data, const MultiFileBindData &bind_data, const vector< ColumnIndex > &global_column_ids, optional_ptr< TableFilterSet > table_filters, ClientContext &context, optional_idx file_idx, MultiFileGlobalState &global_state)
static bool TryOpenNextFile (ClientContext &context, const MultiFileBindData &bind_data, MultiFileLocalState &scan_data, MultiFileGlobalState &global_state, unique_lock< mutex > &parallel_lock)
 Helper function that try to start opening a next file. Parallel lock should be locked when calling.
static void WaitForFile (idx_t file_index, MultiFileGlobalState &global_state, unique_lock< mutex > &parallel_lock)
 Wait for a file to become available. Parallel lock should be locked when calling.
static void InitializeFileScanState (ClientContext &context, MultiFileReaderData &reader_data, MultiFileLocalState &lstate, vector< idx_t > &projection_ids)
static bool TryInitializeNextBatch (ClientContext &context, const MultiFileBindData &bind_data, MultiFileLocalState &scan_data, MultiFileGlobalState &gstate)
static unique_ptr< LocalTableFunctionState > MultiFileInitLocal (ExecutionContext &context, TableFunctionInitInput &input, GlobalTableFunctionState *gstate_p)
static unique_ptr< GlobalTableFunctionState > MultiFileInitGlobal (ClientContext &context, TableFunctionInitInput &input)
static OperatorPartitionData MultiFileGetPartitionData (ClientContext &context, TableFunctionGetPartitionInput &input)
static void MultiFileScan (ClientContext &context, TableFunctionInput &data_p, DataChunk &output)
static unique_ptr< BaseStatistics > MultiFileScanStats (ClientContext &context, const FunctionData *bind_data_p, column_t column_index)
static double MultiFileProgress (ClientContext &context, const FunctionData *bind_data_p, const GlobalTableFunctionState *global_state)
static unique_ptr< NodeStatistics > MultiFileCardinality (ClientContext &context, const FunctionData *bind_data)
static void MultiFileComplexFilterPushdown (ClientContext &context, LogicalGet &get, FunctionData *bind_data_p, vector< unique_ptr< Expression > > &filters)
static BindInfo MultiFileGetBindInfo (const optional_ptr< FunctionData > bind_data_p)
static TablePartitionInfo MultiFileGetPartitionInfo (ClientContext &context, TableFunctionPartitionInput &input)
static virtual_column_map_t MultiFileGetVirtualColumns (ClientContext &context, optional_ptr< FunctionData > bind_data_p)
static InsertionOrderPreservingMap< string > MultiFileDynamicToString (TableFunctionDynamicToStringInput &input)
static void PushdownType (ClientContext &context, optional_ptr< FunctionData > bind_data_p, const unordered_map< idx_t, LogicalType > &new_column_types)
Static Public Member Functions inherited from duckdb::Function
static DUCKDB_API string CallToString (const string &catalog_name, const string &schema_name, const string &name, const vector< LogicalType > &arguments, const LogicalType &varargs=LogicalType::INVALID)
 Returns the formatted string name(arg1, arg2, ...).
static DUCKDB_API string CallToString (const string &catalog_name, const string &schema_name, const string &name, const vector< LogicalType > &arguments, const LogicalType &varargs, const LogicalType &return_type)
 Returns the formatted string name(arg1, arg2..) -> return_type.
static DUCKDB_API string CallToString (const string &catalog_name, const string &schema_name, const string &name, const vector< LogicalType > &arguments, const named_parameter_type_map_t &named_parameters)
 Returns the formatted string name(arg1, arg2.., np1=a, np2=b, ...).
static DUCKDB_API void EraseArgument (SimpleFunction &bound_function, vector< unique_ptr< Expression > > &arguments, idx_t argument_index)
 Used in the bind to erase an argument from a function.

Static Private Member Functions

static bool HasFilesToRead (MultiFileGlobalState &gstate, unique_lock< mutex > &parallel_lock)

Additional Inherited Members

Public Attributes inherited from duckdb::TableFunction
table_function_bind_t bind
table_function_bind_replace_t bind_replace
table_function_bind_operator_t bind_operator
table_function_init_global_t init_global
table_function_init_local_t init_local
table_function_t function
 The main function.
table_in_out_function_t in_out_function
 The table in-out function (if this is an in-out function).
table_in_out_function_final_t in_out_function_final
 The table in-out final function (if this is an in-out function).
table_statistics_t statistics
table_statistics_extended_t statistics_extended
table_function_dependency_t dependency
table_function_cardinality_t cardinality
table_function_rows_scanned_t rows_scanned
 (Optional) returns the number of rows that have benn scanned
table_function_pushdown_complex_filter_t pushdown_complex_filter
table_function_pushdown_expression_t pushdown_expression
 (Optional) whether or not this table function supports pushing down an expression into a TableFilter
table_function_to_string_t to_string
 (Optional) function for rendering the operator to a string in explain/profiling output (invoked pre-execution)
table_function_dynamic_to_string_t dynamic_to_string
 (Optional) function for rendering the operator to a string in profiling output (invoked post-execution)
table_function_progress_t table_scan_progress
 (Optional) return how much of the table we have scanned up to this point (% of the data)
table_function_get_partition_data_t get_partition_data
 (Optional) returns the partition info of the current scan operator
table_function_get_bind_info_t get_bind_info
 (Optional) returns extra bind info
table_function_type_pushdown_t type_pushdown
 (Optional) pushes down type information to scanner, returns true if pushdown was successful
table_function_get_multi_file_reader_t get_multi_file_reader
 (Optional) allows injecting a custom MultiFileReader implementation
table_function_supports_pushdown_type_t supports_pushdown_type
 (Optional) If this scanner supports filter pushdown, but not to all data types
table_function_supports_pushdown_extract_t supports_pushdown_extract
 (Optional) If this scanner supports projection pushdown of struct extracts
table_function_get_partition_info_t get_partition_info
 Get partition info of the table.
table_function_get_partition_stats_t get_partition_stats
 (Optional) get a list of all the partition stats of the table
table_function_get_virtual_columns_t get_virtual_columns
 (Optional) returns a list of virtual columns emitted by the table function
table_function_get_row_id_columns get_row_id_columns
 (Optional) returns a list of row id columns
table_function_set_scan_order set_scan_order
 (Optional) sets the order to scan the row groups in
table_function_serialize_t serialize
table_function_deserialize_t deserialize
bool verify_serialization = true
bool projection_pushdown
bool filter_pushdown
bool filter_prune
bool sampling_pushdown
bool late_materialization
 Whether or not the table function supports late materialization.
shared_ptr< TableFunctionInfo > function_info
 Additional function info, passed to the bind.
OrderPreservationType order_preservation_type = OrderPreservationType::INSERTION_ORDER
 The order preservation type of the table function.
TableFunctionInitialization global_initialization = TableFunctionInitialization::INITIALIZE_ON_EXECUTE
Public Attributes inherited from duckdb::SimpleNamedParameterFunction
named_parameter_type_map_t named_parameters
 The named parameters of the function.
Public Attributes inherited from duckdb::SimpleFunction
vector< LogicalType > arguments
 The set of arguments of the function.
vector< LogicalType > original_arguments
LogicalType varargs
Public Attributes inherited from duckdb::Function
string name
 The name of the function.
string extra_info
 Additional Information to specify function from it's name.
string catalog_name
string schema_name

Constructor & Destructor Documentation

◆ MultiFileFunction()

template<class OP>
duckdb::MultiFileFunction< OP >::MultiFileFunction ( string name_p)
inlineexplicit
82848 : TableFunction(std::move(name_p), {LogicalType::VARCHAR}, MultiFileScan, MultiFileBind, MultiFileInitGlobal,
82849 MultiFileInitLocal) {
82850 cardinality = MultiFileCardinality;
82851 table_scan_progress = MultiFileProgress;
82852 get_partition_data = MultiFileGetPartitionData;
82853 get_bind_info = MultiFileGetBindInfo;
82854 projection_pushdown = true;
82855 pushdown_complex_filter = MultiFileComplexFilterPushdown;
82856 get_partition_info = MultiFileGetPartitionInfo;
82857 get_virtual_columns = MultiFileGetVirtualColumns;
82858 dynamic_to_string = MultiFileDynamicToString;
82860 }
Definition duckdb.cpp:82845
static unique_ptr< GlobalTableFunctionState > MultiFileInitGlobal(ClientContext &context, TableFunctionInitInput &input)
Definition duckdb.cpp:83258
table_function_progress_t table_scan_progress
(Optional) return how much of the table we have scanned up to this point (% of the data)
Definition duckdb.hpp:26594
table_function_get_partition_info_t get_partition_info
Get partition info of the table.
Definition duckdb.hpp:26608
table_function_get_virtual_columns_t get_virtual_columns
(Optional) returns a list of virtual columns emitted by the table function
Definition duckdb.hpp:26612
table_function_cardinality_t cardinality
Definition duckdb.hpp:26581
table_function_dynamic_to_string_t dynamic_to_string
(Optional) function for rendering the operator to a string in profiling output (invoked post-executio...
Definition duckdb.hpp:26592
table_function_get_partition_data_t get_partition_data
(Optional) returns the partition info of the current scan operator
Definition duckdb.hpp:26596
table_function_get_bind_info_t get_bind_info
(Optional) returns extra bind info
Definition duckdb.hpp:26598
bool projection_pushdown
Definition duckdb.hpp:26624
table_function_pushdown_complex_filter_t pushdown_complex_filter
Definition duckdb.hpp:26586
static DUCKDB_API void AddParameters(TableFunction &table_function)
Add the parameters for multi-file readers (e.g. union_by_name, filename) to a table function.
Definition duckdb.cpp:84312

Member Function Documentation

◆ MultiFileBindInternal()

template<class OP>
unique_ptr< FunctionData > duckdb::MultiFileFunction< OP >::MultiFileBindInternal ( ClientContext & context,
unique_ptr< MultiFileReader > multi_file_reader_p,
shared_ptr< MultiFileList > multi_file_list_p,
vector< LogicalType > & return_types,
vector< string > & names,
MultiFileOptions file_options_p,
unique_ptr< BaseFileReaderOptions > options_p,
unique_ptr< MultiFileReaderInterface > interface_p )
inlinestatic
82868 {
82869 auto &interface = *interface_p;
82870
82872 result->multi_file_reader = std::move(multi_file_reader_p);
82873 result->file_list = std::move(multi_file_list_p);
82874 // auto-detect hive partitioning
82875 result->file_options = std::move(file_options_p);
82876 result->bind_data = interface.InitializeBindData(*result, std::move(options_p));
82877 result->interface = std::move(interface_p);
82878
82879 // now bind the readers
82880 // there are two ways of binding the readers
82881 // (1) MultiFileReader::Bind -> custom bind, used only for certain lakehouse extensions
82882 // (2) Interface::BindReader
82883 bool bound_on_first_file = true;
82884 if (result->multi_file_reader->Bind(result->file_options, *result->file_list, result->types, result->names,
82885 result->reader_bind)) {
82886 result->multi_file_reader->BindOptions(result->file_options, *result->file_list, result->types,
82887 result->names, result->reader_bind);
82888 bound_on_first_file = false;
82889 } else {
82890 result->file_options.AutoDetectHivePartitioning(*result->file_list, context);
82891 interface.BindReader(context, result->types, result->names, *result);
82892 }
82893 interface.FinalizeBindData(*result);
82894
82895 if (return_types.empty()) {
82896 // no expected types - just copy the types
82897 return_types = result->types;
82898 names = result->names;
82899 } else {
82900 // We're deserializing from a previously successful bind call
82901 // verify that the amount of columns still matches
82902 if (return_types.size() != result->types.size()) {
82903 string file_string;
82904 if (!result->file_options.union_by_name && bound_on_first_file) {
82905 file_string = result->file_list->GetFirstFile().path;
82906 } else {
82907 for (auto &file : result->file_list->GetAllFiles()) {
82908 if (!file_string.empty()) {
82909 file_string += ",";
82910 }
82911 file_string += file.path;
82912 }
82913 }
82914 string extended_error;
82915 extended_error = "Table schema: ";
82916 for (idx_t col_idx = 0; col_idx < return_types.size(); col_idx++) {
82917 if (col_idx > 0) {
82918 extended_error += ", ";
82919 }
82920 extended_error += names[col_idx] + " " + return_types[col_idx].ToString();
82921 }
82922 extended_error += "\nParquet schema: ";
82923 for (idx_t col_idx = 0; col_idx < result->types.size(); col_idx++) {
82924 if (col_idx > 0) {
82925 extended_error += ", ";
82926 }
82927 extended_error += result->names[col_idx] + " " + result->types[col_idx].ToString();
82928 }
82929 extended_error += "\n\nPossible solutions:";
82930 extended_error += "\n* Manually specify which columns to insert using \"INSERT INTO tbl SELECT ... "
82931 "FROM read_parquet(...)\"";
82932 throw ConversionException(
82933 "Failed to read file(s) \"%s\" - column count mismatch: expected %d columns but found %d\n%s",
82934 file_string, return_types.size(), result->types.size(), extended_error);
82935 }
82936 // expected types - overwrite the types we want to read instead
82937 result->types = return_types;
82938 result->table_columns = names;
82939 }
82941 return std::move(result);
82942 }

◆ MultiFileBind()

template<class OP>
unique_ptr< FunctionData > duckdb::MultiFileFunction< OP >::MultiFileBind ( ClientContext & context,
TableFunctionBindInput & input,
vector< LogicalType > & return_types,
vector< string > & names )
inlinestatic
82945 {
82946 auto interface = OP::CreateInterface(context);
82947 auto multi_file_reader = MultiFileReader::Create(input.table_function);
82948
82949 auto glob_input = multi_file_reader->GetGlobInput(*interface);
82950 auto file_list = multi_file_reader->CreateFileList(context, input.inputs[0], glob_input);
82951
82952 interface->InitializeInterface(context, *multi_file_reader, *file_list);
82953
82955
82956 auto options = interface->InitializeOptions(context, input.info);
82957 for (auto &kv : input.named_parameters) {
82958 auto loption = StringUtil::Lower(kv.first);
82959 if (multi_file_reader->ParseOption(loption, kv.second, file_options, context)) {
82960 continue;
82961 }
82962 if (interface->ParseOption(context, kv.first, kv.second, file_options, *options)) {
82963 continue;
82964 }
82965 throw NotImplementedException("Unimplemented option %s", kv.first);
82966 }
82967 return MultiFileBindInternal(context, std::move(multi_file_reader), std::move(file_list), return_types, names,
82969 }
named_parameter_type_map_t named_parameters
The named parameters of the function.
Definition duckdb.hpp:13938
static DUCKDB_API string Lower(const string &str)
Convert a string to lowercase.
Definition duckdb.cpp:109630
static DUCKDB_API unique_ptr< MultiFileReader > Create(const TableFunction &table_function)
Create a MultiFileReader for a specific TableFunction, using its function name for errors.
Definition duckdb.cpp:84261

◆ MultiFileBindCopy()

template<class OP>
unique_ptr< FunctionData > duckdb::MultiFileFunction< OP >::MultiFileBindCopy ( ClientContext & context,
CopyFromFunctionBindInput & input,
vector< string > & expected_names,
vector< LogicalType > & expected_types )
inlinestatic
82973 {
82974 auto interface = OP::CreateInterface(context);
82976 vector<string> paths = {input.info.file_path};
82977 auto glob_input = multi_file_reader->GetGlobInput(*interface);
82978 auto file_list = multi_file_reader->CreateFileList(context, paths, glob_input);
82979
82980 interface->InitializeInterface(context, *multi_file_reader, *file_list);
82981
82982 auto options = interface->InitializeOptions(context, nullptr);
82984 file_options.auto_detect_hive_partitioning = false;
82985
82986 for (auto &option : input.info.options) {
82987 auto loption = StringUtil::Lower(option.first);
82988 if (interface->ParseCopyOption(context, loption, option.second, *options, expected_names, expected_types)) {
82989 continue;
82990 }
82991 throw NotImplementedException("Unsupported option for COPY FROM: %s", option.first);
82992 }
82993 interface->FinalizeCopyBind(context, *options, expected_names, expected_types);
82994
82995 return MultiFileBindInternal(context, std::move(multi_file_reader), std::move(file_list), expected_types,
82997 }
static DUCKDB_API unique_ptr< MultiFileReader > CreateDefault(const string &function_name="")
Create a default MultiFileReader, function_name is used for errors.
Definition duckdb.cpp:84298

◆ MultiFileFilterPushdown()

template<class OP>
unique_ptr< MultiFileList > duckdb::MultiFileFunction< OP >::MultiFileFilterPushdown ( ClientContext & context,
const MultiFileBindData & data,
const vector< column_t > & column_ids,
optional_ptr< TableFilterSet > filters )
inlinestatic
83001 {
83002 if (!filters) {
83003 return nullptr;
83004 }
83005 auto new_list = data.multi_file_reader->DynamicFilterPushdown(context, *data.file_list, data.file_options,
83006 data.names, data.types, column_ids, *filters);
83007 return new_list;
83008 }

◆ TryGetNextFile()

template<class OP>
bool duckdb::MultiFileFunction< OP >::TryGetNextFile ( MultiFileGlobalState & global_state,
unique_lock< mutex > & parallel_lock )
inlinestatic
83012 {
83013 D_ASSERT(parallel_lock.owns_lock());
83015 if (!global_state.file_list.Scan(global_state.file_list_scan, scanned_file)) {
83016 return false;
83017 }
83018
83019 // Push the file in the reader data, to be opened later
83021
83022 return true;
83023 }

◆ InitializeReader()

template<class OP>
ReaderInitializeType duckdb::MultiFileFunction< OP >::InitializeReader ( MultiFileReaderData & reader_data,
const MultiFileBindData & bind_data,
const vector< ColumnIndex > & global_column_ids,
optional_ptr< TableFilterSet > table_filters,
ClientContext & context,
optional_idx file_idx,
MultiFileGlobalState & global_state )
inlinestatic
83028 {
83029 auto &reader = *reader_data.reader;
83030 // Mark the file in the file list we are scanning here
83031 reader.file_list_idx = file_idx;
83032
83033 // 'reader_bind.schema' could be set explicitly by:
83034 // 1. The MultiFileReader::Bind call
83035 // 2. The 'schema' parquet option
83036 auto &global_columns = bind_data.reader_bind.schema.empty() ? bind_data.columns : bind_data.reader_bind.schema;
83037 return bind_data.multi_file_reader->InitializeReader(reader_data, bind_data, global_columns, global_column_ids,
83039 }

◆ TryOpenNextFile()

template<class OP>
bool duckdb::MultiFileFunction< OP >::TryOpenNextFile ( ClientContext & context,
const MultiFileBindData & bind_data,
MultiFileLocalState & scan_data,
MultiFileGlobalState & global_state,
unique_lock< mutex > & parallel_lock )
inlinestatic

Helper function that try to start opening a next file. Parallel lock should be locked when calling.

File can be skipped entirely, close it and move on

Intentionally do not increase 'i'

83044 {
83045 if (!parallel_lock.owns_lock()) {
83046 throw InternalException("parallel_lock is not held in TryOpenNextFile, this should not happen");
83047 }
83048
83050
83051 idx_t file_index = global_state.file_index;
83052 idx_t i = 0;
83053 while (i < file_lookahead_limit) {
83054 // Try to get new files to open in this loop too otherwise we will only ever open 1 file ahead
83055 const bool has_file_to_read = file_index < global_state.readers.size();
83056 if (!has_file_to_read && !TryGetNextFile(global_state, parallel_lock)) {
83057 return false;
83058 }
83060
83064 // Get pointer to file mutex before unlocking
83065 auto &current_file_lock = *current_reader_data.file_mutex;
83066
83067 // Now we switch which lock we are holding, instead of locking the global state, we grab the lock on
83068 // the file we are opening. This file lock allows threads to wait for a file to be opened.
83069 parallel_lock.unlock();
83071
83072 bool can_skip_file = false;
83073 try {
83074 if (current_reader_data.union_data) {
83075 auto &union_data = *current_reader_data.union_data;
83076 current_reader_data.reader = bind_data.multi_file_reader->CreateReader(
83077 context, *global_state.global_state, union_data, bind_data);
83078 } else {
83079 current_reader_data.reader = bind_data.multi_file_reader->CreateReader(
83080 context, *global_state.global_state, current_reader_data.file_to_be_opened,
83082 }
83083 auto init_result =
83084 InitializeReader(current_reader_data, bind_data, global_state.column_indexes,
83088 can_skip_file = true;
83089 } else {
83090 current_reader_data.reader->PrepareReader(context, *global_state.global_state);
83091 }
83092 } catch (...) {
83093 parallel_lock.lock();
83094 global_state.error_opening_file = true;
83095 throw;
83096 }
83097
83098 // Now re-lock the state and add the reader
83099 parallel_lock.lock();
83100 if (can_skip_file) {
83103 continue;
83104 }
83106 return true;
83107 }
83108 i++;
83109 }
83110
83111 return false;
83112 }
Here is the caller graph for this function:

◆ WaitForFile()

template<class OP>
void duckdb::MultiFileFunction< OP >::WaitForFile ( idx_t file_index,
MultiFileGlobalState & global_state,
unique_lock< mutex > & parallel_lock )
inlinestatic

Wait for a file to become available. Parallel lock should be locked when calling.

83115 {
83116 while (true) {
83117 // Get pointer to file mutex before unlocking
83118 auto &file_mutex = *global_state.readers[file_index]->file_mutex;
83119
83120 // To get the file lock, we first need to release the parallel_lock to prevent deadlocking. Note that this
83121 // requires getting the ref to the file mutex pointer with the lock stil held: readers get be resized
83122 parallel_lock.unlock();
83124 parallel_lock.lock();
83125
83126 // Here we have both locks which means we can stop waiting if:
83127 // - the thread opening the file is done and the file is available
83128 // - the thread opening the file has failed
83129 // - the file was somehow scanned till the end while we were waiting
83130 if (!HasFilesToRead(global_state, parallel_lock) ||
83131 global_state.readers[global_state.file_index]->file_state != MultiFileFileState::OPENING ||
83132 global_state.error_opening_file) {
83133 return;
83134 }
83135 }
83136 }
Here is the caller graph for this function:

◆ InitializeFileScanState()

template<class OP>
void duckdb::MultiFileFunction< OP >::InitializeFileScanState ( ClientContext & context,
MultiFileReaderData & reader_data,
MultiFileLocalState & lstate,
vector< idx_t > & projection_ids )
inlinestatic

Initialize the intermediate chunk to be used by the underlying reader before being finalized

83139 {
83140 lstate.reader_data = reader_data;
83141 auto &reader = *lstate.reader;
83144 auto &local_column_ids = reader.column_ids;
83145 auto &local_columns = lstate.reader->GetColumns();
83146 for (idx_t i = 0; i < local_column_ids.size(); i++) {
83149 auto cast_entry = reader.cast_map.find(local_id);
83150 auto expr_entry = reader.expression_map.find(local_id);
83151 if (cast_entry != reader.cast_map.end()) {
83152 intermediate_chunk_types.push_back(cast_entry->second);
83153 } else if (expr_entry != reader.expression_map.end()) {
83154 intermediate_chunk_types.push_back(expr_entry->second->return_type);
83155 } else {
83156 auto &col = local_columns[local_id];
83157 intermediate_chunk_types.push_back(col.type);
83158 }
83159 }
83160 lstate.scan_chunk.Destroy();
83162
83163 auto &executor = lstate.executor;
83164 executor.ClearExpressions();
83165 if (!projection_ids.empty()) {
83166 for (auto &id : projection_ids) {
83167 executor.AddExpression(*reader_data.expressions[id]);
83168 }
83169 } else {
83170 for (auto &expr : reader_data.expressions) {
83171 executor.AddExpression(*expr);
83172 }
83173 }
83174 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryInitializeNextBatch()

template<class OP>
bool duckdb::MultiFileFunction< OP >::TryInitializeNextBatch ( ClientContext & context,
const MultiFileBindData & bind_data,
MultiFileLocalState & scan_data,
MultiFileGlobalState & gstate )
inlinestatic

If we don't have a file to read, and the MultiFileList has no new file for us - end the scan

Finish processing the file

This file does not need to be opened or closed, the filters have determined that this file can be skipped entirely

83179 {
83181
83182 while (true) {
83183 if (gstate.error_opening_file) {
83184 return false;
83185 }
83186
83188 if (!HasFilesToRead(gstate, parallel_lock) && !TryGetNextFile(gstate, parallel_lock)) {
83189 bind_data.interface->FinishReading(context, *gstate.global_state, *scan_data.local_state);
83190 return false;
83191 }
83192
83193 auto &current_reader_data = *gstate.readers[gstate.file_index];
83195 if (current_reader_data.reader->TryInitializeScan(context, *gstate.global_state,
83196 *scan_data.local_state)) {
83197 scan_data.reader = current_reader_data.reader;
83198 if (!scan_data.reader) {
83199 throw InternalException("MultiFileReader was moved");
83200 }
83201 // The current reader has data left to be scanned
83202 scan_data.batch_index = gstate.batch_index++;
83203 auto old_file_index = scan_data.file_index;
83204 scan_data.file_index = gstate.file_index;
83205 parallel_lock.unlock();
83206 scan_data.reader->PrepareScan(context, *gstate.global_state, *scan_data.local_state);
83207 if (old_file_index != scan_data.file_index) {
83209 }
83210 return true;
83211 } else {
83212 // Set state to the next file
83213 ++gstate.file_index;
83214
83215 // Close current file
83217
83219 current_reader_data.reader->FinishFile(context, *gstate.global_state);
83220 current_reader_data.closed_reader = current_reader_data.reader;
83221 current_reader_data.reader = nullptr;
83222 continue;
83223 }
83224 } else if (current_reader_data.file_state == MultiFileFileState::SKIPPED) {
83227 ++gstate.file_index;
83228 continue;
83229 }
83230
83232 continue;
83233 }
83234
83235 // Check if the current file is being opened, in that case we need to wait for it.
83237 WaitForFile(gstate.file_index, gstate, parallel_lock);
83238 }
83239 }
83240 }
static void InitializeFileScanState(ClientContext &context, MultiFileReaderData &reader_data, MultiFileLocalState &lstate, vector< idx_t > &projection_ids)
Definition duckdb.cpp:83138
static bool TryOpenNextFile(ClientContext &context, const MultiFileBindData &bind_data, MultiFileLocalState &scan_data, MultiFileGlobalState &global_state, unique_lock< mutex > &parallel_lock)
Helper function that try to start opening a next file. Parallel lock should be locked when calling.
Definition duckdb.cpp:83042
static void WaitForFile(idx_t file_index, MultiFileGlobalState &global_state, unique_lock< mutex > &parallel_lock)
Wait for a file to become available. Parallel lock should be locked when calling.
Definition duckdb.cpp:83115
Here is the call graph for this function:

◆ MultiFileInitLocal()

template<class OP>
unique_ptr< LocalTableFunctionState > duckdb::MultiFileFunction< OP >::MultiFileInitLocal ( ExecutionContext & context,
TableFunctionInitInput & input,
GlobalTableFunctionState * gstate_p )
inlinestatic
83243 {
83244 auto &bind_data = input.bind_data->Cast<MultiFileBindData>();
83245 auto &gstate = gstate_p->Cast<MultiFileGlobalState>();
83246
83248 result->is_parallel = true;
83249 result->batch_index = 0;
83250 result->local_state = bind_data.interface->InitializeLocalState(context, *gstate.global_state);
83251
83253 return nullptr;
83254 }
83255 return std::move(result);
83256 }
static bool TryInitializeNextBatch(ClientContext &context, const MultiFileBindData &bind_data, MultiFileLocalState &scan_data, MultiFileGlobalState &gstate)
Definition duckdb.cpp:83178

◆ MultiFileInitGlobal()

template<class OP>
unique_ptr< GlobalTableFunctionState > duckdb::MultiFileFunction< OP >::MultiFileInitGlobal ( ClientContext & context,
TableFunctionInitInput & input )
inlinestatic

File can be skipped entirely, close it and move on

83259 {
83260 auto &bind_data = input.bind_data->CastNoConst<MultiFileBindData>();
83262
83263 // before instantiating a scan trigger a dynamic filter pushdown if possible
83264 auto new_list = MultiFileFilterPushdown(context, bind_data, input.column_ids, input.filters);
83265 if (new_list) {
83267 } else {
83269 }
83270 auto &file_list = result->file_list;
83271 file_list.InitializeScan(result->file_list_scan);
83272
83273 auto &global_columns = bind_data.reader_bind.schema.empty() ? bind_data.columns : bind_data.reader_bind.schema;
83274 result->multi_file_reader_state = bind_data.multi_file_reader->InitializeGlobalState(
83275 context, bind_data.file_options, bind_data.reader_bind, file_list, global_columns, input.column_indexes);
83276
83277 if (file_list.IsEmpty()) {
83278 result->readers = {};
83279 } else if (!bind_data.union_readers.empty()) {
83280 for (auto &reader : bind_data.union_readers) {
83281 result->readers.push_back(make_uniq<MultiFileReaderData>(reader));
83282 }
83283 if (result->readers.size() != file_list.GetTotalFileCount()) {
83284 result->readers = {};
83285 }
83286 } else if (bind_data.initial_reader) {
83287 // we can only use the initial reader if it was constructed from the first file
83288 if (bind_data.initial_reader->GetFileName() == file_list.GetFirstFile().path) {
83289 result->readers.push_back(make_uniq<MultiFileReaderData>(std::move(bind_data.initial_reader)));
83290 }
83291 }
83292
83293 result->file_index = 0;
83294 result->column_indexes = input.column_indexes;
83295 result->filters = input.filters.get();
83296 result->op = input.op;
83297 result->global_state = bind_data.interface->InitializeGlobalState(context, bind_data, *result);
83299
83300 // Ensure all readers are initialized and FileListScan is sync with readers list
83301 for (auto &reader_data : result->readers) {
83303 idx_t file_idx = result->file_list_scan.current_file_idx;
83304 file_list.Scan(result->file_list_scan, file_name);
83305 if (reader_data->union_data) {
83306 if (file_name.path != reader_data->union_data->GetFileName()) {
83307 throw InternalException("Mismatch in filename order and union reader order in multi file scan");
83308 }
83309 } else {
83310 D_ASSERT(reader_data->reader);
83311 if (file_name.path != reader_data->reader->GetFileName()) {
83312 throw InternalException("Mismatch in filename order and reader order in multi file scan");
83313 }
83314 auto init_result = InitializeReader(*reader_data, bind_data, input.column_indexes, input.filters,
83319 result->file_index++;
83320 }
83321 }
83322 }
83323
83324 auto expand_result = bind_data.file_list->GetExpandResult();
83325 auto max_threads = bind_data.interface->MaxThreads(bind_data, *result, expand_result);
83326 if (max_threads.IsValid()) {
83327 result->max_threads = MinValue<idx_t>(result->max_threads, max_threads.GetIndex());
83328 }
83330 result->multi_file_reader_state && result->multi_file_reader_state->RequiresExtraColumns();
83331 if (input.CanRemoveFilterColumns() || require_extra_columns) {
83332 if (!input.projection_ids.empty()) {
83333 result->projection_ids = input.projection_ids;
83334 } else {
83335 result->projection_ids.resize(input.column_indexes.size());
83336 for (idx_t i = 0; i < input.column_indexes.size(); i++) {
83337 result->projection_ids[i] = i;
83338 }
83339 }
83340
83341 const auto table_types = bind_data.types;
83342 for (const auto &col_idx : input.column_indexes) {
83343 auto column_id = col_idx.GetPrimaryIndex();
83344 if (col_idx.IsVirtualColumn()) {
83345 auto entry = bind_data.virtual_columns.find(column_id);
83346 if (entry == bind_data.virtual_columns.end()) {
83347 throw InternalException("MultiFileReader - virtual column definition not found");
83348 }
83349 result->scanned_types.emplace_back(entry->second.type);
83350 } else {
83351 result->scanned_types.push_back(table_types[column_id]);
83352 }
83353 }
83354 }
83356 for (const auto &column_type : result->multi_file_reader_state->extra_columns) {
83357 result->scanned_types.push_back(column_type);
83358 }
83359 }
83360 return std::move(result);
83361 }

◆ MultiFileGetPartitionData()

template<class OP>
OperatorPartitionData duckdb::MultiFileFunction< OP >::MultiFileGetPartitionData ( ClientContext & context,
TableFunctionGetPartitionInput & input )
inlinestatic
83364 {
83365 auto &bind_data = input.bind_data->CastNoConst<MultiFileBindData>();
83366 auto &data = input.local_state->Cast<MultiFileLocalState>();
83367 auto &gstate = input.global_state->Cast<MultiFileGlobalState>();
83369 bind_data.multi_file_reader->GetPartitionData(context, bind_data.reader_bind, *data.reader_data,
83370 gstate.multi_file_reader_state, input.partition_info,
83372 return partition_data;
83373 }

◆ MultiFileScan()

template<class OP>
void duckdb::MultiFileFunction< OP >::MultiFileScan ( ClientContext & context,
TableFunctionInput & data_p,
DataChunk & output )
inlinestatic
83375 {
83376 if (!data_p.local_state) {
83377 data_p.async_result = SourceResultType::FINISHED;
83378 return;
83379 }
83380 auto &data = data_p.local_state->Cast<MultiFileLocalState>();
83381 auto &gstate = data_p.global_state->Cast<MultiFileGlobalState>();
83382 auto &bind_data = data_p.bind_data->CastNoConst<MultiFileBindData>();
83383
83384 if (gstate.finished) {
83385 data_p.async_result = SourceResultType::FINISHED;
83386 return;
83387 }
83388
83389 do {
83390 auto &scan_chunk = data.scan_chunk;
83391 scan_chunk.Reset();
83392
83393 auto res = data.reader->Scan(context, *gstate.global_state, *data.local_state, scan_chunk);
83394
83395 if (res.GetResultType() == AsyncResultType::BLOCKED) {
83396 if (scan_chunk.size() != 0) {
83397 throw InternalException("Unexpected behaviour from Scan, no rows should be returned");
83398 }
83399 switch (data_p.results_execution_mode) {
83401 data_p.async_result = std::move(res);
83402 return;
83404 res.ExecuteTasksSynchronously();
83405 if (res.GetResultType() != AsyncResultType::HAVE_MORE_OUTPUT) {
83406 throw InternalException("Unexpected behaviour from ExecuteTasksSynchronously");
83407 }
83408 // scan_chunk.size() is 0, see check above, and result is HAVE_MORE_OUTPUT, we need to loop again
83409 continue;
83410 }
83411 }
83412
83413 output.SetCardinality(scan_chunk.size());
83414
83415 if (scan_chunk.size() > 0) {
83416 bind_data.multi_file_reader->FinalizeChunk(context, bind_data, *data.reader, *data.reader_data,
83417 scan_chunk, output, data.executor,
83418 gstate.multi_file_reader_state);
83419 }
83420 if (res.GetResultType() == AsyncResultType::HAVE_MORE_OUTPUT) {
83421 // Loop back to the same block
83422 if (output.size() == 0 && data_p.results_execution_mode == AsyncResultsExecutionMode::SYNCHRONOUS) {
83423 continue;
83424 }
83426 return;
83427 }
83428
83429 if (res.GetResultType() != AsyncResultType::FINISHED) {
83430 throw InternalException("Unexpected result in MultiFileScan, must be FINISHED, is %s",
83431 EnumUtil::ToChars(res.GetResultType()));
83432 }
83433
83435 if (output.size() > 0 && data_p.results_execution_mode == AsyncResultsExecutionMode::SYNCHRONOUS) {
83436 gstate.finished = true;
83438 } else {
83439 data_p.async_result = SourceResultType::FINISHED;
83440 }
83441 } else {
83442 if (output.size() == 0 && data_p.results_execution_mode == AsyncResultsExecutionMode::SYNCHRONOUS) {
83443 continue;
83444 }
83446 }
83447 return;
83448 } while (true);
83449 }

◆ MultiFileScanStats()

template<class OP>
unique_ptr< BaseStatistics > duckdb::MultiFileFunction< OP >::MultiFileScanStats ( ClientContext & context,
const FunctionData * bind_data_p,
column_t column_index )
inlinestatic
83452 {
83453 auto &bind_data = bind_data_p->Cast<MultiFileBindData>();
83454
83455 if (!bind_data.initial_reader) {
83456 // no reader
83457 return nullptr;
83458 }
83459 // scanning single file and we have the metadata read already
83461 return nullptr;
83462 }
83463
83464 const auto &col_name = bind_data.names[column_index];
83465
83466 // NOTE: we do not want to parse the file metadata for the sole purpose of getting column statistics
83467 if (bind_data.file_list->GetExpandResult() == FileExpandResult::MULTIPLE_FILES) {
83468 if (!bind_data.file_options.union_by_name) {
83469 // multiple files, but no union_by_name: no luck!
83470 return nullptr;
83471 }
83472
83473 auto merged_stats = bind_data.initial_reader->GetStatistics(context, col_name);
83474 if (!merged_stats) {
83475 return nullptr;
83476 }
83477
83478 for (idx_t i = 1; i < bind_data.union_readers.size(); i++) {
83479 auto &union_reader = *bind_data.union_readers[i];
83480 auto stats = union_reader.GetStatistics(context, col_name);
83481 if (!stats || merged_stats->GetType() != stats->GetType()) {
83482 return nullptr;
83483 }
83484 merged_stats->Merge(*stats);
83485 }
83486 return merged_stats;
83487 }
83488 return bind_data.initial_reader->GetStatistics(context, col_name);
83489 }

◆ MultiFileProgress()

template<class OP>
double duckdb::MultiFileFunction< OP >::MultiFileProgress ( ClientContext & context,
const FunctionData * bind_data_p,
const GlobalTableFunctionState * global_state )
inlinestatic
83492 {
83493 auto &gstate = global_state->Cast<MultiFileGlobalState>();
83494
83495 // get the file count - for >100 files we allow a lower bound to be given instead
83496 auto count_info = gstate.file_list.GetFileCount(100);
83498 // the entire glob has not yet been expanded - we don't know how many files there are exactly
83499 // we try to postpone expanding the glob by only expanding it once we have scanned 1% of the files
83500 // check if we have reached AT LEAST 1% of progress
83501 idx_t one_percent_min = count_info.count / 100;
83502 if (gstate.completed_file_index < one_percent_min) {
83503 // we have not - just report 0%
83504 return 0.0;
83505 }
83506 // we have reached 1% given the currently known (incomplete) list of files
83507 // retrieve more files to scan
83508 count_info = gstate.file_list.GetFileCount(count_info.count + 1);
83509 }
83510 auto total_count = count_info.count;
83511 if (total_count == 0) {
83512 return 100.0;
83513 }
83515 double total_progress = 100.0 * static_cast<double>(gstate.completed_file_index);
83516 // iterate over the files we haven't completed yet
83517 for (idx_t i = gstate.completed_file_index; i <= gstate.file_index && i < gstate.readers.size(); i++) {
83518 auto &reader_data_ptr = gstate.readers[i];
83519 if (!reader_data_ptr) {
83520 continue;
83521 }
83523 // Initialize progress_in_file with a default value to avoid uninitialized variable usage
83524 double progress_in_file = 0.0;
83525 if (reader_data.file_state == MultiFileFileState::OPEN) {
83526 // file is currently open - get the progress within the file
83527 progress_in_file = reader_data.reader->GetProgressInFile(context);
83528 } else if (reader_data.file_state == MultiFileFileState::CLOSED) {
83529 // file has been closed - check if the reader is still in use
83530 auto reader = reader_data.closed_reader.lock();
83531 if (!reader) {
83532 // reader has been destroyed - we are done with this file
83533 progress_in_file = 100.0;
83534 } else {
83535 // file is still being read
83536 progress_in_file = reader->GetProgressInFile(context);
83537 }
83538 }
83541 if (i == gstate.completed_file_index && progress_in_file >= 100) {
83542 // if the progress in this file is 100, we have completed the file
83543 // we don't need to check anymore in the next iteration
83544 gstate.completed_file_index++;
83545 }
83546 }
83547 return total_progress / static_cast<double>(total_count);
83548 }

◆ MultiFileCardinality()

template<class OP>
unique_ptr< NodeStatistics > duckdb::MultiFileFunction< OP >::MultiFileCardinality ( ClientContext & context,
const FunctionData * bind_data )
inlinestatic
83550 {
83551 auto &data = bind_data->Cast<MultiFileBindData>();
83552 auto file_list_cardinality_estimate = data.file_list->GetCardinality(context);
83555 }
83556 if (data.file_options.union_by_name) {
83557 // for UNION BY NAME - check if we can get a cardinality estimate from the (already opened) union readers
83558 bool has_exact_cardinality = true;
83559 idx_t cardinality = 0;
83560 for (auto &union_data : data.union_readers) {
83561 auto file_cardinality = union_data->TryGetCardinalityEstimate();
83562 if (!file_cardinality.IsValid()) {
83563 has_exact_cardinality = false;
83564 break;
83565 }
83566 cardinality += file_cardinality.GetIndex();
83567 }
83570 }
83571 }
83572 // get the file count - for >500 files we allow an estimate
83573 auto count_info = data.file_list->GetFileCount(500);
83576 // not all files have been expanded - it's probably twice as many files
83578 }
83579 return data.interface->GetCardinality(context, data, estimated_file_count);
83580 }

◆ MultiFileComplexFilterPushdown()

template<class OP>
void duckdb::MultiFileFunction< OP >::MultiFileComplexFilterPushdown ( ClientContext & context,
LogicalGet & get,
FunctionData * bind_data_p,
vector< unique_ptr< Expression > > & filters )
inlinestatic
83583 {
83584 auto &data = bind_data_p->Cast<MultiFileBindData>();
83585
83587 auto new_list =
83588 data.multi_file_reader->ComplexFilterPushdown(context, *data.file_list, data.file_options, info, filters);
83589
83590 if (new_list) {
83591 data.file_list = std::move(new_list);
83593 }
83594 }

◆ MultiFileGetBindInfo()

template<class OP>
BindInfo duckdb::MultiFileFunction< OP >::MultiFileGetBindInfo ( const optional_ptr< FunctionData > bind_data_p)
inlinestatic
83596 {
83598 auto &bind_data = bind_data_p->Cast<MultiFileBindData>();
83599
83601 for (const auto &file : bind_data.file_list->GetDisplayFileList()) {
83602 file_path.emplace_back(file.path);
83603 }
83604
83605 // LCOV_EXCL_START
83606 bind_info.InsertOption("file_path", Value::LIST(LogicalType::VARCHAR, file_path));
83607 bind_data.interface->GetBindInfo(*bind_data.bind_data, bind_info);
83608 bind_data.file_options.AddBatchInfo(bind_info);
83609 // LCOV_EXCL_STOP
83610 return bind_info;
83611 }
static DUCKDB_API Value LIST(const LogicalType &child_type, vector< Value > values)
Create a list value with the given entries.
Definition duckdb.cpp:132555

◆ MultiFileGetPartitionInfo()

template<class OP>
TablePartitionInfo duckdb::MultiFileFunction< OP >::MultiFileGetPartitionInfo ( ClientContext & context,
TableFunctionPartitionInput & input )
inlinestatic
83613 {
83614 auto &bind_data = input.bind_data->Cast<MultiFileBindData>();
83615 return bind_data.multi_file_reader->GetPartitionInfo(context, bind_data.reader_bind, input);
83616 }

◆ MultiFileGetVirtualColumns()

template<class OP>
virtual_column_map_t duckdb::MultiFileFunction< OP >::MultiFileGetVirtualColumns ( ClientContext & context,
optional_ptr< FunctionData > bind_data_p )
inlinestatic
83619 {
83620 auto &bind_data = bind_data_p->Cast<MultiFileBindData>();
83623
83624 bind_data.interface->GetVirtualColumns(context, bind_data, result);
83625
83626 bind_data.virtual_columns = result;
83627 return result;
83628 }

◆ MultiFileDynamicToString()

template<class OP>
InsertionOrderPreservingMap< string > duckdb::MultiFileFunction< OP >::MultiFileDynamicToString ( TableFunctionDynamicToStringInput & input)
inlinestatic
83630 {
83631 auto &gstate = input.global_state->Cast<MultiFileGlobalState>();
83633 auto files_loaded = gstate.file_index.load();
83634 result.insert(make_pair("Total Files Read", std::to_string(files_loaded)));
83635
83636 constexpr size_t FILE_NAME_LIST_LIMIT = 5;
83637 auto file_paths = gstate.file_list.GetDisplayFileList(FILE_NAME_LIST_LIMIT + 1);
83638 if (!file_paths.empty()) {
83641 file_path_names.push_back(file_paths[i].path);
83642 }
83644 file_path_names.push_back("...");
83645 }
83647 result.insert(make_pair("Filename(s)", list_of_types));
83648 }
83649 return result;
83650 }
static DUCKDB_API string Join(const vector< string > &input, const string &separator)
Join multiple strings into one string. Components are concatenated by the given separator.
Definition duckdb.cpp:109497

◆ PushdownType()

template<class OP>
void duckdb::MultiFileFunction< OP >::PushdownType ( ClientContext & context,
optional_ptr< FunctionData > bind_data_p,
const unordered_map< idx_t, LogicalType > & new_column_types )
inlinestatic
83653 {
83654 auto &bind_data = bind_data_p->Cast<MultiFileBindData>();
83655 for (auto &type : new_column_types) {
83656 bind_data.types[type.first] = type.second;
83657 bind_data.columns[type.first].type = type.second;
83658 }
83659 }

◆ HasFilesToRead()

template<class OP>
bool duckdb::MultiFileFunction< OP >::HasFilesToRead ( MultiFileGlobalState & gstate,
unique_lock< mutex > & parallel_lock )
inlinestaticprivate
83662 {
83663 D_ASSERT(parallel_lock.owns_lock());
83664 return (gstate.file_index.load() < gstate.readers.size());
83665 }

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