Skip to content

Commit 8f1ae58

Browse files
authored
minor: remove redundant code/TODO (#4019)
* minor: remove redundant prefix. * join already is added. * more * fmt
1 parent f91eddf commit 8f1ae58

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

datafusion/core/src/dataframe.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,6 @@ impl DataFrame {
362362
Ok(Arc::new(DataFrame::new(self.session_state.clone(), &plan)))
363363
}
364364

365-
// TODO: add join_using
366-
367365
/// Repartition a DataFrame based on a logical partitioning scheme.
368366
///
369367
/// ```
@@ -1386,9 +1384,7 @@ mod tests {
13861384

13871385
let plan = df.explain(false, false)?.collect().await?;
13881386
// Filters all the way to Parquet
1389-
let formatted = arrow::util::pretty::pretty_format_batches(&plan)
1390-
.unwrap()
1391-
.to_string();
1387+
let formatted = pretty::pretty_format_batches(&plan).unwrap().to_string();
13921388
assert!(formatted.contains("predicate=id_min@0 <= 1 AND 1 <= id_max@1"));
13931389

13941390
Ok(())

datafusion/core/src/physical_plan/joins/hash_join.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,7 @@ impl ExecutionPlan for HashJoinExec {
348348
}))
349349
}
350350

351-
fn fmt_as(
352-
&self,
353-
t: DisplayFormatType,
354-
f: &mut std::fmt::Formatter,
355-
) -> std::fmt::Result {
351+
fn fmt_as(&self, t: DisplayFormatType, f: &mut fmt::Formatter) -> fmt::Result {
356352
match t {
357353
DisplayFormatType::Default => {
358354
let display_filter = self.filter.as_ref().map_or_else(
@@ -1361,7 +1357,7 @@ fn produce_from_matched(
13611357
}
13621358
JoinSide::Right => {
13631359
let datatype = schema.field(idx).data_type();
1364-
arrow::array::new_null_array(datatype, num_rows)
1360+
new_null_array(datatype, num_rows)
13651361
}
13661362
};
13671363

@@ -1376,7 +1372,7 @@ impl HashJoinStream {
13761372
fn poll_next_impl(
13771373
&mut self,
13781374
cx: &mut std::task::Context<'_>,
1379-
) -> std::task::Poll<Option<ArrowResult<RecordBatch>>> {
1375+
) -> Poll<Option<ArrowResult<RecordBatch>>> {
13801376
let left_data = match ready!(self.left_fut.get(cx)) {
13811377
Ok(left_data) => left_data,
13821378
Err(e) => return Poll::Ready(Some(Err(e))),

datafusion/core/src/test/exec.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use crate::{
4646
/// Index into the data that has been returned so far
4747
#[derive(Debug, Default, Clone)]
4848
pub struct BatchIndex {
49-
inner: std::sync::Arc<std::sync::Mutex<usize>>,
49+
inner: Arc<std::sync::Mutex<usize>>,
5050
}
5151

5252
impl BatchIndex {
@@ -91,10 +91,7 @@ impl TestStream {
9191
impl Stream for TestStream {
9292
type Item = ArrowResult<RecordBatch>;
9393

94-
fn poll_next(
95-
self: std::pin::Pin<&mut Self>,
96-
_: &mut Context<'_>,
97-
) -> Poll<Option<Self::Item>> {
94+
fn poll_next(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<Self::Item>> {
9895
let next_batch = self.index.value();
9996

10097
Poll::Ready(if next_batch < self.data.len() {

0 commit comments

Comments
 (0)