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(frontend): support union and union all. #6363

Merged
merged 9 commits into from
Nov 15, 2022
Merged

Conversation

chenzl25
Copy link
Contributor

@chenzl25 chenzl25 commented Nov 15, 2022

I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.

What's changed and what's your intention?

PLEASE DO NOT LEAVE THIS EMPTY !!!

Please explain IN DETAIL what the changes are in this PR and why they are needed:

  • Support Union [ALL] for frontend.
  • Add Query and SetOperation to BoundSetExpr and make it consistent with parser.
pub enum BoundSetExpr {
    Select(Box<BoundSelect>),
    Query(Box<BoundQuery>),
    Values(Box<BoundValues>),
    /// UNION/EXCEPT/INTERSECT of two queries
    SetOperation {
        op: BoundSetOperation,
        all: bool,
        left: Box<BoundSetExpr>,
        right: Box<BoundSetExpr>,
    },
}

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

If your pull request contains user-facing changes, please specify the types of the changes, and create a release note. Otherwise, please feel free to remove this section.

Types of user-facing changes

Please keep the types that apply to your changes, and remove those that do not apply.

  • SQL commands, functions, and operators

Release note

  • Support UNION sql syntax for batch query.

Refer to a related PR or issue link (optional)

#2912

src/frontend/src/binder/set_expr.rs Outdated Show resolved Hide resolved
src/frontend/src/expr/mod.rs Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 15, 2022

Codecov Report

Merging #6363 (ec07710) into main (afd39fe) will decrease coverage by 0.04%.
The diff coverage is 59.49%.

@@            Coverage Diff             @@
##             main    #6363      +/-   ##
==========================================
- Coverage   74.36%   74.32%   -0.05%     
==========================================
  Files         955      958       +3     
  Lines      156183   156423     +240     
==========================================
+ Hits       116143   116257     +114     
- Misses      40040    40166     +126     
Flag Coverage Δ
rust 74.32% <59.49%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/batch/src/lib.rs 100.00% <ø> (ø)
src/compute/src/rpc/service/config_service.rs 0.00% <0.00%> (ø)
src/compute/src/server.rs 0.00% <0.00%> (ø)
src/ctl/src/cmd_impl/compute.rs 0.00% <0.00%> (ø)
src/ctl/src/lib.rs 0.89% <0.00%> (-0.04%) ⬇️
src/expr/src/lib.rs 100.00% <ø> (ø)
src/expr/src/vector_op/cast.rs 82.39% <0.00%> (-3.36%) ⬇️
src/frontend/src/binder/mod.rs 100.00% <ø> (ø)
...c/frontend/src/optimizer/plan_node/batch_insert.rs 56.81% <0.00%> (-8.98%) ⬇️
...tend/src/optimizer/plan_node/logical_hop_window.rs 99.43% <ø> (ø)
... and 32 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@chenzl25 chenzl25 requested a review from xiangjinwu November 15, 2022 07:10
@xiangjinwu xiangjinwu added the user-facing-changes Contains changes that are visible to users label Nov 15, 2022
@mergify mergify bot merged commit 0d48ace into main Nov 15, 2022
@mergify mergify bot deleted the dylan/support_union_planner branch November 15, 2022 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature user-facing-changes Contains changes that are visible to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants