Expand description
JSON Reader
This JSON reader allows JSON line-delimited files to be read into the Arrow memory model. Records are loaded in batches and are then converted from row-based data to columnar data.
Example:
use arrow::datatypes::{DataType, Field, Schema};
use arrow::json;
use std::fs::File;
use std::io::BufReader;
use std::sync::Arc;
let schema = Schema::new(vec![
Field::new("a", DataType::Float64, false),
Field::new("b", DataType::Float64, false),
Field::new("c", DataType::Float64, true),
]);
let file = File::open("test/data/basic.json").unwrap();
let mut json = json::Reader::new(
BufReader::new(file),
Arc::new(schema),
json::reader::DecoderOptions::new(),
);
let batch = json.next().unwrap().unwrap();
Structs
JSON values to Arrow record batch decoder.
Options for JSON decoding
JSON file reader
JSON file reader builder
JSON file reader that produces a serde_json::Value iterator from a Read trait
Functions
Infer the fields of a JSON file by reading the first n records of the buffer, with
max_read_records
controlling the maximum number of records to read.Infer the fields of a JSON file by reading all items from the JSON Value Iterator.
Infer the fields of a JSON file by reading the first n records of the file, with
max_read_records
controlling the maximum number of records to read.