{"action":"created","comment":{"url":"https://api.github.com/repos/jordanlewis/exectoy/pulls/comments/226137909","pull_request_review_id":165762044,"id":226137909,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNjEzNzkwOQ==","diff_hunk":"@@ -0,0 +1,393 @@\n+package exectoy\n+\n+// todo(changangela) hash table should be able to rehash or determine bucket size dynamically\n+const hashTableBucketSize = 1 << 16\n+\n+type hashTableInt struct {\n+\tfirst []int\n+\tnext []int\n+\n+\tkeys intColumn\n+\tvalues []intColumn\n+\n+\tnOutCols int\n+\tcount int\n+\tbucketSize int\n+\n+\t// allocated represents the reserved number of keys that the hashTableInt\n+\t// can store in its current state.\n+\tallocated int\n+}\n+\n+func makeHashTableInt(bucketSize int, nOutCols int) *hashTableInt {\n+\tvalues := make([]intColumn, nOutCols)\n+\tfor i := 0; i < nOutCols; i++ {\n+\t\tvalues[i] = make(intColumn, 1)\n+\t}\n+\n+\thashTable := &hashTableInt{\n+\t\tfirst: make([]int, bucketSize),\n+\t\tnext: make([]int, 1),\n+\t\tkeys: make([]int, 1),\n+\t\tvalues: values,\n+\t\tnOutCols: nOutCols,\n+\t\tbucketSize: bucketSize,\n+\t\tallocated: 1,\n+\t}\n+\n+\treturn hashTable\n+}\n+\n+func (hashTable *hashTableInt) hashInt(key int) int {\n+\t// todo(changangela) replace with a better hash function or use a library\n+\treturn key % hashTable.bucketSize\n+}\n+\n+func (hashTable *hashTableInt) grow(amount int) {\n+\thashTable.next = append(hashTable.next, make([]int, amount)...)\n+\thashTable.keys = append(hashTable.keys, make(intColumn, amount)...)\n+\n+\tfor i := 0; i < hashTable.nOutCols; i++ {\n+\t\thashTable.values[i] = append(hashTable.values[i], make(intColumn, amount)...)\n+\t}\n+\thashTable.allocated += amount\n+}\n+\n+func (hashTable *hashTableInt) insert(hashKey int, key int) (id int) {","path":"hashjoin.go","position":56,"original_position":56,"commit_id":"498d9d1b249ed7f00f94c09ae95fd6bc757ccc4d","original_commit_id":"498d9d1b249ed7f00f94c09ae95fd6bc757ccc4d","user":{"login":"jordanlewis","id":43821,"node_id":"MDQ6VXNlcjQzODIx","avatar_url":"https://avatars1.githubusercontent.com/u/43821?v=4","gravatar_id":"","url":"https://api.github.com/users/jordanlewis","html_url":"https://github.com/jordanlewis","followers_url":"https://api.github.com/users/jordanlewis/followers","following_url":"https://api.github.com/users/jordanlewis/following{/other_user}","gists_url":"https://api.github.com/users/jordanlewis/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanlewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanlewis/subscriptions","organizations_url":"https://api.github.com/users/jordanlewis/orgs","repos_url":"https://api.github.com/users/jordanlewis/repos","events_url":"https://api.github.com/users/jordanlewis/events{/privacy}","received_events_url":"https://api.github.com/users/jordanlewis/received_events","type":"User","site_admin":false},"body":"This seems to be unused by the group implementation - why? Also, please add a comment on what it does.","created_at":"2018-10-18T00:36:36Z","updated_at":"2018-10-18T00:39:55Z","html_url":"https://github.com/jordanlewis/exectoy/pull/1#discussion_r226137909","pull_request_url":"https://api.github.com/repos/jordanlewis/exectoy/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/jordanlewis/exectoy/pulls/comments/226137909"},"html":{"href":"https://github.com/jordanlewis/exectoy/pull/1#discussion_r226137909"},"pull_request":{"href":"https://api.github.com/repos/jordanlewis/exectoy/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/jordanlewis/exectoy/pulls/1","id":223040865,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzMDQwODY1","html_url":"https://github.com/jordanlewis/exectoy/pull/1","diff_url":"https://github.com/jordanlewis/exectoy/pull/1.diff","patch_url":"https://github.com/jordanlewis/exectoy/pull/1.patch","issue_url":"https://api.github.com/repos/jordanlewis/exectoy/issues/1","number":1,"state":"open","locked":false,"title":"exec: hash joiner","user":{"login":"changangela","id":19381001,"node_id":"MDQ6VXNlcjE5MzgxMDAx","avatar_url":"https://avatars3.githubusercontent.com/u/19381001?v=4","gravatar_id":"","url":"https://api.github.com/users/changangela","html_url":"https://github.com/changangela","followers_url":"https://api.github.com/users/changangela/followers","following_url":"https://api.github.com/users/changangela/following{/other_user}","gists_url":"https://api.github.com/users/changangela/gists{/gist_id}","starred_url":"https://api.github.com/users/changangela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/changangela/subscriptions","organizations_url":"https://api.github.com/users/changangela/orgs","repos_url":"https://api.github.com/users/changangela/repos","events_url":"https://api.github.com/users/changangela/events{/privacy}","received_events_url":"https://api.github.com/users/changangela/received_events","type":"User","site_admin":false},"body":"Toy hash joiner for joining on int-int columns where we build with the left relation (requires unique key on join column) and probe on right relation.\r\n\r\nResults of `go test -bench=BenchmarkHashJoin`:\r\n\r\nUsing the `hashJoinBuilder`:\r\n```\r\nBenchmarkHashJoin/name=random_source/rows=0-8  \t   30000\t     53737 ns/op\r\nBenchmarkHashJoin/name=random_source/rows=4096-8         \t    5000\t    325867 ns/op\t 804.45 MB/s\r\nBenchmarkHashJoin/name=random_source/rows=16384-8        \t    1000\t   1405501 ns/op\t 746.05 MB/s\r\nBenchmarkHashJoin/name=random_source/rows=262144-8       \t     100\t  22095146 ns/op\t 759.32 MB/s\r\nBenchmarkHashJoin/name=random_source/rows=4194304-8      \t       3\t 360555462 ns/op\t 744.51 MB/s\r\nBenchmarkHashJoin/name=random_source/rows=67108864-8     \t       1\t10443118639 ns/op\t 411.27 MB/s\r\nBenchmarkHashJoin/name=uniformly_distinct_source/rows=0-8         \t   30000\t     54243 ns/op\r\nBenchmarkHashJoin/name=uniformly_distinct_source/rows=4096-8      \t    5000\t    287274 ns/op\t 912.52 MB/s\r\nBenchmarkHashJoin/name=uniformly_distinct_source/rows=16384-8     \t    1000\t   1286287 ns/op\t 815.20 MB/s\r\nBenchmarkHashJoin/name=uniformly_distinct_source/rows=262144-8    \t     100\t  21394291 ns/op\t 784.19 MB/s\r\nBenchmarkHashJoin/name=uniformly_distinct_source/rows=4194304-8   \t       3\t 351375238 ns/op\t 763.96 MB/s\r\nBenchmarkHashJoin/name=uniformly_distinct_source/rows=67108864-8  \t       1\t5903473387 ns/op\t 727.53 MB/s\r\n```\r\n\r\nUsing the `hashJoinGroupBuilder`:\r\n```\r\nBenchmarkHashJoin/name=random_source/rows=0-8  \t   30000\t     53264 ns/op\r\nBenchmarkHashJoin/name=random_source/rows=4096-8         \t    5000\t    309597 ns/op\t 846.73 MB/s\r\nBenchmarkHashJoin/name=random_source/rows=16384-8        \t    1000\t   1246564 ns/op\t 841.17 MB/s\r\nBenchmarkHashJoin/name=random_source/rows=262144-8       \t     100\t  19342936 ns/op\t 867.36 MB/s\r\nBenchmarkHashJoin/name=random_source/rows=4194304-8      \t       5\t 317785006 ns/op\t 844.71 MB/s\r\nBenchmarkHashJoin/name=random_source/rows=67108864-8     \t       1\t8037002408 ns/op\t 534.40 MB/s\r\nBenchmarkHashJoin/name=uniformly_distinct_source/rows=0-8         \t   30000\t     56612 ns/op\r\nBenchmarkHashJoin/name=uniformly_distinct_source/rows=4096-8      \t    5000\t    257718 ns/op\t1017.17 MB/s\r\nBenchmarkHashJoin/name=uniformly_distinct_source/rows=16384-8     \t    2000\t   1098873 ns/op\t 954.23 MB/s\r\nBenchmarkHashJoin/name=uniformly_distinct_source/rows=262144-8    \t     100\t  18678830 ns/op\t 898.19 MB/s\r\nBenchmarkHashJoin/name=uniformly_distinct_source/rows=4194304-8   \t       5\t 310974801 ns/op\t 863.21 MB/s\r\nBenchmarkHashJoin/name=uniformly_distinct_source/rows=67108864-8  \t       1\t5158706255 ns/op\t 832.57 MB/s\r\n```\r\n","created_at":"2018-10-15T20:58:00Z","updated_at":"2018-10-18T00:39:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ca3fd9edae38e4dc6adcf2dbdfebd9a1423fbe3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jordanlewis/exectoy/pulls/1/commits","review_comments_url":"https://api.github.com/repos/jordanlewis/exectoy/pulls/1/comments","review_comment_url":"https://api.github.com/repos/jordanlewis/exectoy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jordanlewis/exectoy/issues/1/comments","statuses_url":"https://api.github.com/repos/jordanlewis/exectoy/statuses/498d9d1b249ed7f00f94c09ae95fd6bc757ccc4d","head":{"label":"changangela:hash-joiner","ref":"hash-joiner","sha":"498d9d1b249ed7f00f94c09ae95fd6bc757ccc4d","user":{"login":"changangela","id":19381001,"node_id":"MDQ6VXNlcjE5MzgxMDAx","avatar_url":"https://avatars3.githubusercontent.com/u/19381001?v=4","gravatar_id":"","url":"https://api.github.com/users/changangela","html_url":"https://github.com/changangela","followers_url":"https://api.github.com/users/changangela/followers","following_url":"https://api.github.com/users/changangela/following{/other_user}","gists_url":"https://api.github.com/users/changangela/gists{/gist_id}","starred_url":"https://api.github.com/users/changangela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/changangela/subscriptions","organizations_url":"https://api.github.com/users/changangela/orgs","repos_url":"https://api.github.com/users/changangela/repos","events_url":"https://api.github.com/users/changangela/events{/privacy}","received_events_url":"https://api.github.com/users/changangela/received_events","type":"User","site_admin":false},"repo":{"id":152658313,"node_id":"MDEwOlJlcG9zaXRvcnkxNTI2NTgzMTM=","name":"exectoy","full_name":"changangela/exectoy","private":false,"owner":{"login":"changangela","id":19381001,"node_id":"MDQ6VXNlcjE5MzgxMDAx","avatar_url":"https://avatars3.githubusercontent.com/u/19381001?v=4","gravatar_id":"","url":"https://api.github.com/users/changangela","html_url":"https://github.com/changangela","followers_url":"https://api.github.com/users/changangela/followers","following_url":"https://api.github.com/users/changangela/following{/other_user}","gists_url":"https://api.github.com/users/changangela/gists{/gist_id}","starred_url":"https://api.github.com/users/changangela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/changangela/subscriptions","organizations_url":"https://api.github.com/users/changangela/orgs","repos_url":"https://api.github.com/users/changangela/repos","events_url":"https://api.github.com/users/changangela/events{/privacy}","received_events_url":"https://api.github.com/users/changangela/received_events","type":"User","site_admin":false},"html_url":"https://github.com/changangela/exectoy","description":null,"fork":true,"url":"https://api.github.com/repos/changangela/exectoy","forks_url":"https://api.github.com/repos/changangela/exectoy/forks","keys_url":"https://api.github.com/repos/changangela/exectoy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/changangela/exectoy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/changangela/exectoy/teams","hooks_url":"https://api.github.com/repos/changangela/exectoy/hooks","issue_events_url":"https://api.github.com/repos/changangela/exectoy/issues/events{/number}","events_url":"https://api.github.com/repos/changangela/exectoy/events","assignees_url":"https://api.github.com/repos/changangela/exectoy/assignees{/user}","branches_url":"https://api.github.com/repos/changangela/exectoy/branches{/branch}","tags_url":"https://api.github.com/repos/changangela/exectoy/tags","blobs_url":"https://api.github.com/repos/changangela/exectoy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/changangela/exectoy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/changangela/exectoy/git/refs{/sha}","trees_url":"https://api.github.com/repos/changangela/exectoy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/changangela/exectoy/statuses/{sha}","languages_url":"https://api.github.com/repos/changangela/exectoy/languages","stargazers_url":"https://api.github.com/repos/changangela/exectoy/stargazers","contributors_url":"https://api.github.com/repos/changangela/exectoy/contributors","subscribers_url":"https://api.github.com/repos/changangela/exectoy/subscribers","subscription_url":"https://api.github.com/repos/changangela/exectoy/subscription","commits_url":"https://api.github.com/repos/changangela/exectoy/commits{/sha}","git_commits_url":"https://api.github.com/repos/changangela/exectoy/git/commits{/sha}","comments_url":"https://api.github.com/repos/changangela/exectoy/comments{/number}","issue_comment_url":"https://api.github.com/repos/changangela/exectoy/issues/comments{/number}","contents_url":"https://api.github.com/repos/changangela/exectoy/contents/{+path}","compare_url":"https://api.github.com/repos/changangela/exectoy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/changangela/exectoy/merges","archive_url":"https://api.github.com/repos/changangela/exectoy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/changangela/exectoy/downloads","issues_url":"https://api.github.com/repos/changangela/exectoy/issues{/number}","pulls_url":"https://api.github.com/repos/changangela/exectoy/pulls{/number}","milestones_url":"https://api.github.com/repos/changangela/exectoy/milestones{/number}","notifications_url":"https://api.github.com/repos/changangela/exectoy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/changangela/exectoy/labels{/name}","releases_url":"https://api.github.com/repos/changangela/exectoy/releases{/id}","deployments_url":"https://api.github.com/repos/changangela/exectoy/deployments","created_at":"2018-10-11T21:30:09Z","updated_at":"2018-10-11T21:30:11Z","pushed_at":"2018-10-17T19:03:44Z","git_url":"git://github.com/changangela/exectoy.git","ssh_url":"git@github.com:changangela/exectoy.git","clone_url":"https://github.com/changangela/exectoy.git","svn_url":"https://github.com/changangela/exectoy","homepage":null,"size":115,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jordanlewis:master","ref":"master","sha":"ebb6dd698fc8548304312376b4dd930c1bcd2c4e","user":{"login":"jordanlewis","id":43821,"node_id":"MDQ6VXNlcjQzODIx","avatar_url":"https://avatars1.githubusercontent.com/u/43821?v=4","gravatar_id":"","url":"https://api.github.com/users/jordanlewis","html_url":"https://github.com/jordanlewis","followers_url":"https://api.github.com/users/jordanlewis/followers","following_url":"https://api.github.com/users/jordanlewis/following{/other_user}","gists_url":"https://api.github.com/users/jordanlewis/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanlewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanlewis/subscriptions","organizations_url":"https://api.github.com/users/jordanlewis/orgs","repos_url":"https://api.github.com/users/jordanlewis/repos","events_url":"https://api.github.com/users/jordanlewis/events{/privacy}","received_events_url":"https://api.github.com/users/jordanlewis/received_events","type":"User","site_admin":false},"repo":{"id":130417352,"node_id":"MDEwOlJlcG9zaXRvcnkxMzA0MTczNTI=","name":"exectoy","full_name":"jordanlewis/exectoy","private":false,"owner":{"login":"jordanlewis","id":43821,"node_id":"MDQ6VXNlcjQzODIx","avatar_url":"https://avatars1.githubusercontent.com/u/43821?v=4","gravatar_id":"","url":"https://api.github.com/users/jordanlewis","html_url":"https://github.com/jordanlewis","followers_url":"https://api.github.com/users/jordanlewis/followers","following_url":"https://api.github.com/users/jordanlewis/following{/other_user}","gists_url":"https://api.github.com/users/jordanlewis/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanlewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanlewis/subscriptions","organizations_url":"https://api.github.com/users/jordanlewis/orgs","repos_url":"https://api.github.com/users/jordanlewis/repos","events_url":"https://api.github.com/users/jordanlewis/events{/privacy}","received_events_url":"https://api.github.com/users/jordanlewis/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jordanlewis/exectoy","description":null,"fork":false,"url":"https://api.github.com/repos/jordanlewis/exectoy","forks_url":"https://api.github.com/repos/jordanlewis/exectoy/forks","keys_url":"https://api.github.com/repos/jordanlewis/exectoy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jordanlewis/exectoy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jordanlewis/exectoy/teams","hooks_url":"https://api.github.com/repos/jordanlewis/exectoy/hooks","issue_events_url":"https://api.github.com/repos/jordanlewis/exectoy/issues/events{/number}","events_url":"https://api.github.com/repos/jordanlewis/exectoy/events","assignees_url":"https://api.github.com/repos/jordanlewis/exectoy/assignees{/user}","branches_url":"https://api.github.com/repos/jordanlewis/exectoy/branches{/branch}","tags_url":"https://api.github.com/repos/jordanlewis/exectoy/tags","blobs_url":"https://api.github.com/repos/jordanlewis/exectoy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jordanlewis/exectoy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jordanlewis/exectoy/git/refs{/sha}","trees_url":"https://api.github.com/repos/jordanlewis/exectoy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jordanlewis/exectoy/statuses/{sha}","languages_url":"https://api.github.com/repos/jordanlewis/exectoy/languages","stargazers_url":"https://api.github.com/repos/jordanlewis/exectoy/stargazers","contributors_url":"https://api.github.com/repos/jordanlewis/exectoy/contributors","subscribers_url":"https://api.github.com/repos/jordanlewis/exectoy/subscribers","subscription_url":"https://api.github.com/repos/jordanlewis/exectoy/subscription","commits_url":"https://api.github.com/repos/jordanlewis/exectoy/commits{/sha}","git_commits_url":"https://api.github.com/repos/jordanlewis/exectoy/git/commits{/sha}","comments_url":"https://api.github.com/repos/jordanlewis/exectoy/comments{/number}","issue_comment_url":"https://api.github.com/repos/jordanlewis/exectoy/issues/comments{/number}","contents_url":"https://api.github.com/repos/jordanlewis/exectoy/contents/{+path}","compare_url":"https://api.github.com/repos/jordanlewis/exectoy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jordanlewis/exectoy/merges","archive_url":"https://api.github.com/repos/jordanlewis/exectoy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jordanlewis/exectoy/downloads","issues_url":"https://api.github.com/repos/jordanlewis/exectoy/issues{/number}","pulls_url":"https://api.github.com/repos/jordanlewis/exectoy/pulls{/number}","milestones_url":"https://api.github.com/repos/jordanlewis/exectoy/milestones{/number}","notifications_url":"https://api.github.com/repos/jordanlewis/exectoy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jordanlewis/exectoy/labels{/name}","releases_url":"https://api.github.com/repos/jordanlewis/exectoy/releases{/id}","deployments_url":"https://api.github.com/repos/jordanlewis/exectoy/deployments","created_at":"2018-04-20T21:55:07Z","updated_at":"2018-05-09T01:06:09Z","pushed_at":"2018-10-17T19:03:45Z","git_url":"git://github.com/jordanlewis/exectoy.git","ssh_url":"git@github.com:jordanlewis/exectoy.git","clone_url":"https://github.com/jordanlewis/exectoy.git","svn_url":"https://github.com/jordanlewis/exectoy","homepage":null,"size":131,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jordanlewis/exectoy/pulls/1"},"html":{"href":"https://github.com/jordanlewis/exectoy/pull/1"},"issue":{"href":"https://api.github.com/repos/jordanlewis/exectoy/issues/1"},"comments":{"href":"https://api.github.com/repos/jordanlewis/exectoy/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/jordanlewis/exectoy/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/jordanlewis/exectoy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jordanlewis/exectoy/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/jordanlewis/exectoy/statuses/498d9d1b249ed7f00f94c09ae95fd6bc757ccc4d"}},"author_association":"NONE"}}
{"actor":{"display_login":"jordanlewis"}}