evenyag commented on code in PR #5299:
URL: https://github.com/apache/arrow-rs/pull/5299#discussion_r1460715807


##########
parquet/src/arrow/arrow_writer/mod.rs:
##########
@@ -119,11 +119,27 @@ impl<W: Write + Send> ArrowWriter<W> {
         writer: W,
         arrow_schema: SchemaRef,
         props: Option<WriterProperties>,
+    ) -> Result<Self> {
+        Self::try_new_with_options(writer, arrow_schema, props, 
Default::default())
+    }
+
+    /// Try to create a new Arrow writer with [`ArrowWriterOptions`].
+    ///
+    /// The writer will fail if:
+    ///  * a `SerializedFileWriter` cannot be created from the ParquetWriter
+    ///  * the Arrow schema contains unsupported datatypes such as Unions
+    pub fn try_new_with_options(
+        writer: W,
+        arrow_schema: SchemaRef,
+        props: Option<WriterProperties>,

Review Comment:
   Sure, I'll try it. The cpp 
[FileWriter](https://arrow.apache.org/docs/cpp/api/formats.html#_CPPv4N7parquet5arrow10FileWriterE)
 API separates these two parameters so I kept `try_new_with_options()` similar 
to theirs.
   ```c++
   ::arrow::Result<std::unique_ptr<FileWriter>> Open(
       const ::arrow::Schema &schema,
       MemoryPool *pool,
       std::shared_ptr<::arrow::io::OutputStream> sink,
       std::shared_ptr<WriterProperties> properties = 
default_writer_properties(),
       std::shared_ptr<ArrowWriterProperties> arrow_properties = 
default_arrow_writer_properties()
   )
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to