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

bugfix: fix eval nullalbe() in simplify_exprs #5208

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

jackwener
Copy link
Member

@jackwener jackwener commented Feb 7, 2023

Which issue does this PR close?

Closes #5191.

Rationale for this change

What changes are included in this PR?

Remove use all_schemas() but use the plan schema + children_merge_schema().

set pub skip_failed_rules: bool, default = false

Before this PR, right_anti_filter_push_down and right_semi_with_alias_filter will fail.
After this PR, they will success.

Are these changes tested?

Current test can cover it (we just need to disable skip_fail)

Are there any user-facing changes?

@github-actions github-actions bot added the optimizer Optimizer rules label Feb 7, 2023
@jackwener jackwener changed the title bugfix: fix eval nullalbe() in simplify_exprs` bugfix: fix eval nullalbe() in simplify_exprs Feb 7, 2023
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.

Thank you @jackwener

Is there some test we could write that would show the effect of this change?

// Pass down the `children merge schema` and `plan schema` to evaluate expression types.
// pass all `child schema` and `plan schema` isn't enough, because like `t1 semi join t2 on
// on t1.id = t2.id`, each individual schema can't contain all the columns in it.
let children_merge_schema = DFSchemaRef::new(merge_schema(plan.inputs()));
Copy link
Contributor

Choose a reason for hiding this comment

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

In some ways, it seems to me that we should only be using the children's schemas as the expressions within he LogicalPlan should be in terms of the plan's inputs (the children's schemas) not the plan's output (plan.schema())

Copy link
Member Author

Choose a reason for hiding this comment

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

it seems to me that we should only be using the children's schemas.

I can't agree with it more.

But current code get attribution of some Expression by get it from plan.schema() instead of inferring/computing them from children ouput.

For example, some test will fail like csv_query_group_by_and_having_and_where.

Copy link
Contributor

Choose a reason for hiding this comment

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

Something else to work on over time, perhaps

@jackwener
Copy link
Member Author

jackwener commented Feb 7, 2023

Is there some test we could write that would show the effect of this change?

current tests can cover this problem, but it was hidden by skip_failed_rules.

set pub skip_failed_rules: bool, default = false

Before this PR, right_anti_filter_push_down and right_semi_with_alias_filter will fail.
After this PR, they will success.

I'm working on #4685 and try to fix all bug in it.

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.

current tests can cover this problem, but it was hidden by skip_failed_rules.

👍
Sounds good. Thank you @jackwener

@alamb alamb merged commit f0c6719 into apache:master Feb 7, 2023
@ursabot
Copy link

ursabot commented Feb 7, 2023

Benchmark runs are scheduled for baseline = e222bd6 and contender = f0c6719. f0c6719 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimizer Optimizer rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

simplify_expr() invoke nullable() exist bug
3 participants