-
Notifications
You must be signed in to change notification settings - Fork 595
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(sink): Support Sinking Enum16 Ids to Clickhouse #14668
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. Generally LGTM.
Would you mind adding a e2e test in https://github.com/risingwavelabs/risingwave/blob/9f9294e5957a9d0d89c3e709b8672c6dc5b72e9b/e2e_test/sink/clickhouse_sink.slt ? You need to modify the CK table schema and the result check here accordingly as well.
Added E2E tests & a comment. I couldn't get |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e2e ci is error, please fix and try again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the ordering of the result check in e2e-clickhouse-sink-test.sh
doesn't match the ordering of the INSERT values. That is why you mistakenly put the wrong expected value in $4
. Feel free to reorder the check.
I was away so just got to updating it. Everything seems to be working now! Thanks for the help 😄 |
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
- | Generic Password | bcb7492 | ci/scripts/regress-test.sh | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am personally a bit concerned about this PR. It seems rely heavily on the internal representation/encoding of Enum
in ClickHouse, which may be subject to change. As you said, Enum8
does not work as expected because it's encoding may differ from Enum16
, but we cannot find any explanation on the difference in ClickHouse docs. So I don't think this is type safe.
Would it be better if we can support Enum
by enhancing ClickHouseField
? I see the crate clickhouse
supports Enum
type while I am not sure if it's possible to utilize it in RisingWave.
Clickhouse will of course reject any rows that are not possible, when enum values don't exist, imo it's reasonable to ask a user to handle this. Otherwise, it is type safe. Supporting enum8 is a matter of wiring through the Info that this is an enum and should be written as 8 |
I see, thank you! I think that example only works because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks
Merge queue setting changed
9651f39
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This is an attempt at solving #14658 it simply allows the Clickhouse connector to sink Int16 / smallint as Enum16s to clickhouse. This "just works" although it's on the user to make sure all data provided is valid.
I've also tested Enum8, but presumably this has slightly different encoding, so causes CH to reject the row.
Checklist
./risedev check
(or alias,./risedev c
)Documentation
TODO Will do this if this change is generally received positively! (Just a tiny change in the Data Type Mapping in the docs).
Release note
Allow sinking Enum16 values to Clickhouse