Skip to content

Refactoring to introduce calculated fields. - #3061

Open
fulmicoton wants to merge 2 commits into
paul.masurel/jitexpr-corefrom
paul.masurel/refact-agg-for-calc-fields
Open

Refactoring to introduce calculated fields.#3061
fulmicoton wants to merge 2 commits into
paul.masurel/jitexpr-corefrom
paul.masurel/refact-agg-for-calc-fields

Conversation

@fulmicoton

@fulmicoton fulmicoton commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Small refactoring to prepare for the introduction to calcualtd fields.

Instead of materializing a full Column, this PR tries to mildly tweak ColumnBlockAccessor so that it can be filled by different value sources.

The change was actually minor. Some of its accessor required passing a column object, but it was actually only to get cardinality information. The accessor object now stores the cardinality.

As part of the refacotring, I also renamed a bunch of struct and methods that are specific to fused term group bys to have a fused prefix, added assert to make sure we never build them with a column that is not full, and used the accessors specialized for full columns.

Also I removed the generics on ColumnBlockAccessor, as it is only used for u64 representation at the moment.

Move ColumnBlockAccessor out of tantivy-columnar and into the aggregation implementation. Keep its behavior and tests intact while removing it from the public columnar API.
@fulmicoton-dd
fulmicoton-dd force-pushed the paul.masurel/refact-agg-for-calc-fields branch 5 times, most recently from 99fc37c to 5c77d94 Compare August 31, 2026 09:33
@fulmicoton
fulmicoton requested a review from PSeitz August 31, 2026 09:36
@fulmicoton fulmicoton changed the title Paul.masurel/refact agg for calc fields Refactoring to introduce calculated fields. Aug 31, 2026
agg_data: &mut AggregationsSegmentCtx,
) -> crate::Result<()> {
// TODO: remove once we fetch all values for all bucket ids in one go
if docs.len() == 1 && self.missing_u64.is_none() {

@fulmicoton fulmicoton Aug 31, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The optimization has been pushed in <Column as BlockValueSource>::load_block or Column

@fulmicoton-dd
fulmicoton-dd force-pushed the paul.masurel/refact-agg-for-calc-fields branch 2 times, most recently from fd2f136 to d6ff44c Compare August 31, 2026 10:11
@fulmicoton-dd
fulmicoton-dd force-pushed the paul.masurel/refact-agg-for-calc-fields branch from d6ff44c to 7d33d74 Compare August 31, 2026 11:33
@fulmicoton
fulmicoton marked this pull request as ready for review August 31, 2026 15:23
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.

2 participants