Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PlanCompiler output type for DISTINCT + ORDER BY #1298

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

alancai98
Copy link
Member

@alancai98 alancai98 commented Dec 12, 2023

Relevant Issues

Description

The PlanCompiler was outputting a bag when DISTINCT and ORDER BY were present in a query. A list should have been outputted as EvaluatingCompiler outputs. PlanCompiler rewrites the DISTINCT to use the ExprFunction filter_distinct to preserve a collection's distinct elements. This PR changes that function to return a list when the input is a list.

Other Information

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

Conformance comparison report

Base (55c7a2a) e0bf888 +/-
% Passing 92.54% 92.54% 0.00%
✅ Passing 5384 5384 0
❌ Failing 434 434 0
🔶 Ignored 0 0 0
Total Tests 5818 5818 0

Number passing in both: 5384

Number failing in both: 434

Number passing in Base (55c7a2a) but now fail: 0

Number failing in Base (55c7a2a) but now pass: 0

@alancai98 alancai98 changed the title Fix PlanCompiler output type for DISTINCT + ORDER BY Fix PlanCompiler output type for DISTINCT + ORDER BY Dec 12, 2023
Copy link
Contributor

@rchowell rchowell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@alancai98 alancai98 merged commit 54990be into main Dec 12, 2023
@alancai98 alancai98 deleted the fix-phys-plan-distinct-order-by branch December 12, 2023 21:14
alancai98 added a commit that referenced this pull request Dec 12, 2023
* Adds support for EXCLUDE in the SqlDialect

* fix typer/transfomrer

* Fix Timestamp Type Parsing Issue. (#1284)

* fix timestamp type parsing issue

* Refactors partiql-tests-runner for multiple engines (#1289)

* Adds int32 and int64 variants of date_add (#1291)

* Adds support for DISTINCT in the Planner

* Fix PlanCompiler output type for DISTINCT + ORDER BY (#1298)

* Fixes scan_indexed and adds PIVOT (#1297)

* Port filter_distinct fix to partiql-eval internal

---------

Co-authored-by: John Ed Quinn <johqunn@amazon.com>
Co-authored-by: Yingtao Liu <yliuuu@amazon.com>
Co-authored-by: yliuuuu <107505258+yliuuuu@users.noreply.github.com>
Co-authored-by: John Ed Quinn <40360967+johnedquinn@users.noreply.github.com>
Co-authored-by: R. C. Howell <RCHowell@users.noreply.github.com>
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.

PlannerCompiler w/ SELECT DISTINCT and ORDER BY returns a bag
2 participants