{"action":"created","issue":{"url":"https://api.github.com/repos/citusdata/citus/issues/741","repository_url":"https://api.github.com/repos/citusdata/citus","labels_url":"https://api.github.com/repos/citusdata/citus/issues/741/labels{/name}","comments_url":"https://api.github.com/repos/citusdata/citus/issues/741/comments","events_url":"https://api.github.com/repos/citusdata/citus/issues/741/events","html_url":"https://github.com/citusdata/citus/pull/741","id":171246807,"number":741,"title":"For Review:  Fix 581 and 582","user":{"login":"eeeebbbbrrrr","id":5117238,"avatar_url":"https://avatars.githubusercontent.com/u/5117238?v=3","gravatar_id":"","url":"https://api.github.com/users/eeeebbbbrrrr","html_url":"https://github.com/eeeebbbbrrrr","followers_url":"https://api.github.com/users/eeeebbbbrrrr/followers","following_url":"https://api.github.com/users/eeeebbbbrrrr/following{/other_user}","gists_url":"https://api.github.com/users/eeeebbbbrrrr/gists{/gist_id}","starred_url":"https://api.github.com/users/eeeebbbbrrrr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eeeebbbbrrrr/subscriptions","organizations_url":"https://api.github.com/users/eeeebbbbrrrr/orgs","repos_url":"https://api.github.com/users/eeeebbbbrrrr/repos","events_url":"https://api.github.com/users/eeeebbbbrrrr/events{/privacy}","received_events_url":"https://api.github.com/users/eeeebbbbrrrr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/citusdata/citus/labels/CLA%20Signed","name":"CLA Signed","color":"54C55D"}],"state":"open","locked":false,"assignee":{"login":"jasonmp85","id":50673,"avatar_url":"https://avatars.githubusercontent.com/u/50673?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonmp85","html_url":"https://github.com/jasonmp85","followers_url":"https://api.github.com/users/jasonmp85/followers","following_url":"https://api.github.com/users/jasonmp85/following{/other_user}","gists_url":"https://api.github.com/users/jasonmp85/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonmp85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonmp85/subscriptions","organizations_url":"https://api.github.com/users/jasonmp85/orgs","repos_url":"https://api.github.com/users/jasonmp85/repos","events_url":"https://api.github.com/users/jasonmp85/events{/privacy}","received_events_url":"https://api.github.com/users/jasonmp85/received_events","type":"User","site_admin":false},"assignees":[{"login":"jasonmp85","id":50673,"avatar_url":"https://avatars.githubusercontent.com/u/50673?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonmp85","html_url":"https://github.com/jasonmp85","followers_url":"https://api.github.com/users/jasonmp85/followers","following_url":"https://api.github.com/users/jasonmp85/following{/other_user}","gists_url":"https://api.github.com/users/jasonmp85/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonmp85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonmp85/subscriptions","organizations_url":"https://api.github.com/users/jasonmp85/orgs","repos_url":"https://api.github.com/users/jasonmp85/repos","events_url":"https://api.github.com/users/jasonmp85/events{/privacy}","received_events_url":"https://api.github.com/users/jasonmp85/received_events","type":"User","site_admin":false}],"milestone":null,"comments":36,"created_at":"2016-08-15T19:48:52Z","updated_at":"2016-09-02T16:59:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/citusdata/citus/pulls/741","html_url":"https://github.com/citusdata/citus/pull/741","diff_url":"https://github.com/citusdata/citus/pull/741.diff","patch_url":"https://github.com/citusdata/citus/pull/741.patch"},"body":"This Pull Request implements basic support for both #581 and #582.  I realize we had previously discussed making this two separate Pull Requests, but the bulk of the work for this is shared in a new function in `relay_event_utility.c#AppendShardIdToRelationReferences`, and it just didn't make sense to me to try and split that into two separate functions.\r\n\r\nThis gets very minimal integration between @ZomboDB and Citus working by allowing these two types of statements to work correctly:\r\n\r\n```sql\r\nCREATE INDEX idxchanges ON wikipedia_changes \r\n   USING zombodb (zdb('wikipedia_changes'::regclass, ctid), zdb(wikipedia_changes.*)) \r\n   WITH (url='http://localhost:9200/')\r\n```\r\n\r\nand\r\n\r\n```sql\r\nSELECT * FROM wikipedia_changes WHERE zdb('wikipedia_changes', ctid) ==> 'mario';\r\n```\r\n\r\nThe latter successfully distributes the query to each worker node/shard, and the resulting queries properly plan an Index Scan.\r\n\r\nI've limited the scope of rewriting `::regclass` references to only those that are arguments to function calls and further, to only those that are quals of the query.  No targetlist, orderby, groupby, etc, support because @ZomboDB doesn't need it.\r\n\r\nIt's not exactly clear to me how we should test this in Citus' regression test suite, so I'm open to thoughts there.\r\n\r\nPlease let me know what else I should do -- I'm happy to do it.\r\n\r\n# Review Tasks\r\n  - [x] Rename `struct` to `ColumnRefWalkerState`\r\n  - [x] Change walker name to `UpdateWholeRowColumnReferencesWalker`\r\n  - [x] Document walker with function comment\r\n  - [x] Add `bool walkIsComplete` to walker, change to `if`/`else if`/`else` blocks with `return walkIsComplete` outside all blocks at end\r\n  - [x] Change extension logic to extend the penultimate `field` string element iff the last element is `A_Star`\r\n  - [x] Remove `AppendShardIdToRowReferences`; inline its logic\r\n  - [x] Add an `else if` case inside of `get_variable` to detect Citus RTE nodes (using `GetRangeTblKind`) rather than modifying the `else` statement\r\n  - [x] Add tests\r\n    - [x] In `multi_index_statements.sql`, create an expression index (in the CREATE INDEX section) that uses `record_ne(rel.*, NULL)` on a distributed table. This is a useless index, but will test your deparse logic and uses a record-taking `IMMUTABLE` function without us having to make one at test-time\r\n    - [x] Toward the end of `multi_simple_queries.sql`, add a `SELECT` query that uses `tableoid` in the `WHERE` clause. Maybe something silly like `tableoid IS NOT NULL`. Maybe include it in the targetlist too.\r\n  - [x] Ensure your branch is up-to-date with the lates changes in `master` (`git rebase`)\r\n"},"comment":{"url":"https://api.github.com/repos/citusdata/citus/issues/comments/244430888","html_url":"https://github.com/citusdata/citus/pull/741#issuecomment-244430888","issue_url":"https://api.github.com/repos/citusdata/citus/issues/741","id":244430888,"user":{"login":"eeeebbbbrrrr","id":5117238,"avatar_url":"https://avatars.githubusercontent.com/u/5117238?v=3","gravatar_id":"","url":"https://api.github.com/users/eeeebbbbrrrr","html_url":"https://github.com/eeeebbbbrrrr","followers_url":"https://api.github.com/users/eeeebbbbrrrr/followers","following_url":"https://api.github.com/users/eeeebbbbrrrr/following{/other_user}","gists_url":"https://api.github.com/users/eeeebbbbrrrr/gists{/gist_id}","starred_url":"https://api.github.com/users/eeeebbbbrrrr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eeeebbbbrrrr/subscriptions","organizations_url":"https://api.github.com/users/eeeebbbbrrrr/orgs","repos_url":"https://api.github.com/users/eeeebbbbrrrr/repos","events_url":"https://api.github.com/users/eeeebbbbrrrr/events{/privacy}","received_events_url":"https://api.github.com/users/eeeebbbbrrrr/received_events","type":"User","site_admin":false},"created_at":"2016-09-02T16:59:05Z","updated_at":"2016-09-02T16:59:05Z","body":"Okay, just pushed all your suggestions.  Thanks again for the review and notes.  Learning a bit about how y'all do things has been fun!"}}
{"actor":{"display_login":"eeeebbbbrrrr"}}