Skip to content

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

Open
wants to merge 6 commits into
base: v2
Choose a base branch
from

Conversation

wrn14897
Copy link
Member

@wrn14897 wrn14897 commented May 23, 2025

Ref: HDX-1777

This shouldn't have any impact on users

Copy link

changeset-bot bot commented May 23, 2025

⚠️ No Changeset found

Latest commit: 3eeccc4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented May 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hyperdx-v2-oss-app ❌ Failed (Inspect) May 23, 2025 4:54pm

set -e

clickhouse client -n <<'EOSQL'
CREATE TABLE default.otel_logs
Copy link

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.

Copy link
Member Author

@wrn14897 wrn14897 May 23, 2025

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

@wrn14897 wrn14897 force-pushed the warren/introduce-ch-init-script branch from 69d9424 to 3eeccc4 Compare May 23, 2025 16:53
@wrn14897 wrn14897 changed the title (WIP) feat: introduce clickhouse db init script feat: introduce clickhouse db init script May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants