-
Notifications
You must be signed in to change notification settings - Fork 22
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
Further discussion of schema-based parsing. #47
Comments
The current version can handle it: GithubEvent[] events = parser.parse(json, json.length, GithubEvent[].class); However, we can try adding support for lists at the root. The reason I haven't done this yet is that, in Java, it's a bit challenging to pass information about a generic type parameter. We cannot do something like: List<GithubEvent> events = parser.parse(json, json.length, List<GithubEvent>.class); We can consider introducing an API like this: List<GithubEvent> events = parser.parseList(json, json.length, GithubEvent.class);
I'm open to that. However, the power of schema-based parsing is that we can skip parsing fields that are not included in the schema. For a Please let me know what you think about it. Also, would you mind sharing if you use or consider using simdjson-java in any project? That would be very valuable information, especially if you could describe your use case (how much data you process, what your expectations are regarding performance, etc.). |
Thx. I get your point. I'm talking about Before schema-based parsing, I use Therefore, I believe the schema-based parsing to |
Good to know that the schema-based parsing were implemented!
I have two more questions:
In current version, we need to explicitly tell the parser the class:
In Jackson, we can use readValue to parse json into Map (or List), in that case, we don't need to define lots of "record" if the class is complicated.
In one word, something like
Object twitter = simdJsonParser.parse(buffer, buffer.length, Map.class);
The text was updated successfully, but these errors were encountered: