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

fix: clickhouse https url #12041

Merged
merged 1 commit into from
Sep 4, 2023
Merged

fix: clickhouse https url #12041

merged 1 commit into from
Sep 4, 2023

Conversation

lmatz
Copy link
Contributor

@lmatz lmatz commented Sep 3, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

#12040

exactly the same issue as ClickHouse/clickhouse-rs#58

Need to test it with Clickhouse Cloud

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@lmatz lmatz requested a review from a team as a code owner September 3, 2023 08:49
@github-actions github-actions bot added the type/fix Bug fix label Sep 3, 2023
@codecov
Copy link

codecov bot commented Sep 3, 2023

Codecov Report

Merging #12041 (b2097d5) into main (257f987) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main   #12041      +/-   ##
==========================================
- Coverage   69.81%   69.80%   -0.01%     
==========================================
  Files        1392     1392              
  Lines      233511   233519       +8     
==========================================
- Hits       163016   163012       -4     
- Misses      70495    70507      +12     
Flag Coverage Δ
rust 69.80% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/connector/src/common.rs 3.44% <0.00%> (-0.21%) ⬇️

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@lmatz
Copy link
Contributor Author

lmatz commented Sep 3, 2023

martin@Lius-MacBook-Pro ~ % ./clickhouse client --host mpbg0njbua.us-west-2.aws.clickhouse.cloud --secure --password 'XXXXXXXXXXXXX'
ClickHouse client version 23.9.1.49 (official build).
Connecting to mpbg0njbua.us-west-2.aws.clickhouse.cloud:9440 as user default.
Connected to ClickHouse server version 23.8.1 revision 54465.

ClickHouse server version is older than ClickHouse client. It may indicate that the server is out of date and can be upgraded.

clickhouse-cloud :) CREATE table demo_test(
    user_id Int32,
    target_id String,
    event_timestamp DateTime64,
)ENGINE = ReplacingMergeTree
PRIMARY KEY (user_id);

CREATE TABLE demo_test
(
    `user_id` Int32,
    `target_id` String,
    `event_timestamp` DateTime64
)
ENGINE = ReplacingMergeTree
PRIMARY KEY user_id

Query id: 22153db8-99b2-4316-97c1-0f6ee61c99b1

Ok.

0 rows in set. Elapsed: 0.204 sec. 

clickhouse-cloud :) select user_id, count(*) from default.demo_test group by user_id limit 10

SELECT
    user_id,
    count(*)
FROM default.demo_test
GROUP BY user_id
LIMIT 10

Query id: 1c1c5acd-b057-4eb1-9d88-79d4327968ce

┌─user_id─┬─count()─┐
│      66 │       1 │
│      94 │       1 │
│      69 │       1 │
│      89 │       1 │
│      41 │       1 │
│      53 │       1 │
│      46 │       1 │
│      50 │       1 │
│       4 │       1 │
│      24 │       1 │
└─────────┴─────────┘

10 rows in set. Elapsed: 0.005 sec. 

clickhouse-cloud :) 
martin@Lius - MacBook - Pro risingwave % psql - h localhost - p 4566 - d dev - U root psql (15.3, server 9.5.0) SSL connection (
  protocol : TLSv1.3, cipher : TLS_AES_256_GCM_SHA384, 
  compression : off
) Type "help" for help.dev => CREATE TABLE user_behaviors (
  user_id INT, 
  target_id VARCHAR, 
  target_type VARCHAR, 
  event_timestamp TIMESTAMP, 
  behavior_type VARCHAR, 
  parent_target_type VARCHAR, 
  parent_target_id VARCHAR, 
  PRIMARY KEY(user_id)
) WITH (
  connector = 'datagen', fields.user_id.kind = 'sequence', 
  fields.user_id.start = '1', fields.user_id.end = '100', 
  fields.user_name.kind = 'random', 
  fields.user_name.length = '10', datagen.rows.per.second = '50'
) FORMAT PLAIN ENCODE JSON;
CREATE_TABLE 

dev => CREATE MATERIALIZED VIEW bhv_mv AS 
SELECT 
  user_id, 
  target_id, 
  event_timestamp 
FROM 
  user_behaviors;
CREATE_MATERIALIZED_VIEW 

dev => CREATE SINK bhv_clickhouse_sink 
FROM 
  bhv_mv WITH (
    connector = 'clickhouse', type = 'append-only', 
    force_append_only = 'true', clickhouse.url = 'https://mpbg0njbua.us-west-2.aws.clickhouse.cloud:8443', 
    clickhouse.user = 'default', clickhouse.password = 'XXXXXXXXXXXXX', 
    clickhouse.database = 'default', 
    clickhouse.table = 'demo_test',
  );
CREATE_SINK 
dev =>

It worked with Clickchouse Cloud

Copy link
Contributor

@tabVersion tabVersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, cc @xxhZs

Copy link
Contributor

@xxhZs xxhZs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@lmatz lmatz added this pull request to the merge queue Sep 4, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 4, 2023
@lmatz lmatz added this pull request to the merge queue Sep 4, 2023
Merged via the queue into main with commit eb4bfeb Sep 4, 2023
7 of 8 checks passed
@lmatz lmatz deleted the lz/connector branch September 4, 2023 05:26
github-actions bot pushed a commit that referenced this pull request Sep 4, 2023
lmatz added a commit that referenced this pull request Sep 4, 2023
Li0k pushed a commit that referenced this pull request Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants