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

chore: clickhouse sql support for v3 #6778

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

chore: clickhouse sql support for v3 #6778

wants to merge 7 commits into from

Conversation

srikanthccv
Copy link
Member

@srikanthccv srikanthccv commented Jan 8, 2025

Summary

There are our users who use v3 endpoint for traces with API, it was removed from v3 and moved to v4. This adds back support for v3.


Important

Reintroduces v3 ClickHouse SQL query support with enforced result row limits in the query service.

  • Behavior:
    • Reintroduces support for v3 ClickHouse SQL queries in GetListResultV3() in reader.go.
    • Enforces max_result_rows for v3 queries using MaxResultRowsForCHQuery in wrapper.go and querier.go.
  • Settings:
    • Adds MaxResultRowsForCHQuery to ClickhouseQuerySettings in wrapper.go.
    • Uses MaxResultRowsForCHQuery in addClickHouseSettings() to enforce row limits.
  • Constants:
    • Defines MaxResultRowsForCHQuery as 1,000,000 in constants.go.
  • Query Handling:
    • Modifies runBuilderListQueries() and QueryRange() in querier.go and v2/querier.go to handle v3 ClickHouse SQL queries.

This description was created by Ellipsis for 9dc277a. It will automatically update as commits are pushed.

Copy link

github-actions bot commented Jan 8, 2025

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@github-actions github-actions bot added the chore label Jan 8, 2025
@srikanthccv srikanthccv marked this pull request as ready for review January 16, 2025 12:44
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

1 similar comment
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 528c7c6 in 2 minutes and 27 seconds

More details
  • Looked at 120 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. pkg/query-service/app/querier/querier.go:545
  • Draft comment:
    Typo in context key: 'enfore_max_result_rows' should be 'enforce_max_result_rows'. This typo appears in multiple files and should be corrected.
  • Reason this comment was not posted:
    Marked as duplicate.
2. pkg/query-service/app/querier/v2/querier.go:551
  • Draft comment:
    Typo in context key: 'enfore_max_result_rows' should be 'enforce_max_result_rows'. This typo appears in multiple files and should be corrected.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_PWjJqhdBYsXCTLoj


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

pkg/query-service/app/clickhouseReader/wrapper.go Outdated Show resolved Hide resolved
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 9dc277a in 36 seconds

More details
  • Looked at 39 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. pkg/query-service/app/clickhouseReader/wrapper.go:48
  • Draft comment:
    Fixes a typo in the context key from enfore_max_result_rows to enforce_max_result_rows. Ensure that this change is consistently applied wherever this context key is used.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_nZ43m68P2EsP8Xy5


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@nityanandagohain
Copy link
Member

sorry I didn't understand what this is fixing can you explain a bit more ?

@srikanthccv
Copy link
Member Author

Without this fix, one can't run ClickHouse query for list queries. V4 supports running CH list queries. This change adds backward support for v3. While at it, since events are string, we format them better in list query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants