Skip to content

feat: uniqCount aggregation#298

Open
cheb0 wants to merge 8 commits intomainfrom
295-unique-count
Open

feat: uniqCount aggregation#298
cheb0 wants to merge 8 commits intomainfrom
295-unique-count

Conversation

@cheb0
Copy link
Member

@cheb0 cheb0 commented Dec 19, 2025

Description

Fixes #295


  • I have read and followed all requirements in CONTRIBUTING.md;
  • I used LLM/AI assistance to make this pull request;

@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 91.02564% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.71%. Comparing base (77fae2c) to head (f697212).

Files with missing lines Patch % Lines
frac/processor/aggregator.go 80.95% 2 Missing and 2 partials ⚠️
proxy/search/ingestor.go 80.00% 1 Missing and 1 partial ⚠️
cmd/seq-db/seq-db.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #298      +/-   ##
==========================================
+ Coverage   71.59%   71.71%   +0.11%     
==========================================
  Files         204      204              
  Lines       14770    14839      +69     
==========================================
+ Hits        10575    10642      +67     
- Misses       3441     3442       +1     
- Partials      754      755       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cheb0 cheb0 force-pushed the 295-unique-count branch 3 times, most recently from 6b82090 to 10737f2 Compare December 22, 2025 08:42
}
if errMessage == consts.ErrTooManyFieldValues.Error() {
return nil, source, fmt.Errorf("store forbids aggregation request: %w", consts.ErrTooManyFieldValues)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to check new resp.Code later as well. on line 614-625

aggs[i] = seq.AggregatableSamples{
SamplesByBin: to,
NotExists: agg.NotExists,
ValuesPool: stringPool,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: seem like we can just do ValuesPool: agg.ValuesPool, and remove stringPool variable

}
for idx := range hist.Values {
h.Values[idx] = struct{}{}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: seems like we can use maps.Copy here

@eguguchkin eguguchkin requested review from eguguchkin and removed request for dkharms January 19, 2026 09:51
@eguguchkin eguguchkin modified the milestones: v0.65.0, v0.66.0 Jan 19, 2026
q.SamplesByBin = make(map[AggBin]*SamplesContainer, len(agg.SamplesByBin))
}

oldToNewIndexMap := make(map[uint32]uint32, len(agg.ValuesPool))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could we use a slice instead of a map here? (It would likely perform better)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

🔴 Performance Degradation

Some benchmarks have degraded compared to the previous run.
Click on Show table button to see full list of degraded benchmarks.

Show table
Name Previous Current Ratio Verdict
FindSequence_Random/large-4 77fae2 b57eaa
13987.92 MB/s 12082.33 MB/s 0.86 🔴
1171.00 ns/op 1356.00 ns/op 1.16 🔴
FindSequence_Random/tiny-4 77fae2 b57eaa
2850.02 MB/s 2536.33 MB/s 0.89 🔴
22.46 ns/op 25.23 ns/op 1.12 🔴
GenerateDocs-4 77fae2 b57eaa
949.50 ns/op 1121.00 ns/op 1.18 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add UniqCount aggregation function

4 participants