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 EnforceSingleRow operator #240

Closed

Conversation

mbasmanova
Copy link
Contributor

This operator enforces that input has no more than one row and returns that row
unmodified. If input is empty, this operator returns a single row with all
values set to null. If input has more than one row, this operator throws an
exception and aborts the query.

This operator is used in query plans that have non-correlated sub-queries, e.g.

SELECT name
FROM tpch.tiny.nation
WHERE regionkey = (SELECT max(regionkey) FROM tpch.tiny.region)

This operator enforces that input has no more than one row and returns that row
unmodified. If input is empty, this operator returns a single row with all
values set to null. If input has more than one row, this operator throws an
exception and aborts the query.

This operator is used in query plans that have non-correlated sub-queries, e.g.

	SELECT name
	FROM tpch.tiny.nation
	WHERE regionkey = (SELECT max(regionkey) FROM tpch.tiny.region)
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 17, 2021
@facebook-github-bot
Copy link
Contributor

@mbasmanova has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@kgpai kgpai left a comment

Choose a reason for hiding this comment

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

Thanks ! This can also serve as a tutorial on adding a new operator !

@facebook-github-bot
Copy link
Contributor

@mbasmanova merged this pull request in 9038d7e.

rui-mo pushed a commit to rui-mo/velox that referenced this pull request May 17, 2023
PHILO-HE pushed a commit to PHILO-HE/velox that referenced this pull request May 30, 2023
zhouyuan pushed a commit to zhouyuan/velox that referenced this pull request Jun 6, 2023
PHILO-HE pushed a commit to PHILO-HE/velox that referenced this pull request Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants