rusackas opened a new pull request, #42895:
URL: https://github.com/apache/superset/pull/42895

   ### SUMMARY
   
   Draft-only, no code yet. This adds 
`docs/sip/median-stddev-variance-aggregates.md`, a proposal to add `MEDIAN`, 
`STDDEV_SAMP` (Sample Standard Deviation), and `VAR_SAMP` (Sample Variance) as 
real, system-wide metric aggregates, prompted by a report that Pivot Table lost 
several aggregation options somewhere along the way.
   
   Short version: most of what looked missing (Count Unique Values, 
Count/Average/Max/Min, "as fraction of" display) already has an equivalent 
today, see the doc for specifics. Median/StdDev/Variance are genuinely gone, 
system-wide, not just Pivot Table, since #41184 (SIP-216) deliberately removed 
the old pivot-only "Aggregation function" control as the mechanism behind our 
long-standing wrong-totals bug. This isn't purely hypothetical either: the MCP 
chart-creation service already advertises `STDDEV`/`VAR`/`MEDIAN` as valid 
aggregates in its own schemas, and they error at query time today since nothing 
actually wires them up.
   
   The doc lays out why adding these as proper system-wide aggregates is safe 
post-SIP-216 (they fall into the existing "non-additive" bucket automatically 
and get correct DB-rollup totals for free, same as `AVG`/`COUNT_DISTINCT` 
today, no Pivot-Table-specific code needed), plus the real per-engine landmines 
found so far via `sqlglot` cross-dialect testing (MySQL has no native `MEDIAN`; 
MySQL's `VARIANCE()` is population variance, not sample, so a naive dialect 
swap would silently compute the wrong number; SQLite's percentile support 
depends on a non-default compile flag).
   
   Opening as a draft PR rather than going straight to a SIP issue so a few of 
us can pressure-test the framing and the scope calls (particularly what's 
explicitly excluded: First/Last, List Unique Values) before it goes up for a 
vote.
   
   ### TESTING INSTRUCTIONS
   
   N/A, documentation only.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to