-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add support for row subqueries #7774
Merged
Merged
Conversation
This file contains 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
martint
force-pushed
the
row-query
branch
2 times, most recently
from
April 28, 2021 03:56
337a738
to
d5b21f5
Compare
kasiafi
reviewed
Apr 28, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of comments and questions.
core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/planner/SubqueryPlanner.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/test/java/io/trino/sql/query/TestSubqueries.java
Outdated
Show resolved
Hide resolved
testing/trino-tests/src/test/java/io/trino/tests/AbstractTestEngineOnlyQueries.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java
Outdated
Show resolved
Hide resolved
martint
force-pushed
the
row-query
branch
3 times, most recently
from
April 28, 2021 21:09
a8c7d43
to
5b1eb68
Compare
kasiafi
reviewed
Apr 29, 2021
core/trino-main/src/main/java/io/trino/sql/analyzer/ExpressionAnalyzer.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/planner/SubqueryPlanner.java
Outdated
Show resolved
Hide resolved
Looks good to me. It seems you need to drop the bottom commit. |
martint
force-pushed
the
row-query
branch
4 times, most recently
from
April 30, 2021 16:10
431aef1
to
f51cb61
Compare
The PlanBuilder is not necessary. The method only cares about a PlanNode.
Implements SQL's row-subquery construct: <row subquery> ::= <subquery> 3) The degree of a <row subquery> shall be greater than 1 (one). 6) The declared type of a <row subquery> is a row type consisting of one field for each column of QE. The declared type and field name of each field of this row type is the declared type and column name of the corresponding column of QE. 2) Let RS be a <row subquery>. Let RRS be the result of the <query expression> simply contained in RS. Let D be the degree of RRS. Case: a) If the cardinality of RRS is greater than 1 (one), then an exception condition is raised: cardinality violation. b) If the cardinality of RRS is 0 (zero), then the value of the <row subquery> is a row whose degree is D and whose fields are all the null value. c) Otherwise, the value of RS is RRS.
dain
approved these changes
May 3, 2021
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.
Fixes #7773