-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
4 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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