Skip to content

test: Pin v2 plan shapes in the enforceSingleRow tests - #1781

Open
mbasmanova wants to merge 2 commits into
facebookincubator:mainfrom
mbasmanova:export-D117583558
Open

test: Pin v2 plan shapes in the enforceSingleRow tests#1781
mbasmanova wants to merge 2 commits into
facebookincubator:mainfrom
mbasmanova:export-D117583558

Conversation

@mbasmanova

Copy link
Copy Markdown
Contributor

Summary:
Both tests pinned v1's plan and skipped the comparison under v2, which hid two places where v2 plans better. For

SELECT * FROM region WHERE r_regionkey > (SELECT n_regionkey FROM nation)

v2 carries the comparison as the nested loop join condition, where v1 emits a cross join followed by a Filter and a Project. For the scalar subquery in a projection, v2 puts the one-row EnforceSingleRow side on the join's build input; v1 builds on the driving table instead, and Velox buffers the entire build side, so v1's memory grows with that table.

Both tests now assert with AXIOM_ASSERT_PLAN_V2. v1 still has to produce a plan, but its shape is no longer compared.

bypass-github-export-checks

Differential Revision: D117583558

Summary: `AXIOM_ASSERT_PLAN_V1` skips the shape comparison under v2, so a v2 plan that already matches the pinned shape goes unchecked. 14 assertions in `SubqueryTest` were pinned that way even though both optimizers produce the same plan; they now use `AXIOM_ASSERT_PLAN` and hold v2 to the shape as well. The pins that remain are real v2 differences.

Differential Revision: D117580754
Summary:
Both tests pinned v1's plan and skipped the comparison under v2, which hid two places where v2 plans better. For

    SELECT * FROM region WHERE r_regionkey > (SELECT n_regionkey FROM nation)

v2 carries the comparison as the nested loop join condition, where v1 emits a cross join followed by a Filter and a Project. For the scalar subquery in a projection, v2 puts the one-row `EnforceSingleRow` side on the join's build input; v1 builds on the driving table instead, and Velox buffers the entire build side, so v1's memory grows with that table.

Both tests now assert with `AXIOM_ASSERT_PLAN_V2`. v1 still has to produce a plan, but its shape is no longer compared.

bypass-github-export-checks

Differential Revision: D117583558
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 26, 2026
@meta-codesync

meta-codesync Bot commented Aug 26, 2026

Copy link
Copy Markdown

@mbasmanova has exported this pull request. If you are a Meta employee, you can view the originating Diff in D117583558.

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

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant