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: handle exists and nexists for mat columns and top level columns #6680

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

Conversation

nityanandagohain
Copy link
Member

@nityanandagohain nityanandagohain commented Dec 19, 2024

Fixes #6584

  • For materialized columns it uses the exists column
  • For top level columns it checks on the value.

Important

Improved handling of exists and not exists operators for materialized and top-level columns in query builder with updated tests.

  • Behavior:
    • Updated handling of exists and not exists operators for materialized and top-level columns in query_builder.go.
    • Introduced getExistsNexistsFilter() to manage these operators.
  • Tests:
    • Updated Test_buildTracesFilterQuery and Test_buildTracesQuery in query_builder_test.go to cover new behavior.
    • Added test cases for exists and not exists operators for both materialized and top-level columns.

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

@github-actions github-actions bot added the bug Something isn't working label Dec 19, 2024
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! Reviewed everything up to 161f5fd in 2 minutes and 3 seconds

More details
  • Looked at 123 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. pkg/query-service/app/traces/v4/query_builder.go:101
  • Draft comment:
    Ensure that the column name is properly formatted with backticks. Consider using fmt.Sprintf("%s_exists = %v", strings.TrimSuffix(getColumnName(item.Key), ""), val)` for consistency.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. pkg/query-service/app/traces/v4/query_builder.go:144
  • Draft comment:
    Ensure that the getExistsNexistsFilter function handles all possible data types and scenarios correctly. Consider adding more test cases if necessary.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR modifies the handling of 'exists' and 'not exists' operators for materialized columns and top-level columns. The changes in the getExistsNexistsFilter function and its usage in buildTracesFilterQuery and buildTracesQuery are crucial. The test cases in query_builder_test.go should cover these changes to ensure correctness.
3. pkg/query-service/app/traces/v4/query_builder.go:372
  • Draft comment:
    Ensure that the getExistsNexistsFilter function is correctly handling the AggregateAttribute when it is a materialized column. Consider adding test cases if necessary.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR modifies the handling of 'exists' and 'not exists' operators for materialized columns and top-level columns. The changes in the getExistsNexistsFilter function and its usage in buildTracesFilterQuery and buildTracesQuery are crucial. The test cases in query_builder_test.go should cover these changes to ensure correctness.
4. pkg/query-service/app/traces/v4/query_builder.go:144
  • Draft comment:
    Avoid using inline styles in React components. Use external stylesheets, CSS classes, or styled components instead. This applies to other similar instances in the file.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_XdkiGw2IpfT6p8zC


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

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 2df8d40 in 32 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. pkg/query-service/app/traces/v4/query_builder.go:103
  • Draft comment:
    Ensure that all inputs used in query strings are properly sanitized and validated to prevent SQL injection vulnerabilities.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. pkg/query-service/app/traces/v4/query_builder.go:103
  • Draft comment:
    Use a consistent approach to handle backticks in string formatting to avoid syntax errors.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_pTpFTgrJ1wLKgbkx


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add endpoint for attributes materialization for traces
1 participant