Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incorporate non-null information, and prevent its deletion (#28566)
Incorporate nullability information into `Equivalences` from `Get::typ` information, and harden the equivalence class minimization to avoid using nullability information from the input types, as this causes its *deletion* from the equivalence classes. ### Motivation The `Equivalences` analysis did not introduce nullability statements when made by `Get` nodes, and it was unfortunately deleting nullability information when performing expression minimization: `expr.reduce(&types)` will now (as of #28018) optimize **away** expressions based on the nullability information in `types`. Independent of whether this is intended behavior generally, we can harden the code here to remove any nullability statements surfaced through the type, in order to prevent their removal when we invoke `expr.reduce`. The outcome is several tests that would experience regressions were we to remove `ColumnKnowledge` no longer experiencing this. ### Tips for reviewer <!-- Leave some tips for your reviewer, like: * The diff is much smaller if viewed with whitespace hidden. * [Some function/module/file] deserves extra attention. * [Some function/module/file] is pure code movement and only needs a skim. Delete this section if no tips. --> ### Checklist - [ ] This PR has adequate test coverage / QA involvement has been duly considered. ([trigger-ci for additional test/nightly runs](https://trigger-ci.dev.materialize.com/)) - [ ] This PR has an associated up-to-date [design doc](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/README.md), is a design doc ([template](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/00000000_template.md)), or is sufficiently small to not require a design. <!-- Reference the design in the description. --> - [ ] If this PR evolves [an existing `$T ⇔ Proto$T` mapping](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/command-and-response-binary-encoding.md) (possibly in a backwards-incompatible way), then it is tagged with a `T-proto` label. - [ ] If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label ([example](MaterializeInc/cloud#5021)). <!-- Ask in #team-cloud on Slack if you need help preparing the cloud PR. --> - [ ] This PR includes the following [user-facing behavior changes](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/guide-changes.md#what-changes-require-a-release-note): - <!-- Add release notes here or explicitly state that there are no user-facing behavior changes. -->
- Loading branch information