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

Schrödinger's Cat #22123

Merged
merged 2 commits into from
Aug 19, 2020
Merged

Schrödinger's Cat #22123

merged 2 commits into from
Aug 19, 2020

Conversation

smitpatel
Copy link
Member

Query: New set of conditions to materialize optional dependents

Let A be the set of properties which are not sharing column with any principal.
B be the subset of A where property is required.
C be subset of A where property is optional. (hence A = B + C)

The necessary condition for materialization without anything else be C1 - all required properties (excluding PK) must have a value (with or without sharing).

  • If A is empty, then C1 will be sufficient condition as it will be required dependent.
  • If B is non-empty, then C1 will cover those properties and be sufficient condition.
  • If B is empty and then C is non-empty, then materialize if there is at least 1 non-null value in C along with C1 being true.
  • Otherwise null.

If there are no required properties other than PK (essentially C1 does not exist). B is by definition empty.

  • If A is empty then always materialize.
  • If A is non-empty implies C is non-empty, then materialize if there is at least 1 non-null value in C.

Resolves #22054

Let A be the set of properties which are not sharing column with any principal.
B be the subset of A where property is required.
C be subset of A where property is optional. (hence A = B + C)

The necessary condition for materialization without anything else be C1 - all required properties (excluding PK) must have a value (with or without sharing).
- If A is empty, then C1 will be sufficient condition as it will be required dependent.
- If B is non-empty, then C1 will cover those properties and be sufficient condition.
- If B is empty and then C is non-empty, then materialize if there is at least 1 non-null value in C along with C1 being true.
- Otherwise null.

If there are no required properties other than PK (essentially C1 does not exist). B is by definition empty.
- If A is empty then always materialize.
- If A is non-empty implies C is non-empty, then materialize if there is at least 1 non-null value in C.

Resolves #22054
@smitpatel smitpatel requested a review from a team August 18, 2020 21:15
Co-authored-by: Andriy Svyryd <AndriySvyryd@users.noreply.github.com>
@smitpatel smitpatel merged commit cb004a3 into release/5.0 Aug 19, 2020
@smitpatel smitpatel deleted the smit/requiredoptional branch August 19, 2020 07:22
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

Successfully merging this pull request may close these issues.

Optional dependent is not null when sharing a required property
2 participants