-
Notifications
You must be signed in to change notification settings - Fork 1k
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
INT64 uses "C long" type in struct.pack which is 4 bytes. #2345
Comments
Hi @varsenyantitan, thanks for raising this issue. We're aware of it already, but let's keep this issue open until it's resolved. I think we'll likely need to introduce a new materialization version and support both the old and new modes simultaneously. |
Hi @woop. Thank you for a fast response. |
There are no drawbacks. We simply need to fix this bug. This issue is not present in Tecton. |
Hi @woop, I'm unable to see why we'll need a new materialization version, do you have examples? I have made this change on a forked repo (and I'm happy to open a PR). Added a new test, while all other tests seem to pass normally. Tested in our current use case for Feast, with both local sqlite and elasticache redis online stores. In my mind, this change should not break current materialization use cases. |
There's more context on #1908 Basically, the backwards compatibility issue comes in because entity keys with join keys of type int64 values that have been already written will no longer be readable - since the serialized bytes will be different with this patch, from before. So, when users upgrade, they will see missing values for entities that they previously would have been able to read values for. We could just require users to rematerialize, but it seems problematic to do so and I would prefer if we can come up with a backwards compatible way of doing it. I haven't given enough thought to it, but we could add a new field in the Does that make sense? |
That makes total sense, thank you for this! I'll move my PR back to draft and try to work on this backward compatibility issue. |
Thanks @roelschr! Please let me know if we can help in this change in any way. |
We ran into the same issue and we had patched on our fork too in the same way. But that's not the only issue - the java server doesn't work with our patch because of this EntityKeySerializerV2.java#L82-L85 Is it really necessary to add backward compatibility for this? |
Expected Behavior
INT64 should be packed as "C long long" to have 64 bits memory capacity.
Current Behavior
INT64 is packed as "C long" which is 32 bits
Steps to reproduce
Materialization of entities with IDs larger than supported range of "C long" raises exception.
Specifications
The bug is in the _serialize_val function in key_encoding_utils.
Possible Solution
changing
struct.pack("<l", v.int64_val), ValueType.INT64
tostruct.pack("<q", v.int64_val), ValueType.INT64
fixes this.The text was updated successfully, but these errors were encountered: