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

fix: schema validation is skipped once we need to fill a column #2548

Merged
merged 5 commits into from
Oct 9, 2023

Conversation

evenyag
Copy link
Contributor

@evenyag evenyag commented Oct 9, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

This PR fixes an issue that WriteRequest::check_schema() doesn't check the schema of remaining columns in rows if it finds out that a column is absent but has a default value.

It uses a flag to store whether rows have such a column instead of returning directly.

It also adds some tests for input rows with different column order than the region.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

fixes #2547

@evenyag evenyag marked this pull request as ready for review October 9, 2023 08:08
@evenyag evenyag marked this pull request as draft October 9, 2023 08:10
@evenyag evenyag marked this pull request as ready for review October 9, 2023 08:34
@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

Merging #2548 (a08f24a) into develop (ce3c10a) will decrease coverage by 0.33%.
Report is 2 commits behind head on develop.
The diff coverage is 100.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2548      +/-   ##
===========================================
- Coverage    85.34%   85.02%   -0.33%     
===========================================
  Files          737      737              
  Lines       117409   117734     +325     
===========================================
- Hits        100206   100106     -100     
- Misses       17203    17628     +425     

Copy link
Contributor

@v0y4g3r v0y4g3r left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

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

LGTM

@evenyag evenyag added this pull request to the merge queue Oct 9, 2023
Merged via the queue into GreptimeTeam:develop with commit d68dd1f Oct 9, 2023
22 checks passed
@evenyag evenyag deleted the fix/schema-check-skipped branch October 9, 2023 09:31
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
…timeTeam#2548)

* test: test different order

* test: add tests for missing and invalid columns

* fix: do not skip schema validation while missing columns

* chore: use field_columns()

* test: add tests for different column order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic: expecting pushing value of datatype Float64(Float64Type), actual Int64(1024)
3 participants