Replies: 1 comment
-
calling simdjson::ondemand::object::reset() appears to fix my problem... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I could process the fields serially, I would but it is not possible... I need to access the field "event" to know what type of message I am dealing with before dispatching the message to the right function to perform the right processing on it.
It would have been great if "event" would have been the first field but it is not. The fields are sorted alphabetically. The format design did not consider SAX or OnDemand parsing.
My first attemp has been to
call first_field("event")
next time where I access the simdjson object is with
An exception is thrown:
what(): TAPE_ERROR: The JSON document has an improper structure: missing or superfluous commas, braces, missing keys, etc.
The doc says: "You are expected to access keys only once". I am not sure if this is what has bitten me. I suspect that this is it. but I am not sure exactly how the library is expecting the use to deal with the situation that I have at hands. That is, beside the event fields, all the other fields can be accessed serially...
I have seen the function object::reset() which I am going to try right after calling first_field("event"). It should fix my issue...
but if there are better ways to use simdjson, I am all ears...
Beta Was this translation helpful? Give feedback.
All reactions