Skip to content

Add scoped UNION and UNION ALL queries - #46

Merged
prrao87 merged 2 commits into
codex/issue-20-union-delivery-prerequisitesfrom
codex/issue-20-union-delivery
Oct 26, 2026
Merged

prrao87 merged 2 commits into
codex/issue-20-union-delivery-prerequisitesfrom
codex/issue-20-union-delivery

Conversation

@stugorf

@stugorf stugorf commented Oct 26, 2026

Copy link
Copy Markdown
Member

Problem and change

Part of #20. Keep the tracker open for its remaining feature groups.

UNION branches have independent scopes and require matching output names, order and compatible Arrow types. UNION ALL preserves duplicates; UNION deduplicates complete rows. Branch-local ordering and pagination remain local. Numeric/null coercion and result nullability are determined before results are exposed, independent of batch arrival order.

Validation

Head 6e62a429da270649aa6877e81fc4a67df941bdc8; frozen parent ccfc4fece4c1a099ab5b494f6a4533dfd03acc11. Focused checks and regression details record commands, results, documentation and compatibility. The release receipt pins wheel/archive identity and 102 installed tests.

Both complete workloads pass unchanged goldens in memory and lazy modes. Retained first-pass geometric mean speedups are below (greater than one is faster). Per-query results and paired investigations remain in the audit archive.

Workload/mode Main Actual parent
Q30 memory 0.990 0.983
Q30 lazy 0.970 1.038
IC memory 1.004 0.986
IC lazy 1.033 1.084

Measurements use the same Apple M4 Max (16 cores, 128 GiB), macOS 26.6.2 arm64 and Python 3.13.17, with Q30 revision 6260689 and IC revision c185123. Reproduction instructions pin settings, data checksums, locks and commands. The frozen main baseline is code-identical to current main 90114f3; the equivalence check also verifies clean prospective main-target merges.

Individual review gates pass under the recorded repeat/controlled-investigation rules. Initial failed measurements remain intact in the audit record.

User impact

Branches have isolated scopes and compatible output names/counts/types. UNION deduplicates; UNION ALL retains duplicates. Parser/semantic/execution examples and supported-feature tables are updated.

Review ledger · Current contribution guide

Audit archive: 47,675,190 bytes; SHA-256 b3486fb30a34639c830b5d49353b3838f96369f95df959ac35f85511f7f8b2de. The small current-main supplement preserves the documentation update. Original absolute paths in receipts map to included records through the archive index.

Submitted by David Hughes (@stugorf), with AI Collaboration.

Parse UNION and UNION ALL as independent branches, validate matching output columns and compatible Arrow types, and preserve distinct versus bag semantics. Include all branches in query metadata and document direct Rust AST migration.

Part of #20. Submitted by David Hughes (@stugorf), with AI Collaboration. Full combined validation and SF1 measurements remain pending.
Use DataFusion UNION coercion before exposing child schemas and capture the physical result schema for collection. Preserve promoted numeric types and nullable outputs regardless of branch batch arrival order. Add repeated literal and parameter-null checks for collected and streamed results.

The equivalent combined CALL/UNION implementation passed 10 Rust and 88 Python focused cases. Coordinator will validate this isolated commit on the standalone UNION branch.

Submitted by David Hughes (@stugorf), with AI Collaboration.
@prrao87
prrao87 marked this pull request as ready for review October 26, 2026 16:49
@prrao87
prrao87 merged commit 3fd230a into codex/issue-20-union-delivery-prerequisites Oct 26, 2026
8 checks passed
@prrao87
prrao87 deleted the codex/issue-20-union-delivery branch October 26, 2026 16:53
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