{"id":13696046,"url":"https://github.com/Percona-Lab/clickhousedb_fdw","last_synced_at":"2025-05-03T14:30:46.694Z","repository":{"id":44887086,"uuid":"175861145","full_name":"Percona-Lab/clickhousedb_fdw","owner":"Percona-Lab","description":"PostgreSQL's Foreign Data Wrapper For ClickHouse","archived":false,"fork":false,"pushed_at":"2021-01-08T16:40:46.000Z","size":350,"stargazers_count":205,"open_issues_count":23,"forks_count":24,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-31T00:12:33.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Percona-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-15T17:07:37.000Z","updated_at":"2025-03-06T10:43:03.000Z","dependencies_parsed_at":"2022-07-12T18:21:19.694Z","dependency_job_id":null,"html_url":"https://github.com/Percona-Lab/clickhousedb_fdw","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fclickhousedb_fdw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fclickhousedb_fdw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fclickhousedb_fdw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fclickhousedb_fdw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Percona-Lab","download_url":"https://codeload.github.com/Percona-Lab/clickhousedb_fdw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252203145,"owners_count":21710897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-02T18:00:35.860Z","updated_at":"2025-05-03T14:30:46.179Z","avatar_url":"https://github.com/Percona-Lab.png","language":"C","funding_links":[],"categories":["Language bindings"],"sub_categories":["Other sdk/libraries"],"readme":"## What is clickhousedb_fdw? *\nThe clickhousedb_fdw is open-source. It is a Foreign Data Wrapper (FDW) for one of the fastest column store databases; \"Clickhouse\". This FDW allows you to SELECT from, and INSERT into, a ClickHouse database from within a PostgreSQL server. The FDW supports advanced features like aggregate pushdown and joins pushdown. These significantly improve performance by utilizing the remote server’s resources for these resource intensive operations.\n\n\n## Documentation\n1. [Supported PostgreSQL Versions](#supported-postgresql-versions)\n2. [Installation](#installation)\n3. [Setup](#setup) \n4. [User Guide](https://github.com/Percona-Lab/clickhousedb_fdw/blob/master/docs/USER_GUIDE.md)\n6. [Release Notes](https://github.com/Percona-Lab/clickhousedb_fdw/blob/master/docs/RELEASE_NOTES.md)\n7. [License](https://github.com/Percona-Lab/clickhousedb_fdw/blob/master/LICENSE)\n8. [Submitting Bug Reports](#submitting-bug-reports)\n9. [Copyright Notice](#copyright-notice)\n\n## Supported PostgreSQL Versions\nThe ``clickhousedb_fdw`` should work on the latest version of PostgreSQL but is only tested with these PostgreSQL versions:\n\n| Distribution            |  Version       | Supported          |\n| ------------------------|----------------|--------------------|\n| PostgreSQL              | Version \u003c 11   | :x:                |\n| PostgreSQL              | Version 11     | :heavy_check_mark: |\n| PostgreSQL              | Version 12     | :heavy_check_mark: |\n| PostgreSQL              | Version 13     | :heavy_check_mark: |\n| Percona Distribution    | Version \u003c 11   | :x:                |\n| Percona Distribution    | Version 11     | :heavy_check_mark: |\n| Percona Distribution    | Version 12     | :heavy_check_mark: |\n| Percona Distribution    | Version 13     | :heavy_check_mark: |\n\n## Installation\n\n### Installing from source code\n\nYou can download the source code of the latest release of ``clickhousedb_fdw``  from [this GitHub page](https://github.com/Percona-Lab/clickhousedb_fdw/releases) or using git:\n```sh\ngit clone git://github.com/Percona-Lab/clickhousedb_fdw.git\n```\n\nCompile and install the extension\n```sh\ncd clickhousedb_fdw\nmake USE_PGXS=1\nmake USE_PGXS=1 install\n```\n\nCreate the extension using the ``CREATE EXTENSION`` command.\n```sql\nCREATE EXTENSION clickhousedb_fdw;\nCREATE EXTENSION\n```\n\n###### Install using deb / rpm packages.\n```bash\nsudo yum install clickhousedb_fdw\nsudo apt-get install clickhousedb_fdw\n```\n\n```sql\nCREATE SERVER clickhouse_svr\nFOREIGN DATA WRAPPER clickhousedb_fdw \nOPTIONS(dbname 'test_database', driver '/home/vagrant/percona/clickhousedb_fdw/lib/clickhouse-odbc/driver/libclickhouseodbc.so', host '127.0.0.1');\n   \nCREATE USER MAPPING FOR CURRENT_USER SERVER clickhouse_svr;\n\nCREATE FOREIGN TABLE tax_bills_nyc \n    (\n        bbl int8,\n        owner_name text,\n        address text,\n        tax_class text,\n        tax_rate text,\n        emv Float,\n        tbea Float,\n        bav Float,\n        tba text,\n        property_tax text,\n        condonumber text,\n        condo text,\n        insertion_date Time \n    ) SERVER clickhouse_svr;\n\nSELECT bbl,tbea,bav,insertion_date FROM tax_bills_nyc LIMIT 5;\n        bbl     | tbea  |  bav   | insertion_date \n    ------------+-------+--------+----------------\n    4001940057 | 18755 | 145899 | 15:25:42\n    1016830130 |  2216 |  17238 | 15:25:42\n    4012850059 | 69562 | 541125 | 15:25:42\n    1006130061 | 55883 | 434719 | 15:25:42\n    3033540009 | 33100 | 257490 | 15:25:42\n    (5 rows)\n    \nCREATE TABLE tax_bills ( bbl bigint, owner_name text) ENGINE = MergeTree PARTITION BY bbl ORDER BY (bbl)\n    \nINSERT INTO tax_bills SELECT bbl, tbea from tax_bills_nyc LIMIT 100;\n    \nEXPLAIN VERBOSE SELECT bbl,tbea,bav,insertion_date FROM tax_bills_nyc LIMIT 5;\n                                         QUERY PLAN                                         \n    --------------------------------------------------------------------------------------------\n    Limit  (cost=0.00..0.00 rows=1 width=32)\n    Output: bbl, tbea, bav, insertion_date\n     -\u003e  Foreign Scan on public.tax_bills_nyc  (cost=0.00..0.00 rows=0 width=32)\n             Output: bbl, tbea, bav, insertion_date\n             Remote SQL: SELECT bbl, tbea, bav, insertion_date FROM test_database.tax_bills_nyc\n    (5 rows)\n ```\n\n\nTo learn more about ``Percona-Lab/clickhousedb_fdw`` configuration and usage, see [User Guide](https://github.com/Percona-Lab/clickhousedb_fdw/blob/master/docs/USER_GUIDE.md).\n\n## Submitting Bug Reports\n\nIf you found a bug in ``clickhousedb_fdw``, please submit the report to the [Jira issue tracker](https://jira.percona.com/projects/PG/issues)\n\nStart by searching the open tickets for a similar report. If you find that someone else has already reported your issue, then you can upvote that report to increase its visibility.\n\nIf there is no existing report, submit your report following these steps:\n\nSign in to [Jira issue tracker](https://jira.percona.com/projects/PG/issues). You will need to create an account if you do not have one.\n\nIn the *Summary*, *Description*, *Steps To Reproduce*, *Affects Version* fields describe the problem you have detected. \n\nAs a general rule of thumb, try to create bug reports that are:\n\n- Reproducible: describe the steps to reproduce the problem.\n\n- Unique: check if there already exists a JIRA ticket to describe the problem.\n\n- Scoped to a Single Bug: only report one bug in one JIRA ticket.\n\n\n## Copyright Notice\n\nPortions Copyright © 2018-2020, Percona LLC and/or its affiliates\n\nPortions Copyright © 2019-2020, Adjust GmbH\n\nPortions Copyright © 1996-2020, PostgreSQL Global Development Group\n\nPortions Copyright © 1994, The Regents of the University of California\n\n\n* Master branch is under heavy development phase, you may face some compilation issues. The REL_0_1_ still can be used.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPercona-Lab%2Fclickhousedb_fdw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPercona-Lab%2Fclickhousedb_fdw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPercona-Lab%2Fclickhousedb_fdw/lists"}