You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Substrait round trip fails for a query that produces a logical plan where the Sort node includes a fetch.
As an example,
Sort: data.b ASC NULLS LAST, fetch=2
Filter: data.a > Int64(1)
TableScan: data projection=[a, b, c, d, e, f], partial_filters=[data.a > Int64(1)]
Upon returning from the round trip produces
Sort: data.b ASC NULLS LAST
Filter: data.a > Int64(1)
TableScan: data projection=[a, b, c, d, e, f], partial_filters=[data.a > Int64(1)]
the fetch is lost.
I'm happy to take and fix this issue, but I wasn't sure where the fix should be made. Should this fix the Sort Rel in substrait that cannot hold a fetch member? Or should this be a fix in the substrait producer to produce a plan with a Limit and a Sort?
To Reproduce
Add a test to datafusion/substrait/tests/cases/round_trip_logical_plan.rs such as
#[tokio::test]asyncfnselect_with_filter_sort_limit() -> Result<()>{roundtrip("SELECT * FROM data WHERE a > 1 ORDER BY b ASC LIMIT 2").await}
in this repo, run
cd datafusion/substrait
cargo test -- --nocapture select_with_filter_sort_limit
Expected behavior
A round trip for this plan should work.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
Substrait round trip fails for a query that produces a logical plan where the Sort node includes a fetch.
As an example,
Upon returning from the round trip produces
the fetch is lost.
I'm happy to take and fix this issue, but I wasn't sure where the fix should be made. Should this fix the Sort Rel in substrait that cannot hold a
fetch
member? Or should this be a fix in the substrait producer to produce a plan with a Limit and a Sort?To Reproduce
Add a test to
datafusion/substrait/tests/cases/round_trip_logical_plan.rs
such asin this repo, run
Expected behavior
A round trip for this plan should work.
Additional context
No response
The text was updated successfully, but these errors were encountered: