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

Additional IN / NOT IN simplifications #8970

Open
alamb opened this issue Jan 23, 2024 · 3 comments
Open

Additional IN / NOT IN simplifications #8970

alamb opened this issue Jan 23, 2024 · 3 comments

Comments

@alamb
Copy link
Contributor

alamb commented Jan 23, 2024

          In the following on PR, I think we can move inlist related simplifier logic to `inlist_simplifier`.

Steps in inlist_simplifier

  1. early stage simplification like expr IN () --> false, null IN/NOT IN
  2. convert long OR chain or AND chain to InList expressions like what or_in_list_simplifier does
  3. shorten InList expressions like what inlist_simplifier in this PR does
  4. convert final inlist to OR chain or AND chain if len < 3. Move inlist related simplifier out from expr_simplifier

In this way, when the logic grows more complex, we can easily find out related conversion about specific Expr

Originally posted by @jayzhan211 in #8949 (comment)

@guojidan
Copy link
Contributor

I am interested in this and let me try to implement it

@alamb
Copy link
Contributor Author

alamb commented Jan 24, 2024

I think this issue might be done best in multiple PRs

SO for example the first PR could just move all the inlist related simplifications into one place

Note I also have a PR to change the code, for your awareness: #8971

@guojidan
Copy link
Contributor

ok, I got it 😄

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

No branches or pull requests

2 participants