-
Notifications
You must be signed in to change notification settings - Fork 254
feat: introduce clickhouse db init script #843
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
base: v2
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
docker/clickhouse/local/init-db.sh
Outdated
set -e | ||
|
||
clickhouse client -n <<'EOSQL' | ||
CREATE TABLE default.otel_logs |
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.
Pretty sure these statements will fail if the user has started running the OTEL collector against the target DB. The exporter creates the initial schema if one doesn't exist.
I think we need to add IF NOT EXISTS
to these create statements. We probably also need to have a corresponding ALTER TABLE IF EXISTS
block for each of these tables as well.
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.
This is likely fine since the script is called only once before the service starts. But I agree its still safer to add the IF NOT EXISTS
guard
69d9424
to
3eeccc4
Compare
Ref: HDX-1777
This shouldn't have any impact on users