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

Add support for row subqueries #7774

Merged
merged 2 commits into from
May 3, 2021
Merged

Add support for row subqueries #7774

merged 2 commits into from
May 3, 2021

Conversation

martint
Copy link
Member

@martint martint commented Apr 27, 2021

Fixes #7773

@cla-bot cla-bot bot added the cla-signed label Apr 27, 2021
@martint martint force-pushed the row-query branch 2 times, most recently from 337a738 to d5b21f5 Compare April 28, 2021 03:56
@sopel39 sopel39 requested a review from kasiafi April 28, 2021 08:26
Copy link
Member

@kasiafi kasiafi left a 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.

@kasiafi
Copy link
Member

kasiafi commented Apr 29, 2021

Looks good to me. It seems you need to drop the bottom commit.

@martint martint force-pushed the row-query branch 4 times, most recently from 431aef1 to f51cb61 Compare April 30, 2021 16:10
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.
@martint martint merged commit f9311ae into trinodb:master May 3, 2021
@martint martint added this to the 357 milestone May 3, 2021
@martint martint deleted the row-query branch May 3, 2021 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Add support for row subqueries
3 participants