Skip to content

Support ndjson#2873

Merged
texodus merged 1 commit intomasterfrom
ndjson
Dec 9, 2024
Merged

Support ndjson#2873
texodus merged 1 commit intomasterfrom
ndjson

Conversation

@texodus
Copy link
Member

@texodus texodus commented Dec 9, 2024

  • Adds NDJSON support to the perspective.table() constructor, via the format option.
  • Adds view.to_ndjson() serialization method.
const table = await perspective.table(`{"x": 1}\n{"x": 2}`, {format: "ndjson"});
const view = await table.view();
const ndjson = await view.to_ndjson();

@texodus texodus added the enhancement Feature requests or improvements label Dec 9, 2024
@timkpaine
Copy link
Member

timkpaine commented Dec 9, 2024

just noting that, annoyingly, ndjson and jsonl are both widely used names for the same thing, as it has not been standardized. I support using ndjson as the api as this is what polars does, but might want to link both in the docs.

Also the old ldjson 😮‍💨 https://en.wikipedia.org/wiki/JSON_streaming#LDJSON, arrow doesnt link to any but it does use this language.

@texodus texodus force-pushed the ndjson branch 3 times, most recently from 872f082 to afb0d2b Compare December 9, 2024 04:45
Signed-off-by: Andrew Stein <steinlink@gmail.com>
@texodus texodus merged commit 20a169d into master Dec 9, 2024
@texodus texodus deleted the ndjson branch December 9, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Feature requests or improvements

Development

Successfully merging this pull request may close these issues.

2 participants