Reads a JSON file in one of the formats supported by the bundled JSON plugin and returns its records as a DataFrame. The plugin owns the input format details; this function does not take a schema or parsing options.
json::write
json::write(df: DataFrame, path: String) -> Int
Writes the DataFrame to the given path and returns the number of rows written.
Example
Read, transform, and write
After reading, JSON data is an ordinary table and can be filtered or projected before writing.
import"json";
let events = json::read("data/events.json");
let recent = events[filter active, select { id, category, timestamp }];
let rows_written = json::write(recent, "out/active-events.json");
For CSV and Parquet alternatives, see their CSV and Parquet references.