Fix unparser derived table with columns include calculations, limit/order/distinct #24
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_id
not in projection listj1.j1_id + 1
and 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_columns
to work