lipeh1 opened a new pull request, #27895:
URL: https://github.com/apache/datafusion/pull/27895

   ## Which issue does this PR close?
   
   Closes #27885.
   
   ## Rationale for this change
   
   Arrow includes the outer array object in `get_array_memory_size()`. When 
`DFHeapSize` measures a nested scalar through its owning `Arc`, the array and 
the `Arc` both charge for that object.
   
   ## What changes are included in this PR?
   
   Subtract the outer object's inline size in the shared `DFHeapSize` 
implementation for nested Arrow arrays. The owner then charges for the object 
once, while Arrow still supplies the estimate for children and buffers. The 
statistics cache test now derives the expected entry size from its key and 
value.
   
   ## What is the testing strategy for this PR?
   
   The one-row struct regression checks exact byte counts for a bare 
`StructArray`, an `Arc<StructArray>`, and a `ScalarValue::Struct`. A second 
scalar sharing the same `Arc` adds zero bytes in the same context. The list and 
map tests cover other nested layouts.
   
   The common and execution crate tests and the interval graph size tests pass 
locally. On Windows, five CSV path cases and a Bernoulli rounding assertion 
failed on both this branch and unmodified `main` at `34eb0b910`.
   
   ## Are there any user-facing changes?
   
   Nested scalar values consume less of the file statistics cache's byte 
budget, so more entries may fit before eviction.


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