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

Handle single sharded keyspaces for analysis #16068

Commits on Jun 5, 2024

  1. Handle single sharded keyspaces for analysis

    This fixes the problem where we would throw an error for a query on a
    single unsharded keyspace, even though the limitation only exists for
    sharded queries.
    
    The issue here was that the previous `singleUnshardedKeyspace` field was
    really the field indicating if we could short circuit analysis.
    `schemadiff` doesn't want to short cut full analysis though, since it
    does want to know table & column dependencies etc. which would not be
    computed if analysis can be shortcutted.
    
    Since the `singleUnshardedKeyspace` field was overloaded and really was
    "can we shortcut" (either because of being in a single sharded keyspace
    or because of non-strict analysis being requested), we couldn't use that
    field as a fix to guard the error thrown.
    
    Instead, we now have a proper explicit field `canShortcut` that we use
    to handle existing shortcut logic.
    
    `singleUnshardedKeyspace` still exists, but now means what it actually
    implies, which is if this query runs against a single unsharded
    keyspace, irrespective of whether we can shortcut or not and is
    correctly set when doing full analysis.
    
    With those changes, we can use `singleUnshardedKeyspace` to guard the
    error throw for unsupported sharded queries and `schemadiff` works
    properly as well.
    
    Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
    dbussink committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    fc286e9 View commit details
    Browse the repository at this point in the history