Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-10390

[Rust] [Parquet] Regression Can not implement custom ParquetWriter because `TryClone` is not publically exported

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 3.0.0
    • Rust

    Description

      As of this commit

      https://github.com/apache/arrow/commit/7155cd5488310c15d864428252ca71dd9ebd3b48

      I don't think it is possible for a user of the arrow trait to implement a custom Parquet writer anymore. Specifically, theParquetWriter trait requires `TryClone` implemented, https://github.com/apache/arrow/blob/master/rust/parquet/src/file/writer.rs#L117-L118

      
      pub trait ParquetWriter: Write + Seek + TryClone {}
      impl<T: Write + Seek + TryClone> ParquetWriter for T {}
      
      /// A serialized implementation for Parquet [`FileWriter`].
      /// See documentation on file writer for more information.
      pub struct SerializedFileWriter<W: ParquetWriter> {
      
      

      but `TryClone` is can not be used. It is a `pub` trait:

      https://github.com/apache/arrow/blob/master/rust/parquet/src/util/io.rs#L28-L32

      /// TryClone tries to clone the type and should maintain the `Seek` position of the given
      /// instance.
      pub trait TryClone: Sized {
          /// Clones the type returning a new instance or an error if it's not possible
          /// to clone it.
          fn try_clone(&self) -> Result<Self>;
      }
      

      But the module it is (util.io) in is not marked as `pub`: https://github.com/apache/arrow/blob/master/rust/parquet/src/lib.rs#L39

      ```
      #[macro_use]
      mod util;
      #[cfg(any(feature = "arrow", test))]
      pub mod arrow;
      pub mod column;
      pub mod compression;
      mod encodings;
      pub mod file;
      pub mod record;
      pub mod schema;

      
      

      Attachments

        Issue Links

          Activity

            People

              alamb Andrew Lamb
              alamb Andrew Lamb
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 1h 10m
                  1h 10m