Skip to content

Parsing newline delimited JSON using streaming API? #246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jschaf opened this issue Jul 2, 2019 · 1 comment
Closed

Parsing newline delimited JSON using streaming API? #246

jschaf opened this issue Jul 2, 2019 · 1 comment

Comments

@jschaf
Copy link

jschaf commented Jul 2, 2019

Is there a way to parse an large input stream consisting of newline delimited JSON objects?

Here's an example file:

{"name": "alice", "age": 27, "extra": "foo"}
{"name": "bob", "age": 23, "red": "1"}
{"name": "charlie", "green": "2"}

Using JsonIterator.parse(inputStream, bufSize).read() works but it returns the entire map of each object. I'd like to iterate over each property in the objects.

@jschaf
Copy link
Author

jschaf commented Jul 16, 2019

I used Jackson instead. I ran into a couple bugs with large inputs using the Any API.

@jschaf jschaf closed this as completed Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant