Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make nightly clippy happy #2186

Merged
merged 1 commit into from
Apr 11, 2022
Merged

make nightly clippy happy #2186

merged 1 commit into from
Apr 11, 2022

Conversation

xudong963
Copy link
Member

  • replace abs with unsigned_abs
  • avoid await while holding a non-async-aware MutexGuard.

@github-actions github-actions bot added ballista datafusion Changes in the datafusion crate labels Apr 9, 2022
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @xudong963 -- looks great. I think we should get an opinion from someone focused on Ballista for the job/stage change, but otherwise good to go from my perspective

@@ -151,11 +151,11 @@ fn shift_with_default_value(
create_empty_array(value, array.data_type(), array.len())
} else {
let slice_offset = (-offset).clamp(0, value_len) as usize;
let length = array.len() - offset.abs() as usize;
let length = array.len() - offset.unsigned_abs() as usize;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at this code I wonder if we need to check for offset < 0 -- however, this PR seems like a definite improvement so 👍

@@ -124,28 +124,33 @@ impl<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan>
.get_from_prefix(&get_stage_prefix(&self.namespace))
.await?;

let mut tmp_stages: HashMap<StageKey, Arc<dyn ExecutionPlan>> = HashMap::new();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me (make the snapshot while not holding the lock) but I am not familiar enough with the ballista codebase to know if it would cause problems. Perhaps @mingmwang @yahoNanJing or @thinkharderdev could review it too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. This should only happen when the scheduler initializes and needs to load the persistent state into memory

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -124,28 +124,33 @@ impl<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan>
.get_from_prefix(&get_stage_prefix(&self.namespace))
.await?;

let mut tmp_stages: HashMap<StageKey, Arc<dyn ExecutionPlan>> = HashMap::new();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. This should only happen when the scheduler initializes and needs to load the persistent state into memory

@xudong963
Copy link
Member Author

Thanks @alamb @thinkharderdev

@xudong963 xudong963 merged commit 7558a55 into apache:master Apr 11, 2022
@xudong963 xudong963 deleted the fix_nightly branch April 11, 2022 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants