Skip to main content

parse_json

Function parse_json 

Source
pub fn parse_json(
    json_strings: Box<dyn EngineData>,
    schema: SchemaRef,
) -> DeltaResult<Box<dyn EngineData>>
Available on crate feature arrow-expression and crate feature internal-api and (crate features arrow-conversion or declarative-plans or default-engine-base) only.
Expand description

Parse a column of JSON strings into a typed RecordBatch matching schema. N input rows produce N output rows.

Arrow lacks the functionality to json-parse a string column into a struct column, so we implement it here.

Failure-prone primitive leaves (Timestamp, TimestampNtz, Date, Decimal) produce per-cell NULL when the typed decoder rejects a value (extended-year timestamps, decimals that overflow the declared precision, etc.). Other leaf type mismatches still surface as batch-level errors.