MCPcopy Create free account
hub / github.com/apache/datafusion / builder

Method builder

datafusion/datasource-csv/src/source.rs:187–210  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

185 }
186
187 fn builder(&self) -> csv::ReaderBuilder {
188 let mut builder =
189 csv::ReaderBuilder::new(Arc::clone(self.table_schema.file_schema()))
190 .with_delimiter(self.delimiter())
191 .with_batch_size(
192 self.batch_size
193 .expect("Batch size must be set before initializing builder"),
194 )
195 .with_header(self.has_header())
196 .with_quote(self.quote())
197 .with_truncated_rows(self.truncate_rows());
198 if let Some(terminator) = self.terminator() {
199 builder = builder.with_terminator(terminator);
200 }
201 builder = builder.with_projection(self.projection.file_indices.clone());
202 if let Some(escape) = self.escape() {
203 builder = builder.with_escape(escape)
204 }
205 if let Some(comment) = self.comment() {
206 builder = builder.with_comment(comment);
207 }
208
209 builder
210 }
211}
212
213/// A [`FileOpener`] that opens a CSV file and yields a [`FileOpenFuture`]

Callers 1

openMethod · 0.45

Calls 15

newFunction · 0.85
truncate_rowsMethod · 0.80
with_truncated_rowsMethod · 0.45
with_quoteMethod · 0.45
with_headerMethod · 0.45
with_batch_sizeMethod · 0.45
with_delimiterMethod · 0.45
file_schemaMethod · 0.45
delimiterMethod · 0.45
has_headerMethod · 0.45
quoteMethod · 0.45
terminatorMethod · 0.45

Tested by

no test coverage detected