-
Notifications
You must be signed in to change notification settings - Fork 670
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand target entries with merged array/jsonb subscripting ops into m…
…ultiple ones When re-writing query tree, postgres combines multiple subscripting operators referencing to the same attribute into a single `TargetEntry` by linking `SubscriptingRef` objects to each other via their `refexpr` fields. (See `rewriteTargetListIU` & `process_matched_tle` functions.) However, ruleutils function `get_update_query_targetlist_def` doesn't know how to properly deparse such a `TargetEntry`. As a result, we were only taking the last set-by-subscript operation into account when generating the shard query for such an `UPDATE` command. In postgres, this doesn't cause any problems (e.g.: when generating definition of a rule based object) since the query-rewrite transformations aren't performed on the query tree that `get_update_query_targetlist_def` is expected to process. For this reason; with this commit, before processing the target entry list in our ruleutils based deparser, we first expand such target entries into multiple ones. To detect such `SubscriptingRef` objects, we also need to investigate `FieldStore` and `CoerceToDomain` objects as postgres functions processing `SubscriptingRef` objects do --although they do so for different purposes. However, given that Citus already doesn't allow `INSERT/UPDATE` via `FieldStore`, we only do that for `CoerceToDomain` objects.
- Loading branch information
1 parent
1e3c8e3
commit dc29396
Showing
17 changed files
with
521 additions
and
11 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
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
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
Oops, something went wrong.