Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Clickhouse data source (#2300)
Adds support for clickhouse as a data source. `read_clickhouse`: ``` > select * from read_clickhouse('clickhouse://localhost:9000/default', 'bikeshare_stations') limit 1; ┌────────────┬──────────┬────────┬─────────┬───┬─────────────────┬───────┬──────────────────┬───────────────────┐ │ station_id │ name │ status │ address │ … │ footprint_width │ notes │ council_district │ modified_date │ │ ── │ ── │ ── │ ── │ │ ── │ ── │ ── │ ── │ │ Int32 │ Utf8 │ Utf8 │ Utf8 │ │ Float32 │ Utf8 │ Int32 │ Timestamp<s, UTC> │ ╞════════════╪══════════╪════════╪═════════╪═══╪═════════════════╪═══════╪══════════════════╪═══════════════════╡ │ 0 │ South C… │ active │ 1901 S… │ … │ 10.0 │ In t… │ 9 │ 2022-03-04T09:01… │ └────────────┴──────────┴────────┴─────────┴───┴─────────────────┴───────┴──────────────────┴───────────────────┘ ``` External database: ``` > create external database ch ::: from clickhouse ::: options ( connection_string = 'clickhouse://localhost:9000/default' ); Database created > select status, address from ch.default.bikeshare_stations limit 1; ┌────────┬──────────────────────────┐ │ status │ address │ │ ── │ ── │ │ Utf8 │ Utf8 │ ╞════════╪══════════════════════════╡ │ active │ 1901 South Congress Ave. │ └────────┴──────────────────────────┘ ``` External table: ``` > create external table stations ::: from clickhouse ::: options ( connection_string = 'clickhouse://localhost:9000/default', ::: table = 'bikeshare_stations' ); Table created > select council_district, modified_date from stations limit 1; ┌──────────────────┬─────────────────────┐ │ council_district │ modified_date │ │ ── │ ── │ │ Int32 │ Timestamp<s, UTC> │ ╞══════════════════╪═════════════════════╡ │ 9 │ 2022-03-04T09:01:00 │ └──────────────────┴─────────────────────┘ ``` --- Follow up items: #2315
- Loading branch information