Conversation
This was referenced Oct 4, 2026
zzylol
force-pushed
the
stack/509-w7b-2-sql-frequency-recognition
branch
from
October 4, 2026 18:25
f047e41 to
66bc1a6
Compare
zzylol
force-pushed
the
stack/509-w7b-sql-frequency
branch
from
October 4, 2026 18:25
3de4828 to
2798c38
Compare
This was referenced Oct 4, 2026
Draft
Share one UnivMon across distinct, L2 and entropy; document why those readouts stay uncertified
#596
Draft
Port of the parked #565: SQL LN and a complete, unordered `SUM(column) OVER ()` window (SQLWindowSum) run natively, so the original Q2 SQL of #509 Example 2 executes and matches its recognized entropy form. Partitioned, ordered and finite frames stay refused. planner_layering_example2 records Example 2's status: the three queries lower to Cardinality / FrequencyEntropy / FrequencyL2 (the design's integer Q3 does not), the time filter is a scan predicate, plan_stages plans the workload with UnivMon offered to each statistic, and the exact candidates execute (without the time filter: the runtime has no now() yet). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol
force-pushed
the
stack/509-w7b-2-sql-frequency-recognition
branch
from
October 5, 2026 06:21
66bc1a6 to
e211fba
Compare
zzylol
force-pushed
the
stack/509-w7b-sql-frequency
branch
from
October 5, 2026 06:21
2798c38 to
0b2194b
Compare
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.
Rebased on main d4869a7 (DF 54).
Wave 1 chain: #594 → #593 → #592 → #591 → #595 → #596 → #597 → #598 → #599 (on #589)
Why
#598 recognizes the SQL entropy idiom only under narrow conditions. Any other form, such as a nullable
src_ip, stays relational, and its native binding failed:SUM(COUNT(*)) OVER ()value operation has no native implementationLN(p)validaterejectslnThe parked #565 added both on the old stack. This PR ports it and records where #509 Example 2 stands on the current Stage 1 to Stage 3 pipeline. Part of #509 / #580 (W8).
What
Operator::sql_window_sum(input, column, name)appends one nullable total to every row (SUM semantics, NULL for empty or all-NULL input). It is memory-accounted and cooperative, and survives theUncheckedOperatorround trip. Binding accepts onlySUM(col) OVER ()with the unbounded frame. Partitioned, ordered and finite frames returnnative SQL window SUM requires the complete unordered relation.lnuses the same numeric path assqrt.integration-tests/tests/planner_layering_example2.rsrecords Example 2's status.After: the original Q2 SQL and its recognized form return the same values on every fixture:
NULL,-0.0,ln 2, and-0.75 ln 0.75 - 0.25 ln 0.25.Example 2 status (asserted by
planner_layering_example2)CardinalityFrequencyEntropy(the doc's text)FrequencyL2only with a Float64 product. The doc'sSUM(c * c)is Int64 and stays relationalWHERE ts >= now() - INTERVAL '1 minute'becomes a Scan predicate (CAST(ts) >= CAST(now() - 60 s)). It is not a per-measure FILTER and not aTimeRange, and Pass 1 accepts itplan_stages2√5Remaining blockers for the shared UnivMon plan:
no accuracy model for UnivMon). Another agent is adding this.TimeRange. The runtime also has nonow(): binding the windowed queries fails withunsupported scalar expression: CurrentTimestamp, so the exact runs above drop the filter.Countaccumulator for each population guard, and it fails Stage 2 over SQL rows (ColumnRef::SampleValue has no value column).Tests
Ported from #565:
complete_sql_sum_window_preserves_rows_and_nulls,sql_ln_executes_numeric_and_null_arguments,complete_window_sum_enforces_workspace_budget, the original-vs-rewrite entropy comparison, andnative_sql_sum_window_rejects_other_frames. Before the port, both entropy integration tests fail. The developer-doc additions from #565 are not ported.Gate: fmt and clippy (
-D warnings) pass.cargo test --workspace: 1,546 passed, 10 ignored (#589: 1,517 / 10).Ports #565. Stacked on #598.
🤖 Generated with Claude Code