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

Fix to #18555 - Query: when rewriting null semantics for comparisons with functions use function specific metadata to get better SQL #19607

Merged
merged 1 commit into from
Jan 22, 2020

Commits on Jan 22, 2020

  1. Fix to #18555 - Query: when rewriting null semantics for comparisons …

    …with functions use function specific metadata to get better SQL
    
    When we need to compute whether a function is null, we often can just evaluate nullability of it's constituents (instance & arguments), e.g.
    SUBSTRING(stringProperty, 0, 5) == null -> stringProperty == null
    
    Adding metadata to SqlFunctionExpression:
    nullResultAllowed - indicates whether function can ever be null,
    instancePropagatesNullability - indicates whether function instance can be used to calculate nullability of the entire function
    argumentsPropagateNullability - array indicating which (if any) function arguments can be used to calculate nullability of the entire function
    
    If "canBeNull" is set to false we can instantly compute IsNull/IsNotNull of that function.
    Otherwise, we look at values of instancePropagatesNullability and argumentsPropagateNullability - if any of them are set to true, we use corresponding argument(s) to compute function nullability.
    If all of them are set to false we must fallback to the old method and evaluate nullability of the entire function.
    
    Resolves #18555
    maumar committed Jan 22, 2020
    Configuration menu
    Copy the full SHA
    d75a0e5 View commit details
    Browse the repository at this point in the history