You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by pa...@apache.org on 2020/06/21 17:58:41 UTC

[arrow] branch master updated: ARROW-9157: [Rust][Datafusion] create_physical_plan should take self as immutable reference

This is an automated email from the ASF dual-hosted git repository.

paddyhoran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new fa0d0d4  ARROW-9157: [Rust][Datafusion] create_physical_plan should take self as immutable reference
fa0d0d4 is described below

commit fa0d0d45be492e3beebe357d25db73b75a5959cb
Author: Qingping Hou <da...@gmail.com>
AuthorDate: Sun Jun 21 13:57:57 2020 -0400

    ARROW-9157: [Rust][Datafusion] create_physical_plan should take self as immutable reference
    
    Since it's not mutating self, mutable reference is not necessary.
    
    Closes #7464 from houqp/ARROW-9157
    
    Authored-by: Qingping Hou <da...@gmail.com>
    Signed-off-by: Paddy Horan <pa...@hotmail.com>
---
 rust/datafusion/src/execution/context.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rust/datafusion/src/execution/context.rs b/rust/datafusion/src/execution/context.rs
index 94ff497..502000e 100644
--- a/rust/datafusion/src/execution/context.rs
+++ b/rust/datafusion/src/execution/context.rs
@@ -280,7 +280,7 @@ impl ExecutionContext {
 
     /// Create a physical plan from a logical plan
     pub fn create_physical_plan(
-        &mut self,
+        &self,
         logical_plan: &LogicalPlan,
         batch_size: usize,
     ) -> Result<Arc<dyn ExecutionPlan>> {
@@ -786,7 +786,7 @@ mod tests {
         .build()?;
         assert_fields_eq(&plan, vec!["b"]);
 
-        let mut ctx = ExecutionContext::new();
+        let ctx = ExecutionContext::new();
         let optimized_plan = ctx.optimize(&plan)?;
         match &optimized_plan {
             LogicalPlan::Projection { input, .. } => match &**input {
@@ -991,7 +991,7 @@ mod tests {
     #[test]
     fn aggregate_with_alias() -> Result<()> {
         let tmp_dir = TempDir::new("execute")?;
-        let mut ctx = create_ctx(&tmp_dir, 1)?;
+        let ctx = create_ctx(&tmp_dir, 1)?;
 
         let schema = Arc::new(Schema::new(vec![
             Field::new("state", DataType::Utf8, false),