Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3630

[Rust] Make it possible to extend pre-existing Avro bytes

    XMLWordPrintableJSON

Details

    Description

      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

      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()?;
      

      I was wondering if I could do something like:

      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()?;
      

      ==================================

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              mgrigorov Martin Tzvetanov Grigorov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m