You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Martin Tzvetanov Grigorov (Jira)" <ji...@apache.org> on 2022/07/25 08:18:00 UTC
[jira] [Resolved] (AVRO-3585) Unable to encode Value::String as Schema::UUID
[ https://issues.apache.org/jira/browse/AVRO-3585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Tzvetanov Grigorov resolved AVRO-3585.
---------------------------------------------
Fix Version/s: 1.11.1
1.12.0
Assignee: Martin Tzvetanov Grigorov
Resolution: Fixed
> Unable to encode Value::String as Schema::UUID
> ----------------------------------------------
>
> Key: AVRO-3585
> URL: https://issues.apache.org/jira/browse/AVRO-3585
> Project: Apache Avro
> Issue Type: Bug
> Components: rust
> Reporter: Rik Heijdens
> Assignee: Martin Tzvetanov Grigorov
> Priority: Blocker
> Labels: pull-request-available
> Fix For: 1.11.1, 1.12.0
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> Currently, `apache_avro::encode::encode()` fails to encode a Value::String as UUID. This failure can be reproduced using the following minimal test-case:
>
> {code:java}
> #[test]
> fn test_encode_uuid() {
> let value = Value::String(String::from("00000000-0000-0000-0000-000000000000"));
> let schema = Schema::Uuid;
> let mut buffer = Vec::new();
> let encoded = encode(&value, &schema, &mut buffer);
> assert!(encoded.is_ok());
> } {code}
>
>
> I believe it should be possible to encode UUIDs in this manner, and support can be trivially added by extending the match statement in `apache_avro::encode::encode_internal`.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)