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(source): remove upsert_avro_primary_key and separate extracting columns and bind pk #13023

Merged
merged 9 commits into from
Oct 30, 2023

Conversation

yuhao-su
Copy link
Contributor

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

What's changed and what's your intention?

  • remove upsert_avro_primary_key, which is never used.
  • separate extracting columns, bind columns and bind pk.

Checklist

  • 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).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@gitguardian
Copy link

gitguardian bot commented Oct 27, 2023

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id Secret Commit Filename
7648795 Generic CLI Secret b6ec38e integration_tests/iceberg-cdc/run_test.sh View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Merging #13023 (84755d1) into main (abf3a78) will decrease coverage by 0.05%.
Report is 5 commits behind head on main.
The diff coverage is 23.75%.

@@            Coverage Diff             @@
##             main   #13023      +/-   ##
==========================================
- Coverage   68.31%   68.27%   -0.05%     
==========================================
  Files        1498     1498              
  Lines      252688   252666      -22     
==========================================
- Hits       172636   172496     -140     
- Misses      80052    80170     +118     
Flag Coverage Δ
rust 68.27% <23.75%> (-0.05%) ⬇️

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

Files Coverage Δ
src/connector/src/parser/avro/parser.rs 69.12% <ø> (+0.73%) ⬆️
src/connector/src/parser/mod.rs 47.22% <ø> (-0.15%) ⬇️
src/frontend/src/handler/create_sink.rs 66.66% <ø> (ø)
src/frontend/src/handler/create_table.rs 84.43% <95.00%> (+0.14%) ⬆️
src/connector/src/parser/upsert_parser.rs 63.15% <33.33%> (-2.36%) ⬇️
src/sqlparser/src/ast/ddl.rs 78.19% <0.00%> (-1.90%) ⬇️
src/frontend/src/handler/create_source.rs 52.05% <17.82%> (+2.72%) ⬆️

... and 17 files with indirect coverage changes

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

Copy link
Contributor

@tabVersion tabVersion left a comment

Choose a reason for hiding this comment

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

generally LGTM

info: &StreamSourceInfo,
with_properties: &HashMap<String, String>,
) -> Result<(Vec<ColumnCatalog>, Vec<String>)> {
) -> Result<Option<Vec<String>>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

give an empty vec instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure I can do this, but it might need further refactoring that is still in discussion.

Comment on lines +604 to +605
|| non_generated_sql_defined_columns[0].name.real_value() != columns[0].name()
|| non_generated_sql_defined_columns[1].name.real_value() != columns[1].name()
Copy link
Contributor

Choose a reason for hiding this comment

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

it can be dangerous indexing by number

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

You should apply the De Morgan's laws here. 😄

@yuhao-su yuhao-su added this pull request to the merge queue Oct 30, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 30, 2023
@yuhao-su yuhao-su added this pull request to the merge queue Oct 30, 2023
Merged via the queue into main with commit 85274f1 Oct 30, 2023
7 of 9 checks passed
@yuhao-su yuhao-su deleted the yuhao/generated_col_source branch October 30, 2023 08:37
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.

4 participants