Skip to content

Commit

Permalink
minor: replace .downcast_ref::<T>().is_some() with .is::<T>() (#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove authored Jul 5, 2024
1 parent d8fef2b commit eff2897
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/execution/datafusion/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eff2897

Please sign in to comment.