{"id":21643699,"url":"https://github.com/akshayxml/hash-join-and-sort-merge-join","last_synced_at":"2026-05-11T16:35:38.393Z","repository":{"id":69055106,"uuid":"361083324","full_name":"akshayxml/Hash-Join-and-Sort-Merge-Join","owner":"akshayxml","description":"Implementation of database relation join operators - Hash Join and Sort Merge Join","archived":false,"fork":false,"pushed_at":"2021-04-24T06:14:09.000Z","size":93,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T08:49:15.715Z","etag":null,"topics":["database","hash-join","hash-join-algorithm","join-tables","relational-databases","sort-merge-join"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akshayxml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-04-24T05:59:56.000Z","updated_at":"2021-04-24T06:14:11.000Z","dependencies_parsed_at":"2024-04-24T15:04:19.914Z","dependency_job_id":null,"html_url":"https://github.com/akshayxml/Hash-Join-and-Sort-Merge-Join","commit_stats":null,"previous_names":["akshayxml/hash-join-and-sort-merge-join"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akshayxml/Hash-Join-and-Sort-Merge-Join","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshayxml%2FHash-Join-and-Sort-Merge-Join","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshayxml%2FHash-Join-and-Sort-Merge-Join/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshayxml%2FHash-Join-and-Sort-Merge-Join/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshayxml%2FHash-Join-and-Sort-Merge-Join/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akshayxml","download_url":"https://codeload.github.com/akshayxml/Hash-Join-and-Sort-Merge-Join/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshayxml%2FHash-Join-and-Sort-Merge-Join/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32903525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","hash-join","hash-join-algorithm","join-tables","relational-databases","sort-merge-join"],"created_at":"2024-11-25T05:35:34.848Z","updated_at":"2026-05-11T16:35:38.373Z","avatar_url":"https://github.com/akshayxml.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hash-Join-and-Sort-Merge-Join\nImplementation of database relation join operators - Hash Join and Sort Merge Join\n\n## Implementation\nGiven M memory blocks and two large relations R(X,Y)and S(Y,Z). There are iterators for the following operations.\n- SortMerge Join\n  - open()- Create sorted sublists for R and S, each of size M blocks.\n  - getnext()- Use 1 block for each sublist and get minimum of R \u0026 S. Joins this minimum Y value with the other table and return. Checks for B(R)+B(S)\u003cM^2\n  - close()- close all files\n- Hash Join\n  - open()- Create M1 hashed sublists for R and S\n  - getnext()- For each Ri and Si thus created, loads the smaller of the two in the main memory and creates a search structure over it. Then recursively loads the other file in the remaining blocks and for each record of this file, search corresponding records (with same join attribute value) from the other file. Checks for min(B(R),B(S))\u003cM^2\n  - close()- close all files\n  \nJoin condition is (R.Y==S.Y). One block is used for output which is filled by row returned by getnext() and when it gets full, appends it to the output file and continues.\n\n## Usage\n\n### Input Parameters\n1. Path to file containing relation R\n2. Path to file containing relation S\n3. Type of join sort/hash\n4. Number of blocks\n\n### Attribute Type\nNote that all attributes, X, Y and Z must be strings and Y may be a non-key attribute.\n\n### Block Size\nAssumed that each block can store 100 tuples for both relations, R and S.\n\n### Input format\nThe bash script named `run.sh` is used to compile and run your code. The command for execution would be of the form:\n`run.sh \u003cpath of R file\u003e \u003cpath of S file\u003e\u003csort/hash\u003e \u003cM\u003e`\n\n### Output file\n`\u003cR filename\u003e_\u003cS filename\u003e_join.txt` (Kindly note it contains only R \u0026 S base filename and not their path).\n \nUse the generator folder to generate sample inputs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshayxml%2Fhash-join-and-sort-merge-join","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakshayxml%2Fhash-join-and-sort-merge-join","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshayxml%2Fhash-join-and-sort-merge-join/lists"}