You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2022/10/31 13:02:27 UTC

[arrow-datafusion] branch master updated: minor: remove redundant code/TODO (#4019)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 8f1ae5849 minor: remove redundant code/TODO (#4019)
8f1ae5849 is described below

commit 8f1ae58494b78cf4dde237aaa2be0b5037cfc403
Author: jakevin <ja...@gmail.com>
AuthorDate: Mon Oct 31 21:02:21 2022 +0800

    minor: remove redundant code/TODO (#4019)
    
    * minor: remove redundant prefix.
    
    * join already is added.
    
    * more
    
    * fmt
---
 datafusion/core/src/dataframe.rs                     |  6 +-----
 datafusion/core/src/physical_plan/joins/hash_join.rs | 10 +++-------
 datafusion/core/src/test/exec.rs                     |  7 ++-----
 3 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/datafusion/core/src/dataframe.rs b/datafusion/core/src/dataframe.rs
index a699a234c..aa5958fe6 100644
--- a/datafusion/core/src/dataframe.rs
+++ b/datafusion/core/src/dataframe.rs
@@ -362,8 +362,6 @@ impl DataFrame {
         Ok(Arc::new(DataFrame::new(self.session_state.clone(), &plan)))
     }
 
-    // TODO: add join_using
-
     /// Repartition a DataFrame based on a logical partitioning scheme.
     ///
     /// ```
@@ -1386,9 +1384,7 @@ mod tests {
 
         let plan = df.explain(false, false)?.collect().await?;
         // Filters all the way to Parquet
-        let formatted = arrow::util::pretty::pretty_format_batches(&plan)
-            .unwrap()
-            .to_string();
+        let formatted = pretty::pretty_format_batches(&plan).unwrap().to_string();
         assert!(formatted.contains("predicate=id_min@0 <= 1 AND 1 <= id_max@1"));
 
         Ok(())
diff --git a/datafusion/core/src/physical_plan/joins/hash_join.rs b/datafusion/core/src/physical_plan/joins/hash_join.rs
index 99628d7da..839a24112 100644
--- a/datafusion/core/src/physical_plan/joins/hash_join.rs
+++ b/datafusion/core/src/physical_plan/joins/hash_join.rs
@@ -348,11 +348,7 @@ impl ExecutionPlan for HashJoinExec {
         }))
     }
 
-    fn fmt_as(
-        &self,
-        t: DisplayFormatType,
-        f: &mut std::fmt::Formatter,
-    ) -> std::fmt::Result {
+    fn fmt_as(&self, t: DisplayFormatType, f: &mut fmt::Formatter) -> fmt::Result {
         match t {
             DisplayFormatType::Default => {
                 let display_filter = self.filter.as_ref().map_or_else(
@@ -1361,7 +1357,7 @@ fn produce_from_matched(
             }
             JoinSide::Right => {
                 let datatype = schema.field(idx).data_type();
-                arrow::array::new_null_array(datatype, num_rows)
+                new_null_array(datatype, num_rows)
             }
         };
 
@@ -1376,7 +1372,7 @@ impl HashJoinStream {
     fn poll_next_impl(
         &mut self,
         cx: &mut std::task::Context<'_>,
-    ) -> std::task::Poll<Option<ArrowResult<RecordBatch>>> {
+    ) -> Poll<Option<ArrowResult<RecordBatch>>> {
         let left_data = match ready!(self.left_fut.get(cx)) {
             Ok(left_data) => left_data,
             Err(e) => return Poll::Ready(Some(Err(e))),
diff --git a/datafusion/core/src/test/exec.rs b/datafusion/core/src/test/exec.rs
index 855bb3bbc..e7ee746c9 100644
--- a/datafusion/core/src/test/exec.rs
+++ b/datafusion/core/src/test/exec.rs
@@ -46,7 +46,7 @@ use crate::{
 /// Index into the data that has been returned so far
 #[derive(Debug, Default, Clone)]
 pub struct BatchIndex {
-    inner: std::sync::Arc<std::sync::Mutex<usize>>,
+    inner: Arc<std::sync::Mutex<usize>>,
 }
 
 impl BatchIndex {
@@ -91,10 +91,7 @@ impl TestStream {
 impl Stream for TestStream {
     type Item = ArrowResult<RecordBatch>;
 
-    fn poll_next(
-        self: std::pin::Pin<&mut Self>,
-        _: &mut Context<'_>,
-    ) -> Poll<Option<Self::Item>> {
+    fn poll_next(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<Self::Item>> {
         let next_batch = self.index.value();
 
         Poll::Ready(if next_batch < self.data.len() {