You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/12 15:55:49 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #1552: Create RecordBatch With Non-Zero Row Count But No Columns (#1536)

tustvold commented on code in PR #1552:
URL: https://github.com/apache/arrow-rs/pull/1552#discussion_r848602337


##########
arrow/src/record_batch.rs:
##########
@@ -101,23 +100,21 @@ impl RecordBatch {
             .iter()
             .map(|field| new_empty_array(field.data_type()))
             .collect();
-        RecordBatch { schema, columns }
+
+        RecordBatch {
+            schema,
+            columns,
+            row_count: 0,
+        }
     }
 
     /// Validate the schema and columns using [`RecordBatchOptions`]. Returns an error
-    /// if any validation check fails.
-    fn validate_new_batch(
-        schema: &SchemaRef,
-        columns: &[ArrayRef],
+    /// if any validation check fails, otherwise returns the created [`RecordBatch`]
+    fn try_new_impl(

Review Comment:
   I'm not really sure why we need a separate method for this, but I avoided changing it to keep the diff down



-- 
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