Repository navigation
PR #62 follow-up 21: reject repeated and output-colliding trace groupBy fields - #75
Merged
Merged
Conversation
A repeated groupBy entry, or a field named time, span_count or trace_count, produced duplicate projection names that DataFusion rejected with an opaque plan/schema error. Validate these up front with clear messages and document the rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fix/pr62-21-trace-groupby-collisions # Conflicts: # src/tool_executor.rs
… fix/pr62-21-trace-groupby-collisions
…upby-collisions # Conflicts: # docs/tool-api.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
get_trace_activityprojects eachgroupByfield next to the fixed output aliasestime,span_countandtrace_count.trace_activity_group_byonly checked that each field exists. A repeated entry, or a trace field literally named like an output alias, therefore produced duplicate projection names, and DataFusion rejected the plan with an error that never mentionsgroupBy. Reproduced against the DataFusion trace fixture:groupBy: ["service.name", "service.name"]givesPlan("Projections require unique expression names but the expression \"traces.service.name\" at position 1 and \"traces.service.name\" at position 2 have the same name. ...")groupBy: ["time"](alsospan_countandtrace_count) on a dataset that has such a column givesSchema error: Schema contains qualified field name traces.time and unqualified field name time which would be ambiguousFix
After the existence check,
trace_activity_group_bynow rejects:groupBy field `x` is listed more than oncetime,span_countortrace_count:groupBy field `x` collides with the `x` output columnThe query shape and output rows don't change.
docs/tool-api.mddocuments the rule.Tests
trace_activity_rejects_repeated_and_output_colliding_group_byasserts the exact error for the repeated case and for each of the three aliases, and checks that a normalgroupBystill passes. Without the fix, all four inputs returnOk, so the test fails.cargo test --lib tool_: 47 passed.cargo clippy -- -D warnings: clean.cargo clippy --all-targets: no warnings in touched files.Upstream fidelity
This adds about 10 lines of validation to upstream-owned code (port of parseablehq/parseable 32979cb, parseablehq#1831), with no refactor. An upstream issue/PR draft is prepared separately; nothing has been filed upstream.
Stacking
Stacked on #62 (base
upstream/tool-catalog-1831). Retarget tomainafter #62 merges.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.