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

refactor(binder): refactor the logic to valid constraints #10192

Merged
merged 2 commits into from
Jun 7, 2023

Conversation

st1page
Copy link
Contributor

@st1page st1page commented Jun 6, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

We have actually 2 kinds of bind error's here

  1. user writes a sql with syntax that we do not support (such as unique key, foreign key)
  2. user writes a syntax illeagle (such as multiple pk definition)

This PR split them to different functions.

Checklist For Contributors

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • I have demonstrated that backward compatibility is not broken by breaking changes and created issues to track deprecated features to be removed in the future. (Please refer to the issue)
  • All checks passed in ./risedev check (or alias, ./risedev c)

Checklist For Reviewers

  • I have requested macro/micro-benchmarks as this PR can affect performance substantially, and the results are shown.

Documentation

  • My PR DOES NOT contain user-facing changes.
Click here for Documentation

Types of user-facing changes

Please keep the types that apply to your changes, and remove the others.

  • Installation and deployment
  • Connector (sources & sinks)
  • SQL commands, functions, and operators
  • RisingWave cluster configuration changes
  • Other (please specify in the release note below)

Release note

@st1page st1page requested review from yuhao-su, xiangjinwu and BugenZhao and removed request for yuhao-su June 6, 2023 09:48
@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Merging #10192 (1fcbc44) into main (6cb4387) will decrease coverage by 0.01%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##             main   #10192      +/-   ##
==========================================
- Coverage   71.03%   71.03%   -0.01%     
==========================================
  Files        1231     1231              
  Lines      210682   210686       +4     
==========================================
  Hits       149658   149658              
- Misses      61024    61028       +4     
Flag Coverage Δ
rust 71.03% <80.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
src/frontend/src/handler/create_table.rs 90.52% <80.00%> (+0.66%) ⬆️

... and 4 files with indirect coverage changes

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

@st1page st1page enabled auto-merge June 6, 2023 10:18
@st1page st1page force-pushed the sts/refactor_bind_constraint branch from d7bfef8 to 1fc4eb9 Compare June 6, 2023 12:18
@@ -119,6 +119,24 @@ impl ColumnIdGenerator {
}
}

fn valid_column_options(c: &ColumnDef) -> Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: what about naming this ensure_column_options_supported?

.into_iter()
.map(|c| {
// All columns except `_row_id` or starts with `_rw` should be visible.
let is_hidden = c.name.starts_with("_rw");
let is_hidden: bool = c.name.starts_with("_rw");
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious why is this type annotation added

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess it is produced when copying and pasting the code. thanks!

@st1page st1page added this pull request to the merge queue Jun 6, 2023
@xiangjinwu xiangjinwu removed this pull request from the merge queue due to a manual request Jun 6, 2023
@st1page st1page enabled auto-merge June 7, 2023 05:24
@st1page st1page added this pull request to the merge queue Jun 7, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 7, 2023
@st1page st1page added this pull request to the merge queue Jun 7, 2023
Merged via the queue into main with commit 1ff31d1 Jun 7, 2023
@st1page st1page deleted the sts/refactor_bind_constraint branch June 7, 2023 07:03
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.

2 participants