Struct arrow_json::reader::ReaderBuilder
source · pub struct ReaderBuilder { /* private fields */ }Expand description
JSON file reader builder
Implementations§
source§impl 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
fn example() -> arrow_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 = arrow_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§
source§impl Debug for ReaderBuilder
impl Debug for ReaderBuilder
source§impl Default for ReaderBuilder
impl Default for ReaderBuilder
source§fn default() -> ReaderBuilder
fn default() -> ReaderBuilder
Returns the “default value” for a type. Read more