You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2022/10/03 10:48:00 UTC

[jira] [Commented] (AVRO-3630) [Rust] Make it possible to extend pre-existing Avro bytes

    [ https://issues.apache.org/jira/browse/AVRO-3630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17612244#comment-17612244 ] 

ASF subversion and git services commented on AVRO-3630:
-------------------------------------------------------

Commit 8640436de52ed25ccb0dbfb125cc3f142e968889 in avro's branch refs/heads/dependabot/maven/lang/java/org.apache.thrift-libthrift-0.17.0 from Martin Grigorov
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=8640436de ]

AVRO-3630: [Rust] Make it possible to extend pre-existing Avro bytes (#1888)

* AVRO-3630: [Rust] Make it possible to extend pre-existing Avro bytes

Make it possible to pass a block marker to Writer, so that it could
append to pre-existing bytes (i.e. bytes created by another Writer)

Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>

* AVRO-3630: Change Writer#marker from Vec<u8> to [u8; 16]

Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>

Signed-off-by: Martin Tzvetanov Grigorov <mg...@apache.org>

> [Rust] Make it possible to extend pre-existing Avro bytes
> ---------------------------------------------------------
>
>                 Key: AVRO-3630
>                 URL: https://issues.apache.org/jira/browse/AVRO-3630
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: rust
>    Affects Versions: 1.11.1
>            Reporter: Martin Tzvetanov Grigorov
>            Assignee: Martin Tzvetanov Grigorov
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.12.0, 1.11.2
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> From ASF Slack #[avro|[https://the-asf.slack.com/archives/CLUD54M1S/p1663751850569319]:]
> ===================================
>  I'm currenlty solving it by reading the original file and appending it to a new Vec 
> {code:java}
> let bytes: Vec<u8> = object_store
>                                 .get(&old_manifest_location)
>                                 .await?
>                                 .bytes()
>                                 .await?
>                                 .into();
> let mut writer = apache_avro::Writer::new(&schema, Vec::new());
> let reader = apache_avro::Reader::new(&*bytes)?;
> writer.extend(reader.filter_map(Result::ok))?;
> writer.append_ser(entry)?;
> let new_bytes = writer.into_inner()?;
> {code}
> I was wondering if I could do something like:
> {code:java}
> let bytes: Vec<u8> = object_store
>                                 .get(&old_manifest_location)
>                                 .await?
>                                 .bytes()
>                                 .await?
>                                 .into();
> let mut writer = apache_avro::Writer::new(&schema, bytes);
> writer.append_ser(entry)?;
> let new_bytes = writer.into_inner()?;
> {code}
> ==================================



--
This message was sent by Atlassian Jira
(v8.20.10#820010)