bharath-techie commented on code in PR #19444:
URL: https://github.com/apache/datafusion/pull/19444#discussion_r2639830983
##########
datafusion/physical-plan/src/spill/mod.rs:
##########
@@ -339,6 +339,97 @@ fn get_max_alignment_for_schema(schema: &Schema) -> usize {
max_alignment
}
+#[cfg(test)]
+const VIEW_SIZE_BYTES: usize = 16;
+#[cfg(test)]
+const INLINE_THRESHOLD: usize = 12;
+
+/// Performs garbage collection on view arrays before spilling.
+pub(crate) fn gc_view_arrays(batch: &RecordBatch) -> Result<RecordBatch> {
+ let mut new_columns: Vec<Arc<dyn Array>> =
Vec::with_capacity(batch.num_columns());
+ let mut any_gc_performed = false;
+
+ for array in batch.columns() {
Review Comment:
Maybe lets exit early and return the batch as it is if there are no view
arrays in the `RecordBatch` ?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]