Skip to content

JSONL support #1439

@jmortlock

Description

@jmortlock

Hi

I'm new to your library and experimenting with a current requirement I have to to generate data a JSONL (https://jsonlines.org/) formatted file for Bulk Import into a third party system.

I.E. i need to generate something like this

{ "id": 1 }
{ "id": 2 }

I've started with an initial approach like this

        $output = data_frame()->read(
            DbalQueryExtractor::single($this->connection, $sql)
        )
            ->write(
                to_json("./output.jsonl")
                    ->withRowsInNewLines(true)
            )->saveMode(SaveMode::Overwrite)
            ->run();

However this is generating something like

[
{ "id": 1 },
{ "id": 2 }
]

I'm thinking I would need to implement my own JsonLoader equivalent to do this? Or is there a simpler way i'm missing?

(Also would be nice if you released the latest code, i hit a bug in the JSON normalizer when dealing with XMLEntry which has been fixed in the unreleased code base)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions