[
https://issues.apache.org/jira/browse/AVRO-3633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17623013#comment-17623013
]
ASF subversion and git services commented on AVRO-3633:
-------------------------------------------------------
Commit fc71db2a9e65fd91cd6e49f6cdc7d41eccf914e3 in avro's branch
refs/heads/dependabot/maven/lang/java/org.apache.thrift-libthrift-0.17.0 from
jpramosi
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=fc71db2a9 ]
AVRO-3633: [Rust] Additional attributes for 'avro_derive' crate (#1905)
* AVRO-3633: Add 'skip' attribute macro
* AVRO-3633: Add unit test 'skip' attribute macro
* AVRO-3633: Add 'rename' attribute macro
* AVRO-3633: Add unit test 'rename' attribute macro
* AVRO-3633: Tidy up conditions
* AVRO-3633: Rework unit tests
* AVRO-3633: Bump versions to 0.15.0
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Co-authored-by: jpramosi <[email protected]>
Co-authored-by: Martin Tzvetanov Grigorov <[email protected]>
> Additional attributes for 'avro_derive' crate
> ---------------------------------------------
>
> Key: AVRO-3633
> URL: https://issues.apache.org/jira/browse/AVRO-3633
> Project: Apache Avro
> Issue Type: Improvement
> Components: rust
> Affects Versions: 1.11.1
> Reporter: Jimmy Pramosi
> Assignee: Martin Tzvetanov Grigorov
> Priority: Minor
> Labels: easyfix, features, pull-request-available
> Fix For: 1.12.0, 1.11.2
>
> Original Estimate: 1h
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Hello,
> At the moment it is not possible to skip or rename a specific field within a
> struct derived with 'AvroSchema'. For e.g.
> {code:java}
> use std::time::Instant;
> use apache_avro::AvroSchema;
> use serde::Deserialize;
> use serde::Serialize;
> #[derive(Clone, Debug, Deserialize, Serialize, AvroSchema)]
> pub struct FileDescriptor {
> #[avro(rename = "pflags")] // <--- NOT POSSIBLE
> #[serde(rename = "pflags")]
> pub flags: u64,
> #[avro(skip)] // <--- NOT POSSIBLE
> #[serde(skip)]
> access_time: Instant,
> }{code}
> I would like to suggest to implement additional attributes 'skip' and
> 'rename' to the 'avro_derive' crate. These attributes are also common in
> other procedural macro crates like 'serde'.
> Exemplary proposal:
> [https://www.diffchecker.com/iju3tSuX]
>
> Best Regards,
> Jimmy
--
This message was sent by Atlassian Jira
(v8.20.10#820010)