feat(postgres)!: preserve x IS NOT NULL instead of normalizing to NOT x IS NULL#7938
Open
geooo109 wants to merge 2 commits into
Open
feat(postgres)!: preserve x IS NOT NULL instead of normalizing to NOT x IS NULL#7938geooo109 wants to merge 2 commits into
geooo109 wants to merge 2 commits into
Conversation
geooo109
commented
Jul 24, 2026
Contributor
SQLGlot Integration Test Results✅ All tests passedComparing: Overallmain: 192414 total, 153544 passed (pass rate: 79.8%) sqlglot:geooo109/is_not_null: 180220 total, 142392 passed (pass rate: 79.0%) Transitions: Dialect pair changes: 0 previous results not found, 3 current results not found ✅ All tests passed |
georgesittas
approved these changes
Jul 24, 2026
Comment on lines
+897
to
+898
| if any(isinstance(e, exp.Is) and e.args.get("negate") for e in (left, right)): | ||
| return None |
Collaborator
There was a problem hiding this comment.
To provide some extra context: even if we let Is with negate set to True fall through to the rest of the logic, it would effectively result in a no-op, because this arg is only set for NULL operands today and Null doesn't satisfy any of the following branches: is_number is false, is_string is false, and extract_date() returns None; so the function returns None without modifying the subtree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7909