Skip to content

perf(read): stream large JSON array inputs or document an enforceable limit #1461

Open

Description

@malon64

Finding

src/floe/read/json.py documents that json_mode=array parses the entire file as one in-memory document. JSON object/array materialization may consume many times the input size. The existing NDJSON path is a distinct behavior and should not be regressed.

Scope

  • Benchmark current json_mode=array RSS on generated 50 MiB, 500 MiB and >1 GiB sources with mixed valid/rejected rows.
  • Design the smallest incremental streaming JSON array parser preserving the current order, raw numeric token handling (exact decimals), nested schema.columns[].source extraction, null semantics and row-index identity. Prefer existing dependencies/stdlib; request approval for any new dependency.
  • If a correct incremental parser cannot be implemented safely in a focused PR, first implement a clear preflight size safety limit with maintainer approval on this issue and guide users to NDJSON.
  • Add fixture/golden tests for multi-chunk, nested arrays/objects, Unicode, escaped quotes, malformed trailing JSON and exact-decimal values.

Acceptance

  • Streaming or explicit bounded-file policy, backed by measured peak RSS and verified user-facing errors.
  • No silent mutation of Floe 1.0 JSON input semantics or rounding of decimals.
  • Existing JSON array + NDJSON conformance passes.
  • Large input cannot unexpectedly exhaust memory without an explicit documented limitation.

Out of scope

No freeform JSON transformation, schema changes or new config knobs unless approved.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions