[
https://issues.apache.org/jira/browse/AVRO-3492?focusedWorklogId=757711&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-757711
]
ASF GitHub Bot logged work on AVRO-3492:
----------------------------------------
Author: ASF GitHub Bot
Created on: 17/Apr/22 20:59
Start Date: 17/Apr/22 20:59
Worklog Time Spent: 10m
Work Description: jklamer commented on code in PR #1647:
URL: https://github.com/apache/avro/pull/1647#discussion_r851803381
##########
lang/rust/avro_derive/tests/derive.rs:
##########
@@ -1063,4 +1063,40 @@ mod test_derive {
serde_assert(TestBasicWithU32 { a: u32::MIN });
serde_assert(TestBasicWithU32 { a: 1_u32 });
}
+
+ #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
+ #[avro(alias = "a", alias = "b", alias = "c")]
Review Comment:
I also wonder if this would work with:
```
#[avro(alias = "a")]
#[avro(alias = "b")]
#[avro(alias = "c")]
```
##########
lang/rust/avro_derive/src/lib.rs:
##########
@@ -277,6 +282,15 @@ fn preserve_optional(op: Option<impl quote::ToTokens>) ->
TokenStream {
}
}
+fn preserve_vec(op: Vec<impl quote::ToTokens>) -> TokenStream {
Review Comment:
nice!
Issue Time Tracking
-------------------
Worklog Id: (was: 757711)
Time Spent: 40m (was: 0.5h)
> Rust: Implement derive aliases via annotation
> ---------------------------------------------
>
> Key: AVRO-3492
> URL: https://issues.apache.org/jira/browse/AVRO-3492
> Project: Apache Avro
> Issue Type: Improvement
> Components: rust
> Reporter: Martin Tzvetanov Grigorov
> Priority: Major
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
> {color:#222222}Follow up on the Avro derive work. {color}
> {color:#222222}We want to be able to set "aliases" for a
> Schema::Record.{color}
> E.g. a slice of strings:
> {code:java}
> #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
> #[avro(aliases = ["a", "b", "c"])]
> struct TestBasicWithU32 {
> a: u32,
> } {code}
> or the less desired comma separated string:
> {code:java}
> #[derive(Debug, Serialize, Deserialize, AvroSchema, Clone, PartialEq)]
> #[avro(aliases = "a, b, c")]
> struct TestBasicWithU32 {
> a: u32,
> } {code}
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)