cetra3 commented on code in PR #27391:
URL: https://github.com/apache/datafusion/pull/27391#discussion_r4673881832


##########
datafusion/common/src/scalar/mod.rs:
##########
@@ -5300,7 +5300,18 @@ impl ScalarValue {
     /// `LargeListView`, `Struct`, `Map`) are handled by recursing into their
     /// child / values arrays and reconstructing the parent with the compacted
     /// children.  All other types are returned unchanged.
-    fn compact_view_buffers(array: ArrayRef) -> ArrayRef {
+    ///
+    /// `gc` copies the bytes of each view separately. Views that share bytes,
+    /// such as the output of `take` with repeated indices, each get their own
+    /// copy, so the result can be larger than the input.
+    ///
+    /// # Public Only for Internal Use:
+    ///
+    /// This is not a public API and is for internal use only; see [API 
policy] for details.
+    ///
+    /// [API policy]: 
https://datafusion.apache.org/contributor-guide/api-health.html#internal-public-apis
+    #[doc(hidden)]
+    pub fn compact_view_buffers(array: ArrayRef) -> ArrayRef {

Review Comment:
   Agreed, it is an array utility. I moved it to `datafusion_common::utils` 
next to `compact_dictionary`, along with `has_view_types`, which has to cover 
the same types. `ScalarValue::compact` calls it from there.
   
   `compact_payload` in `array_agg.rs` does the same recursion and also handles 
dictionaries. Merging the two could be a follow-up.
   



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

Reply via email to