MCPcopy Create free account
hub / github.com/apache/arrow-rs / schema

Method schema

arrow-csv/src/reader/mod.rs:514–523  ·  view source on GitHub ↗

Returns the schema of the reader, useful for getting the schema without reading record batches

(&self)

Source from the content-addressed store, hash-verified

512 /// Returns the schema of the reader, useful for getting the schema without reading
513 /// record batches
514 pub fn schema(&self) -> SchemaRef {
515 match &self.decoder.projection {
516 Some(projection) => {
517 let fields = self.decoder.schema.fields();
518 let projected = projection.iter().map(|i| fields[*i].clone());
519 Arc::new(Schema::new(projected.collect::<Fields>()))
520 }
521 None => self.decoder.schema.clone(),
522 }
523 }
524}
525
526impl<R: BufRead> BufReader<R> {

Callers 5

create_tableFunction · 0.45
writeMethod · 0.45

Calls 3

fieldsMethod · 0.45
iterMethod · 0.45
cloneMethod · 0.45