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

expression: fix keepNull option for istrue function #19600

Closed
wants to merge 7 commits into from
Closed

expression: fix keepNull option for istrue function #19600

wants to merge 7 commits into from

Conversation

dyzsr
Copy link
Contributor

@dyzsr dyzsr commented Aug 30, 2020

What problem does this PR solve?

Issue Number: close #17720

Problem Summary:

isTrueOrFalseFunctionClass.keepNull was initialized differently in expression rewriter and EvaluateExprWithNull, which caused outer join wrongly simplified to inner join during predicate push down optimization.

What is changed and how it works?

What's Changed:

  • Unify the initialization of isTrueOrFalseFunctionClass with newFunctionImpl.

How it Works:

  • Remove the direct initialization of ScalarFunction in wrapWithIsTrue. Invoke NewFunctionInternal instead.
  • Use sessionctx.Context to pass the argument is_true_keep_null, which affects the evaluation of NULL in function istrue.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test

Release note

  • fix the behavior of istrue function when null is involved

@dyzsr dyzsr requested a review from a team as a code owner August 30, 2020 16:05
@dyzsr dyzsr requested review from fzhedu and removed request for a team August 30, 2020 16:05
@XuHuaiyu XuHuaiyu requested a review from wshwsh12 August 31, 2020 02:19
@wshwsh12 wshwsh12 changed the title expression: fix keepNull option for istrue function (#17720) expression: fix keepNull option for istrue function Aug 31, 2020
@dyzsr dyzsr marked this pull request as draft September 2, 2020 04:02
@dyzsr dyzsr closed this Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OR operation not correct in where clause
3 participants