andygrove commented on code in PR #2142:
URL: https://github.com/apache/datafusion-comet/pull/2142#discussion_r2274655330
##########
native/core/src/execution/planner.rs:
##########
@@ -2610,10 +2610,23 @@ impl From<ExpressionError> for DataFusionError {
/// modification. This is used to determine if we need to copy the input batch
to avoid
/// data corruption from reusing the input batch.
fn can_reuse_input_batch(op: &Arc<dyn ExecutionPlan>) -> bool {
- if op.as_any().is::<ProjectionExec>() ||
op.as_any().is::<LocalLimitExec>() {
- can_reuse_input_batch(op.children()[0])
+ if op.as_any().is::<ScanExec>() {
+ // JVM side can return arrow buffers to the pool
+ // Also, native_comet scan reuses mutable buffers
+ true
Review Comment:
This is very conservative/safe for now. I still believe that we avoid deep
copies for some ScanExec sources but probably only once we've fixed some FFI
issues
--
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]