This is an automated email from the ASF dual-hosted git repository.
agrove pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-comet.git
The following commit(s) were added to refs/heads/main by this push:
new eff2897c minor: replace .downcast_ref::<T>().is_some() with .is::<T>()
(#635)
eff2897c is described below
commit eff2897c98b3c820142514af888a126928f7f9b2
Author: Andy Grove <[email protected]>
AuthorDate: Fri Jul 5 15:28:56 2024 -0600
minor: replace .downcast_ref::<T>().is_some() with .is::<T>() (#635)
---
core/src/execution/datafusion/planner.rs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/core/src/execution/datafusion/planner.rs
b/core/src/execution/datafusion/planner.rs
index 8d7d2465..40515c0c 100644
--- a/core/src/execution/datafusion/planner.rs
+++ b/core/src/execution/datafusion/planner.rs
@@ -916,7 +916,7 @@ impl PhysicalPlanner {
// the data corruption. Note that we only need to copy the
input batch
// if the child operator is `ScanExec`, because other
operators after `ScanExec`
// will create new arrays for the output batch.
- let child = if
child.as_any().downcast_ref::<ScanExec>().is_some() {
+ let child = if child.as_any().is::<ScanExec>() {
Arc::new(CopyExec::new(child))
} else {
child
@@ -1609,10 +1609,10 @@ 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 {
- op.as_any().downcast_ref::<ScanExec>().is_some()
- || op.as_any().downcast_ref::<LocalLimitExec>().is_some()
- || op.as_any().downcast_ref::<ProjectionExec>().is_some()
- || op.as_any().downcast_ref::<FilterExec>().is_some()
+ op.as_any().is::<ScanExec>()
+ || op.as_any().is::<LocalLimitExec>()
+ || op.as_any().is::<ProjectionExec>()
+ || op.as_any().is::<FilterExec>()
}
/// Collects the indices of the columns in the input schema that are used in
the expression
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]