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(query): Support select * exclude [column_name | (col_name, col_name,...)] #9009

Merged
merged 7 commits into from Dec 1, 2022

Conversation

TCeason
Copy link
Collaborator

@TCeason TCeason commented Nov 29, 2022

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Now support query like this:

select * exclude col1 from t;
select * exclude (col1, col2) from t;

These solution will return err:

  1. if col_name in except is duplicate. e.g. except (id, id)
  2. col_name is not exists in table. e.g. t.* except (id) from t -- table t does not have id column
  3. col_name is ambiguous. e.g. except (id) from (select col1 as id, col2 as id)

Closes #8964

@vercel
Copy link

vercel bot commented Nov 29, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
databend ✅ Ready (Inspect) Visit Preview Dec 1, 2022 at 6:28AM (UTC)

@TCeason TCeason requested review from xudong963, andylokandy and b41sh and removed request for xudong963, andylokandy and b41sh November 29, 2022 11:30
@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label Nov 29, 2022
@sundy-li
Copy link
Member

Keyword EXCEPT should not be allowed to use here. It's ambiguous with union expect query, let's just use EXCLUDE.

@TCeason TCeason changed the title feat(query): Support select * exclude | except [column_name | (col_name, col_name,...)] feat(query): Support select * exclude [column_name | (col_name, col_name,...)] Nov 29, 2022
@TCeason TCeason force-pushed the ISSUE-8964/support_except_col branch from 87a7368 to a7f1923 Compare November 29, 2022 14:01
@TCeason TCeason force-pushed the ISSUE-8964/support_except_col branch from e187b04 to d364111 Compare November 30, 2022 07:31
@TCeason TCeason force-pushed the ISSUE-8964/support_except_col branch from d364111 to d178a61 Compare November 30, 2022 07:45
@TCeason TCeason force-pushed the ISSUE-8964/support_except_col branch from d178a61 to 91a63b7 Compare November 30, 2022 08:09
Copy link
Member

@xudong963 xudong963 left a comment

Choose a reason for hiding this comment

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

The normalize_select_list method is toooo tedious :/

Better to split it (Doing this in the next PR also makes sense to me)

@TCeason
Copy link
Collaborator Author

TCeason commented Nov 30, 2022

The normalize_select_list method is toooo tedious :/

Better to split it (Doing this in the next PR also makes sense to me)

Try to merge * and table.* in the newest commit. Please review it.

2dc0947

@TCeason TCeason requested a review from b41sh December 1, 2022 01:58
@TCeason TCeason force-pushed the ISSUE-8964/support_except_col branch from d6e66b2 to 1f93a0c Compare December 1, 2022 04:23
@BohuTANG BohuTANG requested a review from b41sh December 1, 2022 04:27
src/query/ast/src/parser/query.rs Outdated Show resolved Hide resolved
src/query/ast/src/parser/query.rs Outdated Show resolved Hide resolved
@TCeason TCeason force-pushed the ISSUE-8964/support_except_col branch from 1f93a0c to 22ac230 Compare December 1, 2022 04:59
@TCeason
Copy link
Collaborator Author

TCeason commented Dec 2, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: selecttarget QualifiedName support EXCLUDE(col)
6 participants