[
https://issues.apache.org/jira/browse/AVRO-3585?focusedWorklogId=794740&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-794740
]
ASF GitHub Bot logged work on AVRO-3585:
----------------------------------------
Author: ASF GitHub Bot
Created on: 25/Jul/22 07:18
Start Date: 25/Jul/22 07:18
Worklog Time Spent: 10m
Work Description: RikHeijdens commented on code in PR #1778:
URL: https://github.com/apache/avro/pull/1778#discussion_r928543189
##########
lang/rust/avro/src/encode.rs:
##########
@@ -134,6 +134,9 @@ pub(crate) fn encode_internal<S: Borrow<Schema>>(
return Err(Error::GetEnumSymbol(s.clone()));
}
}
+ Schema::Uuid => {
Review Comment:
Updated the PR with @jklamer's suggestion in
https://github.com/apache/avro/pull/1778/commits/f0203f0ff4b46bb008c5c89d6856abc45c10cf3b!
Issue Time Tracking
-------------------
Worklog Id: (was: 794740)
Time Spent: 50m (was: 40m)
> 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
> Priority: Blocker
> Labels: pull-request-available
> Time Spent: 50m
> 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)