Repository navigation
fix(sql): preserve rightmost duplicate column names in window aggregates (#47) - #48
Merged
Merged
Conversation
…tes (#47) - Replace or_insert with insert in eval_aggregate_stateful for rightmost column precedence - Add regression tests covering duplicate aliases, identical keys, and wildcard interactions - Add pre-filter WHERE bypass and micro-batched atomic counters in stateless rule actor - Add fast-path sink batching and pre-allocated URL in throughput benchmarks - Update query language documentation per ASD-STE100 standard
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
Summary
This pull request resolves #47. It fixes column projection semantics in window aggregation queries when duplicate column names or aliases are selected.
Problem Statement
In queries with identical column names or aliases (for example,
SELECT a, a * 2 AS a ...orSELECT a, count(a) AS a ... GROUP BY TumblingWindow(ss, 1)), standard SQL semantics require the rightmost column expression to take precedence. Previously,eval_aggregate_statefulusedoutput.entry(key).or_insert(val), retaining the leftmost projected value and discarding the updated rightmost aggregate or computed expression.Solution
.or_insert(..)with direct.insert(key, val)ineval_aggregate_statefulacross identifiers, aggregate calls, expressions, and wildcard projections.Technical Changes
rekuiper-sql):eval_aggregate_statefulto ensure rightmost expression precedence on duplicate column keys.crates/rekuiper-sql/tests/test_issue47_duplicate_names.rs.rekuiper-server):bus_pred_exhaustiveis true, the stateless rule actor directly evaluates projection without re-evaluating the WHERE expression AST tree.source_in,filtered, andenqueuedcounters locally to flush once per 64-record micro-batch, eliminating over 1.5 million atomic operations per 500k events.BATCH_ROWS_KEYmap lookup forall_nopsinks and batchedsink_outatomic counter increments.check_record_errorto bypass string checks on valid payloads.docs/en_US/sqls/query_language_elements.mdfollowing ASD-STE100 guidelines detailing duplicate column name precedence.Performance Benchmark Results
Benchmarked on native ext4 storage (
cargo test --release -p rekuiper-server --test perf_throughput -- --nocapture --test-threads=1):test_pure_engine_throughput_prebuilt_records)test_high_throughput_streaming_pipeline)Local CI Validation
All verification checks were run locally and passed:
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warnings(0 warnings)cargo test -p rekuiper-sql(111 tests passed, 0 failures)cargo test -p rekuiper-sql --test test_issue47_duplicate_names(5/5 passed)cargo test --release --test perf_throughput -- --test-threads=1 --nocapture(passed)