MCPcopy Create free account
hub / github.com/apache/arrow / FileSystemFactoryOptions

Class FileSystemFactoryOptions

cpp/src/arrow/dataset/discovery.h:150–199  ·  view source on GitHub ↗

\ingroup dataset-filesystem

Source from the content-addressed store, hash-verified

148
149/// \ingroup dataset-filesystem
150struct FileSystemFactoryOptions {
151 /// Either an explicit Partitioning or a PartitioningFactory to discover one.
152 ///
153 /// If a factory is provided, it will be used to infer a schema for partition fields
154 /// based on file and directory paths then construct a Partitioning. The default
155 /// is a Partitioning which will yield no partition information.
156 ///
157 /// The (explicit or discovered) partitioning will be applied to discovered files
158 /// and the resulting partition information embedded in the Dataset.
159 PartitioningOrFactory partitioning{Partitioning::Default()};
160
161 /// For the purposes of applying the partitioning, paths will be stripped
162 /// of the partition_base_dir. Files not matching the partition_base_dir
163 /// prefix will be skipped for partition discovery. The ignored files will still
164 /// be part of the Dataset, but will not have partition information.
165 ///
166 /// Example:
167 /// partition_base_dir = "/dataset";
168 ///
169 /// - "/dataset/US/sales.csv" -> "US/sales.csv" will be given to the partitioning
170 ///
171 /// - "/home/john/late_sales.csv" -> Will be ignored for partition discovery.
172 ///
173 /// This is useful for partitioning which parses directory when ordering
174 /// is important, e.g. DirectoryPartitioning.
175 std::string partition_base_dir;
176
177 /// Invalid files (via selector or explicitly) will be excluded by checking
178 /// with the FileFormat::IsSupported method. This will incur IO for each files
179 /// in a serial and single threaded fashion. Disabling this feature will skip the
180 /// IO, but unsupported files may be present in the Dataset
181 /// (resulting in an error at scan time).
182 bool exclude_invalid_files = false;
183
184 /// When discovering from a Selector (and not from an explicit file list), ignore
185 /// files and directories matching any of these prefixes.
186 ///
187 /// Example (with selector = "/dataset/**"):
188 /// selector_ignore_prefixes = {"_", ".DS_STORE" };
189 ///
190 /// - "/dataset/data.csv" -> not ignored
191 /// - "/dataset/_metadata" -> ignored
192 /// - "/dataset/.DS_STORE" -> ignored
193 /// - "/dataset/_hidden/dat" -> ignored
194 /// - "/dataset/nested/.DS_STORE" -> ignored
195 std::vector<std::string> selector_ignore_prefixes = {
196 ".",
197 "_",
198 };
199};
200
201/// \brief FileSystemDatasetFactory creates a Dataset from a vector of
202/// fs::FileInfo or a fs::FileSelector.

Callers 1

_filesystem_datasetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected