Skip to content

Push sort requirements through simple projections#27

Merged
askalt merged 1 commit into
release-52.3.0from
aectaan/push_sorts_through_simple_projections
Jul 6, 2026
Merged

Push sort requirements through simple projections#27
askalt merged 1 commit into
release-52.3.0from
aectaan/push_sorts_through_simple_projections

Conversation

@aectaan

@aectaan aectaan commented Jul 1, 2026

Copy link
Copy Markdown

Allow EnforceSorting sort pushdown to remap ordering requirements through ProjectionExec when the required output columns are simple aliases or reordered input columns.

Prior this patch sort pushdown stopped at ProjectionExec, even when the projection only changed column order. This could force a SortExec above the projection and therefore above larger subplans such as UnionExec, preventing branch-local sorts from being used.

The new logic conservatively handles only column-to-column projections and leaves computed expressions untouched, preserving correctness while enabling better plans for reordered projection cases.

@aectaan aectaan requested a review from askalt July 1, 2026 08:57
@aectaan aectaan self-assigned this Jul 1, 2026
@aectaan aectaan force-pushed the aectaan/push_sorts_through_simple_projections branch 2 times, most recently from 0b56a23 to dbfab25 Compare July 2, 2026 09:01
@aectaan

aectaan commented Jul 5, 2026

Copy link
Copy Markdown
Author

Approved in upstream: apache#23288

@askalt

askalt commented Jul 6, 2026

Copy link
Copy Markdown

Let's fix cargo test jobs.

@aectaan

aectaan commented Jul 6, 2026

Copy link
Copy Markdown
Author

Tests are broken far before this patch. I suggest combine test fix with bumping to actual release instead

@askalt

askalt commented Jul 6, 2026

Copy link
Copy Markdown

Tests are broken far before this patch. I suggest combine test fix with bumping to actual release instead

In the branch https://github.com/tarantool/datafusion/tree/release-52.3.0 tests are green. What is the reason on the non-stability? I mean, cargo test jobs (not wasm, benchmark results).

@askalt

askalt commented Jul 6, 2026

Copy link
Copy Markdown

Tests are broken far before this patch. I suggest combine test fix with bumping to actual release instead

I am OK to bump DF, we could switch to a newer one just after TCS 1.3.0 is tagged.

Allow EnforceSorting sort pushdown to remap ordering requirements through
ProjectionExec when the required output columns are simple aliases or reordered
input columns.

Prior this patch sort pushdown stopped at `ProjectionExec`, even when the projection
only changed column order. This could force a `SortExec` above the projection and
therefore above larger subplans such as `UnionExec`, preventing branch-local sorts
from being used.

The new logic conservatively handles only column-to-column projections and leaves
computed expressions untouched, preserving correctness while enabling better
plans for reordered projection cases.
@aectaan aectaan force-pushed the aectaan/push_sorts_through_simple_projections branch from dbfab25 to 8309c8f Compare July 6, 2026 13:19
@askalt askalt merged commit c185883 into release-52.3.0 Jul 6, 2026
52 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants