Skip to content

Minor Code cleanups - #1428

Merged
alamb merged 1 commit into
apache:masterfrom
alamb:alamb/cleanups
Dec 9, 2021
Merged

alamb merged 1 commit into
apache:masterfrom
alamb:alamb/cleanups

Conversation

@alamb

@alamb alamb commented Dec 9, 2021

Copy link
Copy Markdown
Contributor

This PR contains some minor style cleanups that I noticed while reviewing #1415 from @viirya.

As that PR had already had a lot of discussion, I figured I would just propose the cleanups directly as a follow on PR rather than hold up merging #1415

@alamb
alamb marked this pull request as ready for review December 9, 2021 17:51
missing_cols: &[Column],
) -> Result<LogicalPlan> {
match curr_plan.clone() {
match curr_plan {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no need to clone -- we already take cur_plan by value

new_expr.extend(expr);
missing_cols.iter().try_for_each::<_, Result<()>>(|c| {
new_expr.push(normalize_col(Expr::Column(c.clone()), &input)?);
let missing_exprs = missing_cols

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this just rejiggers stuff to avoid the need for mut -- not critical but I think it is more concise


Ok(())
})?;
let new_inputs = curr_plan

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

same thing here -- just avoids the need for mut (and I think it is clearer what is going on now too)

@viirya

viirya commented Dec 9, 2021

Copy link
Copy Markdown
Member

Thanks @alamb !

@alamb
alamb merged commit 50a9880 into apache:master Dec 9, 2021
@alamb
alamb deleted the alamb/cleanups branch December 9, 2021 20:47
unkloud pushed a commit to unkloud/datafusion that referenced this pull request Mar 23, 2025
## Which issue does this PR close?

Closes apache#1422.

## Rationale for this change

Support IntegralDivide function

## What changes are included in this PR?

Since datafusion div operator conforms to the logic of intergal div, we only need to convert `IntegralDivide(...)` to `Cast(Divide(...), LongType)` and then convert it to native.

## How are these changes tested?

added unit test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants