You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/09/28 18:32:49 UTC

[GitHub] [arrow-rs] alamb commented on a diff in pull request #4859: Enable External ArrowColumnWriter Access

alamb commented on code in PR #4859:
URL: https://github.com/apache/arrow-rs/pull/4859#discussion_r1340534428


##########
parquet/src/arrow/arrow_writer/mod.rs:
##########
@@ -347,13 +349,22 @@ impl PageWriter for ArrowPageWriter {
     }
 }
 
-/// Encodes a leaf column to [`ArrowPageWriter`]
-enum ArrowColumnWriter {
+/// Serializes [ArrayRef]s to [ArrowColumnChunk]s which can be concatenated
+/// to form a parquet row group
+pub enum ArrowColumnWriter {
     ByteArray(GenericColumnWriter<'static, ByteArrayEncoder>),
     Column(ColumnWriter<'static>),
 }
 
 impl ArrowColumnWriter {
+    /// Serializes an [ArrayRef] to a [ArrowColumnChunk] for an in progress row group.
+    pub fn write(&mut self, array: ArrayRef, field: Arc<Field>) -> Result<()> {
+        let mut levels = calculate_array_levels(&array, &field)?.into_iter();
+        let mut writer_iter = std::iter::once(self);

Review Comment:
   I believe https://github.com/apache/arrow-rs/pull/4871 the alternate API proposal?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org