pub struct ReaderBuilder { /* private fields */ }
Expand description
JSON file reader builder
Implementations
sourceimpl ReaderBuilder
impl ReaderBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new builder for configuring JSON parsing options.
To convert a builder into a reader, call Reader::from_builder
Example
extern crate arrow;
use arrow::json;
use std::fs::File;
fn example() -> json::Reader<File> {
let file = File::open("test/data/basic.json").unwrap();
// create a builder, inferring the schema with the first 100 records
let builder = json::ReaderBuilder::new().infer_schema(Some(100));
let reader = builder.build::<File>(file).unwrap();
reader
}
sourcepub fn with_schema(self, schema: SchemaRef) -> Self
pub fn with_schema(self, schema: SchemaRef) -> Self
Set the JSON file’s schema
sourcepub fn infer_schema(self, max_records: Option<usize>) -> Self
pub fn infer_schema(self, max_records: Option<usize>) -> Self
Set the JSON reader to infer the schema of the file
sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
Set the batch size (number of records to load at one time)
sourcepub fn with_projection(self, projection: Vec<String>) -> Self
pub fn with_projection(self, projection: Vec<String>) -> Self
Set the reader’s column projection
sourcepub fn with_format_strings(self, format_strings: HashMap<String, String>) -> Self
pub fn with_format_strings(self, format_strings: HashMap<String, String>) -> Self
Set the decoder’s format Strings param
Trait Implementations
sourceimpl Debug for ReaderBuilder
impl Debug for ReaderBuilder
sourceimpl Default for ReaderBuilder
impl Default for ReaderBuilder
sourcefn default() -> ReaderBuilder
fn default() -> ReaderBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ReaderBuilder
impl Send for ReaderBuilder
impl Sync for ReaderBuilder
impl Unpin for ReaderBuilder
impl UnwindSafe for ReaderBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more