feat: AVG skips SQL NULLs via per-column validity bitmap - #11
Open
VedantMadane wants to merge 1 commit into
Open
feat: AVG skips SQL NULLs via per-column validity bitmap#11VedantMadane wants to merge 1 commit into
VedantMadane wants to merge 1 commit into
Conversation
Scoped NULL spike (basalt-db#10): mark explicit INSERT NULLs on Column::nullmask and make AVG ignore them (divide by non-NULL count), keeping the empty-bitmap fast path for importers/benches. Document coverage and remaining NULL work. Closes basalt-db#10 Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
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
Scoped spike for #10: make
AVGskip SQL NULLs using a per-column validity signal, without regressing the all-valid fast path.What changed
Column::nullmask(+is_null_at/set_null_at); empty mask = historical all-valid pathINSERT ... NULLmarks validity (placeholder 0/""still stored underneath)AVGuses non-NULL count; all-NULL → SQLNULLdocs/NULL_AVG_SPIKE.md(covered vs TODO); pointer inGOOD_FIRST_ISSUES.mdNot in this PR (called out in the spike doc)
Disk-persisted validity, importer
\Nmapping, full SUM/MIN/MAX/COUNT(col)/WHERE three-valued logic, projecting NULL cells.Test plan
make clean && make(Linux CI / native; this agent is Windows withoutmmap)basalt-bench 1000000 50000 3still all checks pass (no NULL bitmap on bench data)INSERTmix of values + NULL,SELECT AVG(v)matches SQLite (20 for 10/NULL/30)Related
Closes #10