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

Extract EmptyRelation, Limit, Values from LogicalPlan #1325

Merged
merged 2 commits into from
Nov 19, 2021

Conversation

liukun4515
Copy link
Contributor

Which issue does this PR close?

Closes #1305

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@liukun4515 liukun4515 marked this pull request as draft November 17, 2021 13:59
@github-actions github-actions bot added the datafusion Changes in the datafusion crate label Nov 17, 2021
@liukun4515 liukun4515 marked this pull request as ready for review November 19, 2021 00:13
@liukun4515 liukun4515 marked this pull request as draft November 19, 2021 00:14
@liukun4515 liukun4515 marked this pull request as ready for review November 19, 2021 04:25
@liukun4515
Copy link
Contributor Author

@alamb PTAL

Copy link
Member

@xudong963 xudong963 left a comment

Choose a reason for hiding this comment

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

Thanks @liukun4515

/// The logical plan
input: Arc<LogicalPlan>,
},
Limit(Limit),
Copy link
Member

Choose a reason for hiding this comment

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

Using a different name will be better, such as LimitPlan, keep the same as others.

Copy link
Contributor

Choose a reason for hiding this comment

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

I actually think the way this PR is written, Limit(Limit) is more consistent. The only one that seems to follow a different pattern is TableScanPlan (which we should perhaps rename to TableScan?)

@@ -107,7 +107,7 @@ impl OptimizerRule for ConstantFolding {

utils::from_plan(plan, &expr, &new_inputs)
}
LogicalPlan::TableScan { .. } | LogicalPlan::EmptyRelation { .. } => {
LogicalPlan::TableScan { .. } | LogicalPlan::EmptyRelation(_) => {
Copy link
Member

Choose a reason for hiding this comment

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

nit: keep consistent. { .. } (_)

Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps we can do this in a follow on pr. Good spot @xudong963

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xudong963 @alamb
I might miss this point when write the code.
After all the extracting logical plan, i will file a followup pull request to keep consistent.

Copy link
Contributor

Choose a reason for hiding this comment

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

(I merged the PR in before you had a chance to respond to this comment -- so it was my fault :) )

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.

I think it looks good. Thanks @liukun4515 !

@alamb alamb merged commit feb9ec5 into apache:master Nov 19, 2021
@alamb
Copy link
Contributor

alamb commented Nov 19, 2021

Merged this one in to minimize conflicts with other outstanding PRs

@liukun4515 liukun4515 deleted the datafusion_1305 branch November 20, 2021 01:32
@houqp houqp added the api change Changes the API exposed to users of the crate label Nov 20, 2021
xudong963 pushed a commit to xudong963/arrow-datafusion that referenced this pull request Nov 28, 2021
@alamb alamb changed the title [datafusion-1305]Extract EmptyRelation, Limit, Values in LogicalPlan Extract EmptyRelation, Limit, Values from LogicalPlan Feb 10, 2022
@alamb alamb removed the api change Changes the API exposed to users of the crate label Feb 10, 2022
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.

Extract EmptyRelation, Limit, Values in LogicalPlan as independent struct
4 participants