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

feat: Subquery - ANY, ALL and IN support #142

Merged
merged 6 commits into from
Feb 28, 2024

Conversation

waralexrom
Copy link
Member

Which issue does this PR close?

Closes #.

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

// This will be extended with `AnyAll` type.
/// ANY(...) / ALL(...)
AnyAll,
// [NOT] IN(...) is not defined as it is implicitly evaluated as ANY = (...) / ALL <> (...) // This will be extended with `AnyAll` type.
Copy link
Member

Choose a reason for hiding this comment

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

Legacy comment: // This will be extended with `AnyAll` type.

@@ -341,8 +344,19 @@ impl Subquery {
pub fn transform_field(field: &Field, typ: SubqueryType) -> Field {
match typ {
SubqueryType::Scalar => field.clone(),
SubqueryType::Exists => Field::new(field.name(), DataType::Boolean, false),
// Field will be transformed for `AnyAll` as well
SubqueryType::Exists => Field::new(field.name(), DataType::Boolean, false), // Field will be transformed for `AnyAll` as well
Copy link
Member

Choose a reason for hiding this comment

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

Legacy comment: // Field will be transformed for `AnyAll` as well

@@ -1039,18 +1039,140 @@ async fn test_binary_any() -> Result<()> {
// utf8
test_expression!("'a' = ANY(['a', 'b'])", "true");
test_expression!("'c' = ANY(['a', 'b'])", "false");
//test_expression!("'c' = ANY(['a', NULL])", "NULL");
Copy link
Member

Choose a reason for hiding this comment

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

Is this test commented out intentionally?

@waralexrom waralexrom force-pushed the cubesql/subquery-exists branch from 215a977 to fcacb68 Compare February 27, 2024 16:37
@waralexrom waralexrom force-pushed the cubesql/subquery-in-any-all branch from 545d684 to 2dbfc49 Compare February 27, 2024 16:55

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@waralexrom waralexrom force-pushed the cubesql/subquery-in-any-all branch from 2dbfc49 to 74024b6 Compare February 28, 2024 11:52
@waralexrom waralexrom changed the base branch from cubesql/subquery-exists to cubesql-3-04-2022 February 28, 2024 11:53
@waralexrom waralexrom merged commit a93bb96 into cubesql-3-04-2022 Feb 28, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants