-
Notifications
You must be signed in to change notification settings - Fork 14
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
FlatBuffers.jl is writing unreadable flatbuffers #51
Comments
Alright, well I'm pretty sure I've figured out what the hell is happening, but I still have no idea why. When a vector field (in particular
However, the table written by the C++ arrow implementation (which gets read to exactly the same object by FlatBuffers.jl is
I'm still holding out a little hope that this is just a matter of dumb me having defined the schema wrong... but so far I still can't find how that can be. |
Ok, another update (as much for my own clarification as public record keeping), I'm now pretty sure that what's happening is that sometimes FlatBuffers.jl neglects to put entries in the vtable for empty vectors. I honestly can't even tell if this is permitted in the "standard" because the flatbuffers documentation is so poor, but this doesn't seem to pose any problems for FlatBuffers.jl, but sometimes other flatbuffers readers seem to be unable to deal with this (although in all the cases, errors seem to be explicitly thrown, so I'm not sure if it's a real incompatibility or a check). I still don't understand under what circumstances FlatBuffers.jl does this. It seems it can only happen in cases where the vector is empty (else it would clearly be an error), but sometimes I see it write them in the vtable, sometimes not. I believe what's happening here is a bug (or oversight) in this block, but I'm still digging through it trying to figure out where the vectors get written (or fail to get written). |
Ok, I have a lot more detail on what's happening, but still don't know what's causing it. The issue is definitely that defaults for For example, if you have a @with_kw struct A
v::Union{Vector{A}, Nothing} = nothing
end create an instance with empty (but non- |
Catching up on this after a long delay.
I think this is the root of the problem, and not necessarily some bug in FlatBuffers.jl, though in a way it IS the problem because it's not requiring you to use a verified The problem here is that you're saying this field will be either a Now, none of that necessarily explains the low-level issues you've been investigating, but in short, I would guess that FlatBuffers.jl is serializing it as a Union type which is confusing other languages. But when another language serializes it as "NULL", Julia is being clever and decoding it as |
Alright, no clue what's happening here:
I'm trying to write
which I've written in Julia as
specifically, I'm writing
Note that both
dictionary
andcustom_metadata
are empty, so the definitions of these shouldn't matter.Note that I've just read this in form a C++ source that presumably wrote it correctly. When I write it back however, I get something different than what I originally read.
What FlatBuffers.jl wrote was
The original data was
FlatBuffers.jl was apparently able to read the original data correctly.
Note that I wrote
wtf
usingFlatBuffers.bytes(Flatbuffers.build!(obj))
.I'm going to start digging into the format to see if I can figure out what in the world is going on here. Anyone have any ideas?
The text was updated successfully, but these errors were encountered: