Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Clickhouse data source #2300

Merged
merged 18 commits into from
Dec 28, 2023
Merged

feat: Clickhouse data source #2300

merged 18 commits into from
Dec 28, 2023

Conversation

scsmithr
Copy link
Member

@scsmithr scsmithr commented Dec 24, 2023

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

@scsmithr scsmithr mentioned this pull request Dec 27, 2023
6 tasks
@scsmithr scsmithr marked this pull request as ready for review December 27, 2023 22:43
@scsmithr scsmithr added the needs docs 📖 Issues and PRs that require updating docs label Dec 28, 2023
@scsmithr scsmithr enabled auto-merge (squash) December 28, 2023 14:00
@scsmithr scsmithr merged commit eaf795a into main Dec 28, 2023
13 checks passed
@scsmithr scsmithr deleted the sean/clickhouse-ds branch December 28, 2023 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs docs 📖 Issues and PRs that require updating docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants