-
Notifications
You must be signed in to change notification settings - Fork 162
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
UDT fields messed up on writes through gRPC #1329
Comments
Fix coming. |
pkolaczk
added a commit
that referenced
this issue
Oct 12, 2021
UdtCodec#encode was encoding the fields in the order of values received from the `UserDefinedType#columnMap`. That order does not necessarily match the order of the fields in the UDT, because the returned map is a HashMap. Placing the values in the output buffer in a wrong order can lead to silent data corruption or at best marshalling exceptions from C*. This commit makes the encoded values order match exactly the order of fields in the UDT. Fixes #1329
3 tasks
pkolaczk
added a commit
that referenced
this issue
Oct 12, 2021
UdtCodec#encode was encoding the fields in the order of values received from the `UserDefinedType#columnMap`. That order does not necessarily match the order of the fields in the UDT, because the returned map is a HashMap. Placing the values in the output buffer in a wrong order can lead to silent data corruption or at best marshalling exceptions from C*. This commit makes the encoded values order match exactly the order of fields in the UDT. Fixes #1329
tomekl007
added a commit
that referenced
this issue
Oct 13, 2021
* Encode Udt field values in the correct order UdtCodec#encode was encoding the fields in the order of values received from the `UserDefinedType#columnMap`. That order does not necessarily match the order of the fields in the UDT, because the returned map is a HashMap. Placing the values in the output buffer in a wrong order can lead to silent data corruption or at best marshalling exceptions from C*. This commit makes the encoded values order match exactly the order of fields in the UDT. Fixes #1329 * add integration test Co-authored-by: tomekl007 <tomasz.lelek@datastax.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following schema:
Now we do an insert of row with
UdtValue
of{ f1: 'Long St', f2: '7870' }
and we check what was inserted in C*:So far looks good.
But we used stupid field names.
Let's make it nicer. Let's change the field names.
And insert just the same thing:
UdtValue
of{ street: 'Long St', number: '7870' }
.Oooops. Values got misplaced.
If you make it even nicer and change the number type to BIGINT as it should be, then you'll get:
because C* is trying to process a BIGINT value with a UTF8Validator, which is just a result of values attached to wrong keys.
The text was updated successfully, but these errors were encountered: