-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Good to know that the schema-based parsing were implemented!
I have two more questions:
- As line 54 in src/main/java/org/simdjson/SchemaBasedJsonIterator.java says: "Lists at the root are not supported. Consider using an array instead.". So current version cannot handle the case? For example, github_events.json.
- Can the schema-based parsing be more powerful?
In current version, we need to explicitly tell the parser the class:
SimdJsonTwitter twitter = simdJsonParser.parse(buffer, buffer.length, SimdJsonTwitter.class);
record SimdJsonUser(boolean default_profile, String screen_name) {
}
record SimdJsonStatus(SimdJsonUser user) {
}
record SimdJsonTwitter(List<SimdJsonStatus> statuses) {
}
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);
Metadata
Metadata
Assignees
Labels
No labels