Fix unparser derived table with columns include calculations, limit/order/distinct#24
Merged
y-f-u merged 5 commits intospiceai-40from Jul 29, 2024
Conversation
phillipleblanc
approved these changes
Jul 29, 2024
y-f-u
added a commit
that referenced
this pull request
Jul 31, 2024
…rder/distinct (#24) * compare format output to make sure the two level of projects match * add method to find inner projection that could be nested under limit/order/distinct * use format! for matching in unparser sort optimization too * refactor * use to_string and also put comments in
phillipleblanc
pushed a commit
that referenced
this pull request
Aug 14, 2024
…calculations, limit/order/distinct (apache#11756) * Fix unparser derived table with columns include calculations, limit/order/distinct (#24) * compare format output to make sure the two level of projects match * add method to find inner projection that could be nested under limit/order/distinct * use format! for matching in unparser sort optimization too * refactor * use to_string and also put comments in * clippy * fix unparser derived table contains cast (#25) * fix unparser derived table contains cast * remove dbg
sgrebnov
pushed a commit
that referenced
this pull request
Sep 2, 2024
…calculations, limit/order/distinct (apache#11756) * Fix unparser derived table with columns include calculations, limit/order/distinct (#24) * compare format output to make sure the two level of projects match * add method to find inner projection that could be nested under limit/order/distinct * use format! for matching in unparser sort optimization too * refactor * use to_string and also put comments in * clippy * fix unparser derived table contains cast (#25) * fix unparser derived table contains cast * remove dbg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix queries that wasn't working.
SELECT id FROM (SELECT j1_id + 1 * 3 from j1) AS c (id)fix: compare using
format!("{expr}") == format!("{outer_expr}")which is a wider rule than `expr == outer_expr. It covers the situation when there are mismatch expr types caused when sql -> logical plan that outer projection has column expr and inner projection has a calculation expr.SELECT c.id FROM (SELECT (j1.j1_id + 1) FROM j1 ORDER BY j1.j1_id DESC NULLS FIRST LIMIT 1) AS c (id)fix: the same fix from above for sort column
j1.j1_idnot in projection listj1.j1_id + 1and projections have mismatch expr types.another fix: use a recursive method to find the inner projection which may hide under limit/order/distinct that prevents
subquery_alias_inner_query_and_columnsto work