Struct polars::prelude::ReaderBuilder [−]
pub struct ReaderBuilder { /* fields omitted */ }
Expand description
JSON file reader builder
Implementations
impl ReaderBuilder
impl ReaderBuilder
pub fn new() -> ReaderBuilder
pub fn new() -> ReaderBuilder
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 }
pub fn with_schema(self, schema: Arc<Schema>) -> ReaderBuilder
pub fn with_schema(self, schema: Arc<Schema>) -> ReaderBuilder
Set the JSON file’s schema
pub fn infer_schema(self, max_records: Option<usize>) -> ReaderBuilder
pub fn infer_schema(self, max_records: Option<usize>) -> ReaderBuilder
Set the JSON reader to infer the schema of the file
pub fn with_batch_size(self, batch_size: usize) -> ReaderBuilder
pub fn with_batch_size(self, batch_size: usize) -> ReaderBuilder
Set the batch size (number of records to load at one time)
pub fn with_projection(self, projection: Vec<String, Global>) -> ReaderBuilder
pub fn with_projection(self, projection: Vec<String, Global>) -> ReaderBuilder
Set the reader’s column projection
Trait Implementations
impl Debug for ReaderBuilder
impl Debug for ReaderBuilder
impl Default for ReaderBuilder
impl Default for ReaderBuilder
pub fn default() -> ReaderBuilder
pub 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